Answer the question
In order to leave comments, you need to log in
How to generate classes in SCSS?
I want to generate classes like: .mb-1, .mb-2, .mb-3 etc.
Where .mb-1 { margin-bottom: 1px; } .mb-2 { margin-bottom: 2px; } .mb-3 { margin-bottom: 3px; } etc.
And then also for margin-top by analogy. Do not tell me how to do it? I once did, but haven't used SCSS for a long time and forgot. I stopped at
@for $i from 1 through 12 {
.mb-#{$i} { margin-bottom: $i; }
}
But it doesn't work.
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