Merge pull request #50 from AAorris/master

Remove need for double dashes when accessing theme vars. Add theme example.
This commit is contained in:
Лu Лinveгa
2019-07-15 17:20:06 +12:00
committed by GitHub
2 changed files with 32 additions and 1 deletions

View File

@@ -189,7 +189,8 @@ function Library (ronin) {
}
this.theme = (variable, el = document.documentElement) => {
return getComputedStyle(el).getPropertyValue(variable) // ex. styleprop('--f_high') to get css variable value
// ex. (theme "f_main") -> :root { --f_main: "#fff" }
return getComputedStyle(el).getPropertyValue(`--${variable}`)
}
// Pixels