1
1
mirror of https://github.com/primer/css.git synced 2024-12-10 23:26:59 +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 xl: $width-xl
) !default; ) !default;
$responsive-variants: ("": ""); // This map in the form (breakpoint: variant) is used to iterate over
@each $key in map-keys($breakpoints) { // breakpoints and create both responsive and non-responsive classes in one
$responsive-variants: map-merge($responsive-variants, ($key: "-#{$key}")); // 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 // responive utility position values
$responsive-positions: ( $responsive-positions: (