diff options
| author | Henry Jameson <me@hjkos.com> | 2020-01-13 01:56:29 +0200 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2020-01-13 01:56:29 +0200 |
| commit | 8d2f2866f6d32b4ada155d76e07910b92c218146 (patch) | |
| tree | 7c1ed9597a5753c5b3aff862e0e4ed717906a95d /src/components/style_switcher/style_switcher.js | |
| parent | 5881c13adc312f864a280f9216993839ee86ef1e (diff) | |
computed colors support
Diffstat (limited to 'src/components/style_switcher/style_switcher.js')
| -rw-r--r-- | src/components/style_switcher/style_switcher.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/components/style_switcher/style_switcher.js b/src/components/style_switcher/style_switcher.js index 49b34405..b84d2489 100644 --- a/src/components/style_switcher/style_switcher.js +++ b/src/components/style_switcher/style_switcher.js @@ -42,7 +42,7 @@ const v1OnlyNames = [ ].map(_ => _ + 'ColorLocal') const colorConvert = (color) => { - if (color === 'transparent') { + if (color.startsWith('--') || color === 'transparent') { return color } else { return hex2rgb(color) @@ -409,7 +409,9 @@ export default { } keys.forEach(key => { - this[key + 'ColorLocal'] = rgb2hex(colors[key]) + const color = colors[key] + const hex = rgb2hex(colors[key]) + this[key + 'ColorLocal'] = hex === '#aN' ? color : hex }) } |
