Created
February 2, 2021 15:29
-
-
Save zastrow/3816cc024964087d3c365bd4f14678b7 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
This file contains hidden or 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
$media-queries: ( | |
sm: 40rem, | |
lg: 80rem | |
); | |
@mixin loop-states { | |
&, | |
&\:hover:hover, | |
&\:active:active, | |
&\:focus:focus { | |
@content; | |
} | |
@each $key, $val in $media-queries { | |
// Checks that the media query is a number | |
@if $val != $val + "" { | |
@media (min-width: #{$val}) { | |
&\@#{$key}, | |
&\:hover\@#{$key}:hover, | |
&\:active\@#{$key}:active, | |
&\:focus\@#{$key}:focus { | |
@content; | |
} | |
} | |
} | |
} | |
} | |
.this { | |
@include loop-states { | |
color: red; | |
} | |
} |
This file contains hidden or 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
.this, .this\:hover:hover, .this\:active:active, .this\:focus:focus { | |
color: red; | |
} | |
@media (min-width: 40rem) { | |
.this\@sm, .this\:hover\@sm:hover, .this\:active\@sm:active, .this\:focus\@sm:focus { | |
color: red; | |
} | |
} | |
@media (min-width: 80rem) { | |
.this\@lg, .this\:hover\@lg:hover, .this\:active\@lg:active, .this\:focus\@lg:focus { | |
color: red; | |
} | |
} |
This file contains hidden or 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