Created
April 8, 2021 13:57
-
-
Save khamer/82145d9b813caafc13672cfc73841a98 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$breakpoints: ( | |
md: 576px, | |
lg: 1024px, | |
xl: 1200px | |
) !default; | |
@mixin at($bp, $rule: min-width) { | |
@if map-has-key($breakpoints, $bp) { | |
$bp: map-get($breakpoints, $bp); | |
} | |
@media screen and (#{$rule}: $bp) { | |
@content; | |
} | |
} | |
@mixin bp-modifiers($breakpoints: $breakpoints, $prefix: '.-', $display: block) { | |
display: none; | |
@each $bp, $arg in $breakpoints { | |
@include at($bp) { | |
&.-\@#{nth($bp, 1)} { | |
display: $display; | |
} | |
} | |
} | |
} | |
.foo { | |
@include bp-modifiers; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.foo { | |
display: none; | |
} | |
@media screen and (min-width: 576px) { | |
.foo.-\@md { | |
display: block; | |
} | |
} | |
@media screen and (min-width: 1024px) { | |
.foo.-\@lg { | |
display: block; | |
} | |
} | |
@media screen and (min-width: 1200px) { | |
.foo.-\@xl { | |
display: block; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"sass": { | |
"compiler": "dart-sass/1.26.11", | |
"extensions": {}, | |
"syntax": "SCSS", | |
"outputStyle": "expanded" | |
}, | |
"autoprefixer": false | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment