Skip to content

Commit

Permalink
Expose additional breakpoint information at the root
Browse files Browse the repository at this point in the history
  • Loading branch information
ingebretsen committed Feb 22, 2024
1 parent de74546 commit 2a01b46
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/site/mediaquery.scss
Original file line number Diff line number Diff line change
Expand Up @@ -228,18 +228,29 @@
$var-breakpoint: '--breakpoint',
$var-breakpoint-str: '--breakpoint-str',
$var-breakpoint-width: '--breakpoint-width',
$var-is-mobile: '--is-mobile'
$var-is-mobile: '--is-mobile',
$var-breakpoint-names: '--breakpoint-names',
$var-breakpoint-sizes: '--breakpoint-sizes'
) {
$breakpoints: breakpoints-desc();
$mobile: get-breakpoint(get(mobile-breakpoint));
:root {
$breakpoint-names: ();
$breakpoint-sizes: ();

@each $break, $width in $breakpoints {
$breakpoint-names: append($breakpoint-names, $break);
$breakpoint-sizes: append($breakpoint-sizes, $width);

@include media-until($break) {
#{$var-breakpoint}: #{$break};
#{$var-breakpoint-str}: '#{$break}';
#{$var-breakpoint-width}: #{$width};
#{$var-is-mobile}: #{if($width <= $mobile, true, false)};
}
}

#{$var-breakpoint-names}: $breakpoint-names;
#{$var-breakpoint-sizes}: $breakpoint-sizes;
}
}

0 comments on commit 2a01b46

Please sign in to comment.