We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Config:
$grid-breakpoints: ( xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1300px );
Mixin call:
.bla{ @include media-breakpoint-down(xl){ display:none; } }
CSS output:
.bla{ display:none; }
Mixin/Debugging:
@mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) { $max: breakpoint-max($name, $breakpoints); @debug("==========="); @debug($name); // ==> xl @debug($max); // ==> null @debug("==========="); @if $max { @media (max-width: $max) { @content; } } @else { @content; } }
This is because the breakpoint-max function ...
@function breakpoint-max($name, $breakpoints: $grid-breakpoints) { $next: breakpoint-next($name, $breakpoints); @return if($next, breakpoint-min($next, $breakpoints) - 1px, null); }
... is (also) designed for the media-breakpoint-between mixin. So, the media-breakpoint-down mixin needs to address this.
Possible fix:
@mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) { $max: breakpoint-max($name, $breakpoints); @if $max { @media (max-width: $max) { @content; } } @else { // Largest (last) breakpoint @media (max-width: (map-get($grid-breakpoints, $name) - 1px)) { @content; } } }
Thoughts?
The text was updated successfully, but these errors were encountered:
Fix: sierra-library#78
518e217
No branches or pull requests
Config:
Mixin call:
CSS output:
Mixin/Debugging:
This is because the breakpoint-max function ...
... is (also) designed for the media-breakpoint-between mixin. So, the media-breakpoint-down mixin needs to address this.
Possible fix:
Thoughts?
The text was updated successfully, but these errors were encountered: