commit: 7238b218f9a0aa60a74eb49a3581aa25e0f1d3f2
parent 545c875a857c129207624b4251cd7cdae1c24c67
Author: Henry Jameson <me@hjkos.com>
Date: Mon, 4 Mar 2024 19:10:23 +0200
fix badgeNotification for themes2
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/services/theme_data/theme2_to_theme3.js b/src/services/theme_data/theme2_to_theme3.js
@@ -126,7 +126,6 @@ export const convertTheme2To3 = (data) => {
data.colors.link = data.colors.link || data.colors.accent
const generateRoot = () => {
const directives = {}
- console.log(data.colors)
basePaletteKeys.forEach(key => { directives['--' + key] = 'color | ' + convert(data.colors[key]).hex })
return {
component: 'Root',
@@ -506,7 +505,6 @@ export const convertTheme2To3 = (data) => {
{ ...newRule, component: 'Tab' },
{ ...newRule, component: 'ScrollbarElement' }
]
- console.log(newRule)
if (newRule.state?.indexOf('toggled') >= 0) {
rules.push({ ...newRule, state: [...newRule.state, 'focused'] })
rules.push({ ...newRule, state: [...newRule.state, 'hover'] })
@@ -516,6 +514,12 @@ export const convertTheme2To3 = (data) => {
rules.push({ ...newRule, state: [...newRule.state, 'focused'] })
}
return rules
+ } else if (newRule.component === 'Badge') {
+ if (newRule.variant === 'notification') {
+ return [newRule, { component: 'Root', directives: { '--badgeNotification': 'color | ' + newRule.directives.background } }]
+ } else {
+ return [newRule]
+ }
} else if (newRule.component === 'TopBar') {
return [newRule, { ...newRule, parent: { component: 'MobileDrawer' }, component: 'PanelHeader' }]
} else {