diff options
| author | Henry Jameson <me@hjkos.com> | 2024-02-22 15:15:08 +0200 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2024-02-22 15:15:08 +0200 |
| commit | 779b3dc1228030740ccfbd5192bcd368b526ce56 (patch) | |
| tree | a62252de260a13a25421f5eff6978bc81fb44ee9 /src/services/theme_data/css_utils.js | |
| parent | 09e0e53ad6bb2afd53baf5281290dcee4c20327a (diff) | |
blur support, fix toggled buttons not working right
Diffstat (limited to 'src/services/theme_data/css_utils.js')
| -rw-r--r-- | src/services/theme_data/css_utils.js | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/services/theme_data/css_utils.js b/src/services/theme_data/css_utils.js index b98a78ed..b83b90bf 100644 --- a/src/services/theme_data/css_utils.js +++ b/src/services/theme_data/css_utils.js @@ -108,10 +108,21 @@ export const getCssRules = (rules) => rules.map(rule => { ].filter(x => x).join(';\n') } const color = getCssColorString(rule.dynamicVars.background, rule.directives.opacity) - return [ - rule.directives.backgroundNoCssColor !== 'yes' ? ('background-color: ' + color) : '', - ' --background: ' + color - ].filter(x => x).join(';\n') + const cssDirectives = ['--background: ' + color] + if (rule.directives.backgroundNoCssColor !== 'yes') { + cssDirectives.push('background-color: ' + color) + } + return cssDirectives.filter(x => x).join(';\n') + } + case 'blur': { + const cssDirectives = [] + if (rule.directives.opacity < 1) { + cssDirectives.push(`--backdrop-filter: blur(${v}) `) + if (rule.directives.backgroundNoCssColor !== 'yes') { + cssDirectives.push(`backdrop-filter: blur(${v}) `) + } + } + return cssDirectives.join(';\n') } case 'textColor': { if (rule.directives.textNoCssColor === 'yes') { return '' } |
