-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce theming of
Badge
color variants
`Badge` color variants are now generated using color collections. Other components to be styled the same way already support theming, so `Badge` needs to support theming too. New theming options: `--rui-Badge--<PRIORITY>--<COLOR>__<PROPERTY>` See `theme.scss` for all available options.
- Loading branch information
1 parent
c41f5ed
commit 34b7052
Showing
7 changed files
with
160 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
@use "sass:list"; | ||
@use "../../styles/settings/collections"; | ||
|
||
$badge-size: 1.25rem; | ||
|
||
$colors: list.join(collections.$feedback-colors, collections.$neutral-colors); | ||
$themeable-properties-filled: color, background-color; | ||
$themeable-properties-outline: color; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
@use "string" as rui-string; | ||
|
||
@mixin generate-properties( | ||
$prefix, | ||
$component-name, | ||
$modifier-name: null, | ||
$modifier-value: null, | ||
$variant-name, | ||
$variant-value, | ||
$properties, | ||
) { | ||
$combined-class-name: | ||
if( | ||
$modifier-name and $modifier-value, | ||
".isRoot#{rui-string.capitalize($modifier-name)}#{rui-string.capitalize($modifier-value)}", | ||
"" | ||
); | ||
|
||
#{$combined-class-name}.isRoot#{rui-string.capitalize($variant-name)}#{rui-string.capitalize($variant-value)} { | ||
@each $property in $properties { | ||
--#{$prefix}local-#{$property}: | ||
var( | ||
#{ | ||
"--" | ||
+ $prefix | ||
+ $component-name | ||
+ if($modifier-value, "--" + $modifier-value, "") | ||
+ "--" | ||
+ $variant-value | ||
+ "__" | ||
+ $property | ||
} | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters