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
var myComponent = document.getElementsByClassName('my-component')[0]; | |
myComponent.style.setProperty('--primary', 'green'); |
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
body { | |
--primary: blue; | |
background: var(--primary); | |
} | |
.my-component { | |
--primary: yellow; | |
background: var(--primary); | |
} |
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
div { | |
--pos: 0; | |
left: var(--pos); | |
animation: move 1s; | |
} | |
@keyframes move { | |
to { | |
--pos: 50px; | |
} |
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
:root { | |
--foo: true; | |
} | |
body { | |
background: red; | |
} | |
@supports(--foo: false) { | |
body { |
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
body { | |
background: red; | |
} | |
@supports(--foo: blue) { | |
body { | |
background: green; | |
} | |
} |
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
div { | |
--primary: blue; | |
margin-top: var(--primary, 12px); | |
} |
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> | |
<title>Fallbacks!!!</title> | |
<style> | |
#test { | |
width: 100px; | |
height: 100px; | |
background: red; | |
} |
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
.puzzle-game { | |
display: grid; | |
grid-area: game; | |
align-self: start; | |
justify-self: center; | |
max-width: 35vw; | |
border: 10px solid cornflowerblue; | |
grid: 1fr 1fr 1fr / 1fr 1fr 1fr; | |
background: rgba(0, 0, 0, .5); | |
} |
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
grid-template-rows: 1fr 1fr 1fr; | |
grid-template-columns: 1fr 1fr 1fr; |
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
<p>Variable Fonts</p> |