Created
July 24, 2019 22:27
-
-
Save categulario/13afe2a0b013ae413056630a7296d947 to your computer and use it in GitHub Desktop.
an example of overriding a css variable using a media query
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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf8" /> | |
<style> | |
:root { | |
--thing-color: blue; | |
} | |
#cosa { | |
background-color: var(--thing-color); | |
width: 100px; | |
height: 100px; | |
} | |
@media all and (min-width: 600px) { | |
:root { | |
--thing-color: red; | |
} | |
} | |
</style> | |
</head> | |
<body> | |
<div id="cosa"> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment