-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Closed
Description
I decided to start rewriting our (SASS) toolkit, starting off with my grid class. It's all BEM based, and I ran into the following unexpected/undesired behavior.
I have a SASS map named $grid-gaps that has key/values pairs (e.g. xs: 0.5rem). I loop over them to set the appropriate gap modifiers and wrap them in a @responsive directive so they become responsive:
.o-grid {
...
@each $key, $val in $grid-gaps {
@responsive {
&--gap-#{$key} {
margin: ($val * -0.5);
.o-grid__col {
padding: ($val * 0.5);
}
}
}
}
}
However, the code above also creates responsive prefixes for the child classes, yielding the following:
.l\:o-grid--gap-xs {
margin: -0.25rem;
}
.o-grid--gap-xs .l\:o-grid__col {
padding: .25rem;
}
Instead of the output I desired/expected:
.l\:o-grid--gap-xs {
margin: -0.25rem;
}
.l\:o-grid--gap-xs .o-grid__col {
padding: .25rem;
}
I guess my understanding of @responsive isn't correct, but this felt like a bug to me.
Metadata
Metadata
Assignees
Labels
No labels