From cfd200528fcf50d2c9acaf2169f07694568cf11d Mon Sep 17 00:00:00 2001 From: Peng Xiao Date: Mon, 11 Dec 2023 06:05:16 +0000 Subject: [PATCH] fix(component): revert theme flickering (#5238) (#5256) This reverts commit e8cfc807ea2c11ae2680cd01f63f97e8b4d43470. --- packages/frontend/component/src/theme/theme.css.ts | 8 ++------ packages/frontend/core/.webpack/template.html | 1 - 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/frontend/component/src/theme/theme.css.ts b/packages/frontend/component/src/theme/theme.css.ts index c471d45a1f..24187dc84a 100644 --- a/packages/frontend/component/src/theme/theme.css.ts +++ b/packages/frontend/component/src/theme/theme.css.ts @@ -11,12 +11,8 @@ globalStyle('html', { vars: lightCssVariables, }); -globalStyle('html', { - '@media': { - '(prefers-color-scheme: dark)': { - vars: darkCssVariables, - }, - }, +globalStyle('html[data-theme="dark"]', { + vars: darkCssVariables, }); if (process.env.NODE_ENV === 'development') { diff --git a/packages/frontend/core/.webpack/template.html b/packages/frontend/core/.webpack/template.html index 0b8b6e4710..4c0ee95014 100644 --- a/packages/frontend/core/.webpack/template.html +++ b/packages/frontend/core/.webpack/template.html @@ -2,7 +2,6 @@ -