Remove double dash from theme cmd. Update docstring. Add example.

This commit is contained in:
Aaron Morris
2019-07-14 21:58:47 -07:00
parent 5fb97a072b
commit d3530c99fb
2 changed files with 32 additions and 2 deletions

View File

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