-2
I’m learning Sass and I’m doing the grid based on the bootstrap, with different classes for each screen width size, but I don’t understand how it does it in Sass in a smaller way, I don’t want it to look like this
@media (min-width: 576px) {
.container {
max-width: 540px;
}
.col-sm-1 {max-width: 8.333333%;}
.col-sm-2 {max-width: 16.666667%}
.col-sm-3 {max-width: 25%;}
.col-sm-4 {max-width: 33.333333%;}
.col-sm-5 {max-width: 41.666667%;}
.col-sm-6 {max-width: 50%;}
.col-sm-7 {max-width: 58.333333%;}
.col-sm-8 {max-width: 66.666667%;}
.col-sm-9 {max-width: 75%;}
.col-sm-10 {max-width: 83.333333%;}
.col-sm-11 {max-width: 91.666667%;}
.col-sm-12 {max-width: 100%;}
}
@media (min-width: 768px) {
.container {
max-width: 720px;
}
.col-md-1 {max-width: 8.333333%;}
.col-md-2 {max-width: 16.666667%}
.col-md-3 {max-width: 25%;}
.col-md-4 {max-width: 33.333333%;}
.col-md-5 {max-width: 41.666667%;}
.col-md-6 {max-width: 50%;}
.col-md-7 {max-width: 58.333333%;}
.col-md-8 {max-width: 66.666667%;}
.col-md-9 {max-width: 75%;}
.col-md-10 {max-width: 83.333333%;}
.col-md-11 {max-width: 91.666667%;}
.col-md-12 {max-width: 100%;}
}
How would I reduce that code in Sass ?
Can be in scss?
– hugocsl
actually it’s in scss, I’ll edit the question
– Thi100