Last active
January 12, 2021 05:02
-
-
Save mdo/b4237934fce5d1f4aaac02b5f4dd5d72 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
@mixin color-scheme($name) { | |
@if $name == dark { | |
@media (prefers-color-scheme: dark) { | |
@content; | |
} | |
} @else if $name == light { | |
@media (prefers-color-scheme: light) { | |
@content; | |
} | |
} @else { | |
@media (prefers-color-scheme: #{$name}) { | |
@content; | |
} | |
} | |
} | |
.test { | |
@include color-scheme(dark) { | |
display: block; | |
} | |
} | |
.test { | |
@include color-scheme(light) { | |
display: block; | |
} | |
} | |
.test { | |
@include color-scheme(custom) { | |
display: block; | |
} | |
} |
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 (prefers-color-scheme: dark) { | |
.test { | |
display: block; | |
} | |
} | |
@media (prefers-color-scheme: light) { | |
.test { | |
display: block; | |
} | |
} | |
@media (prefers-color-scheme: custom) { | |
.test { | |
display: block; | |
} | |
} |
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