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:
parent
9fe577c02a
commit
289604605f
@ -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: (
|
||||
|
Loading…
Reference in New Issue
Block a user