From d3530c99fb8e71ecbeb9eb9162ec5e99738bddfa Mon Sep 17 00:00:00 2001 From: Aaron Morris Date: Sun, 14 Jul 2019 21:58:47 -0700 Subject: [PATCH] Remove double dash from theme cmd. Update docstring. Add example. --- desktop/sources/scripts/library.js | 4 ++-- examples/theme.lisp | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 examples/theme.lisp diff --git a/desktop/sources/scripts/library.js b/desktop/sources/scripts/library.js index 50f3944..9e895ea 100644 --- a/desktop/sources/scripts/library.js +++ b/desktop/sources/scripts/library.js @@ -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 diff --git a/examples/theme.lisp b/examples/theme.lisp new file mode 100644 index 0000000..498e19f --- /dev/null +++ b/examples/theme.lisp @@ -0,0 +1,30 @@ +((clear) + (def col + (lambda + (i) + (of + ((theme "f_high") + (theme "f_med") + (theme "f_low") + (theme "f_inv") + (theme "b_high") + (theme "b_med") + (theme "b_low") + (theme "b_inv")) + (mod i 8)))) + (def rec + (lambda + (v i) + (if (gt v 0) + ((fill + (circle + (add + (div (of (frame) "w") 1.6) + (mul 1.5 v)) + (mul 10 v) + (mul v (div v 5))) + (col i)) + (rec + (sub v 3) + (add i 1)))))) + (rec 40 0)) \ No newline at end of file