Answer the question
In order to leave comments, you need to log in
How long are hands cut off for this way of setting class rules?
Good day! Taki decided to improve his layout skills a little, it is necessary to make an adequate grid, if not a bootstrap one, then at least something remotely similar. In my understanding, everything is very simple there, that the lines are the columns, only the flex-direction is different. And I wrote the following entry in SASS (SCSS):
@for $i from 1 through 100 {
.column-#{$i} {
display:flex;
flex-direction: column;
width:percentage($number: $i / 100);
}
}
Answer the question
In order to leave comments, you need to log in
In general, everything is ok.
But to reduce the final css, you can use extends
%column {
display:flex;
flex-direction: column;
}
@for $i from 1 through 100 {
.column-#{$i} {
@extend %column;
width:percentage($number: $i / 100);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question