Last active
May 26, 2025 14:31
-
-
Save Kcko/9dcf6c0576a7992a623c8034a7bef096 to your computer and use it in GitHub Desktop.
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
/* | |
https://css-tricks.com/the-css-custom-property-toggle-trick/ | |
*/ | |
html { | |
--mq-sm: initial; | |
} | |
@media (max-width: 600px) { | |
html { | |
--mq-sm: ; | |
} | |
} | |
.card { | |
--bg1: var(--mq-sm) green; /* first can be invalid ;) */ | |
--bg2: red; | |
background: var(--bg1, var(--bg2)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment