@@ -355,10 +355,9 @@ $colors: (
355
355
) !default ;
356
356
357
357
358
- // usage: color ("name_of_color", "type_of_color")
358
+ // usage: colorFunc ("name_of_color", "type_of_color")
359
359
// to avoid to repeating map-get($colors, ...)
360
-
361
- @function color ($color , $type ) {
360
+ @function colorFunc ($color , $type ) {
362
361
@if map-has-key ($colors , $color ) {
363
362
$curr_color : map-get ($colors , $color );
364
363
@if map-has-key ($curr_color , $type ) {
@@ -368,3 +367,36 @@ $colors: (
368
367
@warn " Unknown `#{$color } ` - `#{$type } ` in $colors." ;
369
368
@return null;
370
369
}
370
+
371
+
372
+ // Color Classes
373
+ @each $color_name , $color in $colors {
374
+ @each $color_type , $color_value in $color {
375
+ @if $color_type == " base" {
376
+ .#{$color_name } {
377
+ background-color : $color_value !important ;
378
+ }
379
+ .#{$color_name } -text {
380
+ color : $color_value !important ;
381
+ }
382
+ }
383
+ @else if $color_name != " shades" {
384
+ .#{$color_name } .#{$color_type } {
385
+ background-color : $color_value !important ;
386
+ }
387
+ .#{$color_name } -text.text-#{$color_type } {
388
+ color : $color_value !important ;
389
+ }
390
+ }
391
+ }
392
+ }
393
+
394
+ // Shade classes
395
+ @each $color , $color_value in $shades {
396
+ .#{$color } {
397
+ background-color : $color_value !important ;
398
+ }
399
+ .#{$color } -text {
400
+ color : $color_value !important ;
401
+ }
402
+ }
0 commit comments