Answer the question
In order to leave comments, you need to log in
How to loop through css property values?
Is there a way to loop over property values, such as box-shadows, to set the number of shadows, separated by commas, each time the offset increases by the given value?
Below is what was enough.
%craft {
width: 27px;
height: 31px;
display: block;
margin-right: 10px;
border: 1px solid black;
}
@for $i from 2 through 4 {
$start: 0px; //стартовое смещение
$color: $line-background_color; //цвет
$length: $start - $i; //смещение тени
$shadow: #{$length} #{$length} 0 #{$color}; //все параметры
@for $a from 3 through 5 {
$all: #{$shadow},;
$test: #{$all} ,#{$shadow};
@for $a from 5 through 7 {
$test: #{$shadow},#{$shadow};
.craft {
@extend %craft;
@include box-shadow($test);
}
}
}
}
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