Skip to content

Commit b27b483

Browse files
authored
fix(theme): fix dark theme in shadow dom (#3579)
1 parent 795f1c8 commit b27b483

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/theme/build/release.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default {
5050
cssStr = fs.readFileSync(path.resolve(root, 'dist/dark-theme-index.css'), 'utf8')
5151

5252
// 2.3、把 :root.dark 替换为 :root
53-
cssStr = cssStr.replace(':root.dark', ':root').replace(':host.dark', ':host')
53+
cssStr = cssStr.replace(':root.dark', ':root').replace(':host(.dark)', ':host')
5454

5555
jsStr = jsStr.replace('#CSS#', cssStr)
5656
fs.writeFileSync(path.resolve(root, 'src/dark-theme-index.js'), jsStr) // 供开发时(pnpm site), 可以访问到最新的定制主题变量

packages/theme/src/base/dark-theme.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* prettier-ignore */
22
:root.dark,
33
:host .dark,
4-
:host.dark {
4+
:host(.dark) {
55
/* 1.1品牌色 */
66

77
/* 品牌主色 */

0 commit comments

Comments
 (0)