From c3e6e7c61de8fcf9cdeeeac6479d8a00a9b47b3a Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Tue, 20 Feb 2024 01:18:21 +0200 Subject: [PATCH] improvements to backcompat + fixes to topbar --- src/components/top_bar.style.js | 10 ++++++++- src/services/style_setter/style_setter.js | 1 - src/services/theme_data/theme2_to_theme3.js | 3 ++- top_bar.style.js | 23 --------------------- 4 files changed, 11 insertions(+), 26 deletions(-) delete mode 100644 top_bar.style.js diff --git a/src/components/top_bar.style.js b/src/components/top_bar.style.js index c02fecf1..46b3fb56 100644 --- a/src/components/top_bar.style.js +++ b/src/components/top_bar.style.js @@ -13,7 +13,15 @@ export default { defaultRules: [ { directives: { - background: '--fg' + background: '--fg', + shadow: [{ + x: 0, + y: 0, + blur: 4, + spread: 0, + color: '#000000', + alpha: 0.6 + }] } } ] diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index 14521994..587e6a45 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -13,7 +13,6 @@ export const applyTheme = (input) => { const t1 = performance.now() console.log('Themes 2 initialization took ' + (t1 - t0) + 'ms') const extraRules = convertTheme2To3(theme) - console.log(extraRules) const themes3 = init(extraRules) const t2 = performance.now() console.log('Themes 3 initialization took ' + (t2 - t1) + 'ms') diff --git a/src/services/theme_data/theme2_to_theme3.js b/src/services/theme_data/theme2_to_theme3.js index 7155875f..3d9ede49 100644 --- a/src/services/theme_data/theme2_to_theme3.js +++ b/src/services/theme_data/theme2_to_theme3.js @@ -222,7 +222,7 @@ export const convertTheme2To3 = (data) => { rule.variant = 'outgoing' } else if (prefix === 'panel') { rule.component = 'PanelHeader' - } else if (prefix === 'topbar') { + } else if (prefix === 'topBar') { rule.component = 'TopBar' } else if (prefix === 'chatMessage') { rule.component = 'ChatMessage' @@ -248,6 +248,7 @@ export const convertTheme2To3 = (data) => { case 'Border': newRule.parent = rule newRule.directives.textColor = data.colors[key] + newRule.directives.textAuto = 'no-auto' variantArray = parts.slice(0, -1) break default: diff --git a/top_bar.style.js b/top_bar.style.js deleted file mode 100644 index 4def18a3..00000000 --- a/top_bar.style.js +++ /dev/null @@ -1,23 +0,0 @@ -export default { - name: 'TopBar', - selector: 'nav', - validInnerComponents: [ - 'Link', - 'Text', - 'Icon' - ], - defaultRules: [ - { - directives: { - shadow: [{ - x: 0, - y: 0, - blur: 4, - spread: 0, - color: '#000000', - alpha: 0.6 - }] - } - } - ] -}