Last active
December 13, 2019 09:58
-
-
Save Fintan/41829555bb38a67fca178ac54bbeaf07 to your computer and use it in GitHub Desktop.
get hexadecimal string from a css var
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
// see https://codesandbox.io/s/epic-cherry-p6hw0 | |
const computedStyle = getComputedStyle(document.documentElement); | |
const primaryColour = computedStyle.getPropertyValue("--primary-colour").trim(); // outputs #00ff00 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment