Answer the question
In order to leave comments, you need to log in
How to rewrite such code from SASS to LESS?
Save how to rewrite this piece of code from SASS to LESS:
$red: (
"lighten-5": #FFEBEE,
"lighten-4": #FFCDD2,
"base": #F44336
);
$pink: (
"lighten-5": #fce4ec,
"lighten-4": #f8bbd0,
"base": #e91e63
);
$colors: (
"red": $red,
"pink": $pink,
@each $color_name, $color in $colors {
@each $color_type, $color_value in $color {
@if $color_type == "base" {
.#{$color_name} {
background-color: $color_value !important;
}
.#{$color_name}-text {
color: $color_value !important;
}
}
@else {
.#{$color_name}.#{$color_type} {
background-color: $color_value !important;
}
.#{$color_name}-text.text-#{$color_type} {
color: $color_value !important;
}
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question