diff --git a/components/calendar-heatmap/calendar-heatmap.json b/components/calendar-heatmap/calendar-heatmap.json index a89ef4d..4f0a3f0 100644 --- a/components/calendar-heatmap/calendar-heatmap.json +++ b/components/calendar-heatmap/calendar-heatmap.json @@ -1,4 +1,5 @@ { "component": true, + "styleIsolation": "apply-shared", "usingComponents": {} } diff --git a/components/progress-ring/progress-ring.json b/components/progress-ring/progress-ring.json index a89ef4d..4f0a3f0 100644 --- a/components/progress-ring/progress-ring.json +++ b/components/progress-ring/progress-ring.json @@ -1,4 +1,5 @@ { "component": true, + "styleIsolation": "apply-shared", "usingComponents": {} } diff --git a/custom-tab-bar/index.json b/custom-tab-bar/index.json index a89ef4d..4f0a3f0 100644 --- a/custom-tab-bar/index.json +++ b/custom-tab-bar/index.json @@ -1,4 +1,5 @@ { "component": true, + "styleIsolation": "apply-shared", "usingComponents": {} } diff --git a/utils/theme.js b/utils/theme.js index 485bc13..84d8a2a 100644 --- a/utils/theme.js +++ b/utils/theme.js @@ -41,6 +41,7 @@ const THEMES = [ } ] +const BASE_VARS = '--text:#333;--text-secondary:#999;--bg:#F5F5F5;--card-bg:#FFFFFF;--border:#EEE;--success:#4CAF50;' const DEFAULT_THEME_ID = 'orange' const THEME_KEY = 'app_theme' let _lastNavColor = '' @@ -80,14 +81,14 @@ const applyThemeToPage = (self) => { const theme = getCurrentTheme() self.setData({ theme, - themeStyle: `--primary:${theme.primary};--primary-light:${theme.primaryLight};--primary-bg:${theme.primaryBg};--primary-rgb:${theme.primaryRgb};` + themeStyle: `${BASE_VARS}--primary:${theme.primary};--primary-light:${theme.primaryLight};--primary-bg:${theme.primaryBg};--primary-rgb:${theme.primaryRgb};` }) _setNavBarColor(theme.primary) } const getThemeStyle = (theme) => { const t = theme || getCurrentTheme() - return `--primary:${t.primary};--primary-light:${t.primaryLight};--primary-bg:${t.primaryBg};--primary-rgb:${t.primaryRgb};` + return `${BASE_VARS}--primary:${t.primary};--primary-light:${t.primaryLight};--primary-bg:${t.primaryBg};--primary-rgb:${t.primaryRgb};` } module.exports = {