diff options
| author | Henry Jameson <me@hjkos.com> | 2020-01-12 17:46:07 +0200 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2020-01-12 17:46:07 +0200 |
| commit | 88f83fc9fa3652efdbe6aa622d3e0089883e8057 (patch) | |
| tree | 4a070ba37ff3e69c28bf264a5efdf0e290d2bc8c /src/services/style_setter/style_setter.js | |
| parent | d52d1812273ff21bc0436dd261e8934c6010d52f (diff) | |
overhaul how style-switcher makes state, removed tons of copy-paste
Diffstat (limited to 'src/services/style_setter/style_setter.js')
| -rw-r--r-- | src/services/style_setter/style_setter.js | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index 516fb5f6..e11516c0 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -1,7 +1,7 @@ import { times } from 'lodash' import { convert } from 'chromatism' import { rgb2hex, hex2rgb, rgba2css, getCssColor } from '../color_convert/color_convert.js' -import { getColors } from '../theme_data/theme_data.service.js' +import { getColors, DEFAULT_OPACITY } from '../theme_data/theme_data.service.js' // While this is not used anymore right now, I left it in if we want to do custom // styles that aren't just colors, so user can pick from a few different distinct @@ -115,18 +115,7 @@ const getCssShadowFilter = (input) => { } export const generateColors = (themeData) => { - const rawOpacity = Object.assign({ - panel: 1, - btn: 1, - border: 1, - bg: 1, - badge: 1, - text: 1, - alert: 0.5, - input: 0.5, - faint: 0.5, - underlay: 0.15 - }, Object.entries(themeData.opacity || {}).reduce((acc, [k, v]) => { + const rawOpacity = Object.assign({ ...DEFAULT_OPACITY }, Object.entries(themeData.opacity || {}).reduce((acc, [k, v]) => { if (typeof v !== 'undefined') { acc[k] = v } |
