Answer the question
In order to leave comments, you need to log in
SASS: extend or mixin?
Please help a newbie clear up a few things with SASS. When should mixins be used? For example, I have a frequently repeated code:
.item
display: flex
justify-content: center
flex-wrap: wrap
It seems to me that instead of a mixin it would be more appropriate to make an extension, like this:
%item
display: flex
justify-content: center
flex- wrap: wrap
.container
@extend %item
We don't repeat the same code over and over, we group selectors and write the same rules for them. So in what cases then it is worth using mixins? Thanks
Answer the question
In order to leave comments, you need to log in
There is no need to divide the world into black and white. It has many more shades.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question