Skip to content

Instantly share code, notes, and snippets.

@categulario
Created July 24, 2019 22:27
Show Gist options
  • Save categulario/13afe2a0b013ae413056630a7296d947 to your computer and use it in GitHub Desktop.
Save categulario/13afe2a0b013ae413056630a7296d947 to your computer and use it in GitHub Desktop.
an example of overriding a css variable using a media query
<!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