diff options
| author | Henry Jameson <me@hjkos.com> | 2024-06-21 23:28:24 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2024-06-21 23:28:24 +0300 |
| commit | f9e407de639ce4d20beacd3eca3501639ae161bd (patch) | |
| tree | 49906abb3967f86c968555c3bf8f91553fde63df /src/services/theme_data/css_utils.js | |
| parent | eed05f1380fd60f9564558c82f142c317ef670f5 (diff) | |
made theme debug easier by making it an actual option
Diffstat (limited to 'src/services/theme_data/css_utils.js')
| -rw-r--r-- | src/services/theme_data/css_utils.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/services/theme_data/css_utils.js b/src/services/theme_data/css_utils.js index a89eac3b..8423e8ac 100644 --- a/src/services/theme_data/css_utils.js +++ b/src/services/theme_data/css_utils.js @@ -2,11 +2,6 @@ import { convert } from 'chromatism' import { hex2rgb, rgba2css } from '../color_convert/color_convert.js' -// This changes what backgrounds are used to "stacked" solid colors so you can see -// what theme engine "thinks" is actual background color is for purposes of text color -// generation and for when --stacked variable is used -const DEBUG = false - export const parseCssShadow = (text) => { const dimensions = /(\d[a-z]*\s?){2,4}/.exec(text)?.[0] const inset = /inset/.exec(text)?.[0] @@ -66,7 +61,10 @@ export const getCssShadowFilter = (input) => { .join(' ') } -export const getCssRules = (rules) => rules.map(rule => { +// `debug` changes what backgrounds are used to "stacked" solid colors so you can see +// what theme engine "thinks" is actual background color is for purposes of text color +// generation and for when --stacked variable is used +export const getCssRules = (rules, debug) => rules.map(rule => { let selector = rule.selector if (!selector) { selector = 'html' @@ -93,7 +91,7 @@ export const getCssRules = (rules) => rules.map(rule => { ].join(';\n ') } case 'background': { - if (DEBUG) { + if (debug) { return ` --background: ${getCssColorString(rule.dynamicVars.stacked)}; background-color: ${getCssColorString(rule.dynamicVars.stacked)}; |
