Last active
July 24, 2020 18:01
-
-
Save tomhodgins/2cbf34bb206df1a55c38a4eea4950beb to your computer and use it in GitHub Desktop.
What if you could pass JSON to CSS as the value of a custom property and access .propertyNames and [indexes]
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 { | |
--palette: { | |
"blue": "#06f", | |
"font": ["Comic Sans MS", "Papyrus"] | |
}; | |
font-family: --json(var(--palette).font[1]); | |
color: --color(--json(var(--palette).blue)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment