1
1
mirror of https://github.com/primer/css.git synced 2024-12-02 16:13:02 +03:00

refactor(primer-support): make $responsive-variants easier to grok

This commit is contained in:
Shawn Allen 2019-01-24 14:42:10 -08:00
parent 9fe577c02a
commit 289604605f

View File

@ -80,10 +80,24 @@ $breakpoints: (
xl: $width-xl
) !default;
$responsive-variants: ("": "");
@each $key in map-keys($breakpoints) {
$responsive-variants: map-merge($responsive-variants, ($key: "-#{$key}"));
}
// This map in the form (breakpoint: variant) is used to iterate over
// breakpoints and create both responsive and non-responsive classes in one
// loop:
//
// ```scss
// @each $breakpoint, $variant of $responsive-variants {
// @include breakpoint($breakpoint) {
// .foo#{$variant}-bar { foo: bar !important; }
// }
// }
// ```
$responsive-variants: (
"": "",
sm: "-sm",
md: "-md",
lg: "-lg",
xl: "-xl",
) !default;
// responive utility position values
$responsive-positions: (