From 3453279fcd9f3d2b9cde9e8ef522980376f67625 Mon Sep 17 00:00:00 2001 From: Mike <1576271227@qq.com> Date: Thu, 14 Sep 2023 11:35:35 +0800 Subject: [PATCH] Feature/dark mode (#1082) * feat: add dark mode * chore: update common submodule * chore: update common * test: update snapshots * test: update snapshots * fix: update some demo ui in dark mode * chore: fix tabs demo bg color in dark mode --------- Co-authored-by: anlyyao --- site/mobile/app.vue | 15 +++++- site/mobile/main.ts | 3 ++ site/styles/mobile/components.less | 2 +- site/styles/mobile/index.less | 54 +++++++++++++++++++ site/web/app.vue | 27 ++++++++++ src/_common | 2 +- .../__test__/__snapshots__/demo.test.jsx.snap | 1 - src/action-sheet/demos/mobile.vue | 6 ++- .../__test__/__snapshots__/demo.test.jsx.snap | 18 ++++++- src/avatar/demos/mobile.vue | 7 ++- .../__test__/__snapshots__/demo.test.jsx.snap | 1 - src/back-top/demos/mobile.vue | 2 +- src/badge/demos/base.vue | 5 ++ src/checkbox/demos/horizontal.vue | 2 +- src/checkbox/demos/special.vue | 2 +- src/count-down/demos/base.vue | 2 +- src/dialog/demos/input.vue | 2 +- src/divider/demos/base.vue | 4 +- src/divider/demos/theme.vue | 2 +- src/dropdown-menu/demos/customized.vue | 1 + src/form/demos/horizontal.vue | 2 +- src/form/demos/mobile.vue | 2 +- src/form/demos/vertical.vue | 2 +- src/icon/demos/mobile.vue | 6 +++ src/image/demos/base.vue | 4 +- src/image/demos/position.vue | 4 +- src/image/demos/shape.vue | 4 +- src/image/demos/status.vue | 4 +- src/input/demos/bordered.vue | 4 +- src/link/demos/base.vue | 2 +- src/link/demos/linkSize.vue | 2 +- src/link/demos/prefix.vue | 2 +- src/link/demos/status.vue | 2 +- src/link/demos/suffix.vue | 2 +- src/link/demos/theme.vue | 2 +- src/link/demos/underline.vue | 2 +- .../__test__/__snapshots__/demo.test.jsx.snap | 6 +-- src/list/demos/mobile.vue | 10 ++-- src/navbar/demos/size.vue | 4 +- src/notice-bar/demos/custom.vue | 6 +-- src/notice-bar/demos/mobile.vue | 2 +- .../__test__/__snapshots__/demo.test.jsx.snap | 4 +- src/overlay/demos/base.vue | 2 +- src/overlay/demos/mobile.vue | 2 +- src/popover/demos/mobile.vue | 2 +- src/popover/demos/placement.vue | 2 +- src/popover/demos/type.vue | 2 +- src/popup/demos/mobile.vue | 2 +- src/popup/demos/with-title.vue | 3 +- src/radio/demos/horizontal.vue | 4 +- src/rate/demos/action.vue | 3 +- src/rate/demos/base.vue | 3 +- src/rate/demos/color.vue | 3 +- src/rate/demos/count.vue | 3 +- src/rate/demos/custom.vue | 3 +- src/rate/demos/show-text.vue | 3 +- src/rate/demos/size.vue | 3 +- src/rate/demos/special.vue | 3 +- .../__test__/__snapshots__/demo.test.jsx.snap | 2 +- src/result/demos/mobile.vue | 8 +-- src/search/demos/action.vue | 2 +- src/search/demos/base.vue | 2 +- src/search/demos/shape.vue | 2 +- src/side-bar/demos/base.vue | 2 +- src/side-bar/demos/custom.vue | 2 +- src/side-bar/demos/mobile.vue | 2 +- src/side-bar/demos/switch.vue | 2 +- src/side-bar/demos/with-icon.vue | 2 +- src/skeleton/demos/animation.vue | 2 +- src/skeleton/demos/mobile.vue | 2 +- src/skeleton/demos/theme.vue | 2 +- src/slider/demos/base.vue | 2 +- src/slider/demos/capsule.vue | 2 +- src/slider/demos/disabled.vue | 2 +- src/slider/demos/label.vue | 2 +- src/slider/demos/range.vue | 2 +- src/slider/demos/step.vue | 2 +- src/stepper/demos/base.vue | 2 +- src/stepper/demos/min-max.vue | 2 +- src/stepper/demos/size.vue | 2 +- src/stepper/demos/status.vue | 2 +- src/stepper/demos/theme.vue | 2 +- src/steps/demos/mobile.vue | 4 +- src/sticky/demos/container.vue | 2 +- src/style/index.js | 2 + src/switch/demos/status.vue | 2 +- src/tab-bar/demos/custom.vue | 6 +++ src/tabs/demos/content.vue | 2 +- src/tag/demos/checkable.vue | 2 +- src/tag/demos/mobile.vue | 4 +- src/textarea/demos/custom.vue | 4 +- src/upload/demos/base.vue | 4 +- src/upload/demos/custom.vue | 4 +- src/upload/demos/multiple.vue | 4 +- src/upload/demos/status.vue | 6 +-- 95 files changed, 266 insertions(+), 113 deletions(-) diff --git a/site/mobile/app.vue b/site/mobile/app.vue index ac18fd7a8..c256f25d7 100644 --- a/site/mobile/app.vue +++ b/site/mobile/app.vue @@ -8,5 +8,18 @@ diff --git a/site/mobile/main.ts b/site/mobile/main.ts index 29ac42d00..5aa24a964 100644 --- a/site/mobile/main.ts +++ b/site/mobile/main.ts @@ -4,6 +4,9 @@ import header from './components/header.vue'; import DemoBlock from './components/demo-block.vue'; import router from './router'; +// import tdesign style +import 'tdesign-mobile-vue/style/index.js'; + import TDesign from '@/index'; import '@common/style/mobile/_reset.less'; import '../styles/mobile/index.less'; diff --git a/site/styles/mobile/components.less b/site/styles/mobile/components.less index 1980b2404..3776f76c6 100644 --- a/site/styles/mobile/components.less +++ b/site/styles/mobile/components.less @@ -32,7 +32,7 @@ } .tag-demo { - background-color: #fff; + background-color: var(--bg-color-demo, #fff); padding: 16px; display: flex; diff --git a/site/styles/mobile/index.less b/site/styles/mobile/index.less index b5462c5cd..c91632953 100644 --- a/site/styles/mobile/index.less +++ b/site/styles/mobile/index.less @@ -3,10 +3,62 @@ @import './components.less'; @import './demo.less'; + +:root[theme-mode="dark"] { + --bg-color-demo: #181818; + --bg-color-demo-secondary: #2c2c2c; + --bg-color-scroll: #434343; + + body{ + background-color: var(--bg-color-demo); + } + .tdesign-demo-topnav { + background-color: var(--bg-color-demo); + &-title { + color: #fff; + } + &__back { + color: #fff; + } + } + .tdesign-demo-main .tdesign-mobile-demo { + background-color: var(--bg-color-demo); + } + .tdesign-demo-main .title, + .tdesign-demo-main .summary, + .tdesign-mobile-demo-block__title, + .tdesign-mobile-demo-block__summary { + color: #fff; + } +} + + html::-webkit-scrollbar, body::-webkit-scrollbar { + width: 16px; + height: 16px; + background: transparent; + } + + html::-webkit-scrollbar-track, body::-webkit-scrollbar-track { + background: var(--bg-color-demo); + } + + html::-webkit-scrollbar-thumb, body::-webkit-scrollbar-thumb { + border-radius: 8px; + border: 4px solid transparent; + background-clip: content-box; + background-color: var(--bg-color-scroll); + } + html::-webkit-scrollbar-corner, body::-webkit-scrollbar-corner { + width: 0; + } + + body { background-color: #F6F6F6; + color: var(--bg-color-tab); } + #app { height: 100%; z-index: 0; @@ -102,3 +154,5 @@ body { cursor: pointer; } } + + diff --git a/site/web/app.vue b/site/web/app.vue index 4c7d16f43..67fa25087 100644 --- a/site/web/app.vue +++ b/site/web/app.vue @@ -27,6 +27,32 @@ const docsMap = { en: sortDocs(enDocs), }; +function watchHtmlMode(callback = () => {}) { + const targetNode = document.documentElement; + const config = { attributes: true }; + + const observerCallback = (mutationsList) => { + for (const mutation of mutationsList) { + if (mutation.attributeName === "theme-mode") { + const themeMode = mutation.target.getAttribute("theme-mode") || 'light'; + if (themeMode) callback(themeMode); + } + } + }; + + const observer = new MutationObserver(observerCallback); + observer.observe(targetNode, config); + + return observer; +} + +function changeIframeMode(mode){ + const iframe = document.querySelector('iframe'); + if (iframe?.contentWindow) { + iframe.contentWindow.document.documentElement.setAttribute('theme-mode', mode); + } +} + export default defineComponent({ data() { return { @@ -62,6 +88,7 @@ export default defineComponent({ }; this.initHistoryVersions(); + watchHtmlMode(changeIframeMode) }, watch: { diff --git a/src/_common b/src/_common index 354d9a148..bb5d79c18 160000 --- a/src/_common +++ b/src/_common @@ -1 +1 @@ -Subproject commit 354d9a14813ac8b5a2a4a7024325195c2397f790 +Subproject commit bb5d79c1813b238b461b01ff3eb69c0560b5cfb8 diff --git a/src/action-sheet/__test__/__snapshots__/demo.test.jsx.snap b/src/action-sheet/__test__/__snapshots__/demo.test.jsx.snap index 0f6d0381d..5bf92c37f 100644 --- a/src/action-sheet/__test__/__snapshots__/demo.test.jsx.snap +++ b/src/action-sheet/__test__/__snapshots__/demo.test.jsx.snap @@ -256,7 +256,6 @@ exports[`ActionSheet > ActionSheet listVue demo works fine 1`] = ` exports[`ActionSheet > ActionSheet mobileVue demo works fine 1`] = `

-
+

ActionSheet 动作面板

从底部弹出的模态框,提供和当前场景相关的操作动作,也支持提供信息输入和描述。

@@ -27,6 +27,10 @@ import StatusVue from './status.vue'; diff --git a/src/back-top/__test__/__snapshots__/demo.test.jsx.snap b/src/back-top/__test__/__snapshots__/demo.test.jsx.snap index f6359a2bf..4071190c5 100644 --- a/src/back-top/__test__/__snapshots__/demo.test.jsx.snap +++ b/src/back-top/__test__/__snapshots__/demo.test.jsx.snap @@ -118,7 +118,6 @@ exports[`BackTop > BackTop mobileVue demo works fine 1`] = `

-
+

BackTop 回到顶部

当页面过长往下滑动是会出现返回顶部的便捷操作,帮助用户快速回到页面顶部

diff --git a/src/badge/demos/base.vue b/src/badge/demos/base.vue index 9dec7de64..2a458a0d9 100644 --- a/src/badge/demos/base.vue +++ b/src/badge/demos/base.vue @@ -37,3 +37,8 @@ import { h } from 'vue'; const IconNotification = () => h(NotificationIcon); + diff --git a/src/checkbox/demos/horizontal.vue b/src/checkbox/demos/horizontal.vue index ecd2bdcec..1e89e30ce 100644 --- a/src/checkbox/demos/horizontal.vue +++ b/src/checkbox/demos/horizontal.vue @@ -20,6 +20,6 @@ const checkboxGroupChange = (value: any, context: { e: Event }) => { padding: 16px; display: flex; justify-content: space-between; - background-color: #fff; + background-color: var(--bg-color-demo, #fff); } diff --git a/src/checkbox/demos/special.vue b/src/checkbox/demos/special.vue index 3aef2b2fb..3c4ea0950 100644 --- a/src/checkbox/demos/special.vue +++ b/src/checkbox/demos/special.vue @@ -29,7 +29,7 @@ const value1 = ref([1, 2]); border-radius: 6px; overflow: hidden; box-sizing: border-box; - border: 1.5px solid #fff; + border: 1.5px solid var(--bg-color-demo, #fff); } .card--active { border-color: #0052d9; diff --git a/src/count-down/demos/base.vue b/src/count-down/demos/base.vue index c3c2f8edf..1fdfad0b4 100644 --- a/src/count-down/demos/base.vue +++ b/src/count-down/demos/base.vue @@ -56,7 +56,7 @@ const time = 96 * 60 * 1000; diff --git a/src/divider/demos/base.vue b/src/divider/demos/base.vue index 449f2d854..e679a6488 100644 --- a/src/divider/demos/base.vue +++ b/src/divider/demos/base.vue @@ -22,7 +22,7 @@ diff --git a/src/divider/demos/theme.vue b/src/divider/demos/theme.vue index 4c82393fc..41dafc80f 100644 --- a/src/divider/demos/theme.vue +++ b/src/divider/demos/theme.vue @@ -10,7 +10,7 @@ diff --git a/src/image/demos/base.vue b/src/image/demos/base.vue index 119e26842..337b21b71 100644 --- a/src/image/demos/base.vue +++ b/src/image/demos/base.vue @@ -61,7 +61,7 @@ const imageSrc = ref('https://tdesign.gtimg.com/demo/demo-image-1.png'); diff --git a/src/input/demos/bordered.vue b/src/input/demos/bordered.vue index b01a614b1..29096847e 100644 --- a/src/input/demos/bordered.vue +++ b/src/input/demos/bordered.vue @@ -15,14 +15,14 @@ import { ErrorCircleFilledIcon } from 'tdesign-icons-vue-next'; diff --git a/src/notice-bar/demos/mobile.vue b/src/notice-bar/demos/mobile.vue index aeeb6c2a9..57ddf877e 100644 --- a/src/notice-bar/demos/mobile.vue +++ b/src/notice-bar/demos/mobile.vue @@ -45,7 +45,7 @@ import scrollDemo from './scrolling.vue'; diff --git a/src/popover/demos/placement.vue b/src/popover/demos/placement.vue index bc88ae5a9..2e13cdc35 100644 --- a/src/popover/demos/placement.vue +++ b/src/popover/demos/placement.vue @@ -115,7 +115,7 @@ &__summary { font-size: 14px; - color: rgba(0, 0, 0, 0.6); + color: var(--td-text-color-secondary, rgba(0, 0, 0, 0.6)); line-height: 22px; } diff --git a/src/popover/demos/type.vue b/src/popover/demos/type.vue index 2958e0385..72b5eea16 100644 --- a/src/popover/demos/type.vue +++ b/src/popover/demos/type.vue @@ -63,7 +63,7 @@ const handleVisibleChange = (val: boolean) => { &__summary { font-size: 14px; - color: rgba(0, 0, 0, 0.6); + color: var(--td-text-color-secondary, rgba(0, 0, 0, 0.6)); line-height: 22px; } } diff --git a/src/popup/demos/mobile.vue b/src/popup/demos/mobile.vue index f04cf2c5f..17bc6a533 100644 --- a/src/popup/demos/mobile.vue +++ b/src/popup/demos/mobile.vue @@ -20,6 +20,6 @@ import customClose from './custom-close.vue'; diff --git a/src/popup/demos/with-title.vue b/src/popup/demos/with-title.vue index fc20be438..b559f2ad9 100644 --- a/src/popup/demos/with-title.vue +++ b/src/popup/demos/with-title.vue @@ -36,6 +36,7 @@ const onHide = () => (visible.value = false); text-align: center; font-weight: 600; font-size: 18px; + color: var(--td-text-color-primary, rgba(0, 0, 0, 0.9)); } .btn { @@ -44,7 +45,7 @@ const onHide = () => (visible.value = false); } .btn--cancel { - color: rgba(0, 0, 0, 0.6); + color: var(--td-text-color-secondary, rgba(0, 0, 0, 0.6)); } .btn--confirm { diff --git a/src/radio/demos/horizontal.vue b/src/radio/demos/horizontal.vue index e1a1ee8cd..68154ad3d 100644 --- a/src/radio/demos/horizontal.vue +++ b/src/radio/demos/horizontal.vue @@ -17,13 +17,13 @@ const groupChangeFn = (value: any, context: { e: Event }) => { diff --git a/src/rate/demos/action.vue b/src/rate/demos/action.vue index 9beb6bc06..19466d0d7 100644 --- a/src/rate/demos/action.vue +++ b/src/rate/demos/action.vue @@ -27,7 +27,7 @@ const value2 = ref(3); line-height: 22px; } .rate-demo-cell { - background-color: #fff; + background-color: var(--bg-color-demo, #fff); padding: 12px 16px; line-height: 1; display: flex; @@ -38,6 +38,7 @@ const value2 = ref(3); font-size: 16px; margin-right: 16px; min-width: 80px; + color: var(--td-text-color-primary, rgba(0, 0, 0, 0.9)); } &--space { diff --git a/src/rate/demos/base.vue b/src/rate/demos/base.vue index 7922049c8..95a93a361 100644 --- a/src/rate/demos/base.vue +++ b/src/rate/demos/base.vue @@ -16,7 +16,7 @@ const value = ref(3); diff --git a/src/rate/demos/color.vue b/src/rate/demos/color.vue index ead90fabd..8f9190b70 100644 --- a/src/rate/demos/color.vue +++ b/src/rate/demos/color.vue @@ -18,7 +18,7 @@ const value1 = ref(3); diff --git a/src/rate/demos/custom.vue b/src/rate/demos/custom.vue index 99c35f754..d30463f0d 100644 --- a/src/rate/demos/custom.vue +++ b/src/rate/demos/custom.vue @@ -17,7 +17,7 @@ const value = ref(3); diff --git a/src/rate/demos/show-text.vue b/src/rate/demos/show-text.vue index 999357534..f20c6a831 100644 --- a/src/rate/demos/show-text.vue +++ b/src/rate/demos/show-text.vue @@ -24,7 +24,7 @@ const texts = ref(['很差', '差', '一般', '好评', '优秀']); diff --git a/src/search/demos/base.vue b/src/search/demos/base.vue index 008a2841e..057ea5740 100644 --- a/src/search/demos/base.vue +++ b/src/search/demos/base.vue @@ -39,7 +39,7 @@ const value = ref(''); diff --git a/src/search/demos/shape.vue b/src/search/demos/shape.vue index 350c7975a..5d2fa1a1c 100644 --- a/src/search/demos/shape.vue +++ b/src/search/demos/shape.vue @@ -15,7 +15,7 @@ const value = ref(''); diff --git a/src/side-bar/demos/base.vue b/src/side-bar/demos/base.vue index 057494c30..480100c68 100644 --- a/src/side-bar/demos/base.vue +++ b/src/side-bar/demos/base.vue @@ -117,7 +117,7 @@ const onScroll = (e: WheelEvent | Event) => { .side-bar-wrapper { display: flex; height: 100vh; - background-color: #fff; + background-color: var(--bg-color-demo, #fff); .content { flex: 1; diff --git a/src/side-bar/demos/custom.vue b/src/side-bar/demos/custom.vue index ce2494be1..f045c4976 100644 --- a/src/side-bar/demos/custom.vue +++ b/src/side-bar/demos/custom.vue @@ -117,7 +117,7 @@ const onScroll = (e: WheelEvent | Event) => { .side-bar-wrapper { display: flex; height: 100vh; - background-color: #fff; + background-color: var(--bg-color-demo, #fff); --td-side-bar-border-radius: 6px; --td-side-bar-active-color: green; diff --git a/src/side-bar/demos/mobile.vue b/src/side-bar/demos/mobile.vue index a50e037eb..95a16c9b3 100644 --- a/src/side-bar/demos/mobile.vue +++ b/src/side-bar/demos/mobile.vue @@ -38,6 +38,6 @@ const handleClick = (t = 'base') => { } .tdesign-mobile-demo { - background-color: #fff; + background-color: var(--bg-color-demo, #fff); } diff --git a/src/side-bar/demos/switch.vue b/src/side-bar/demos/switch.vue index 878443514..3fd393fc3 100644 --- a/src/side-bar/demos/switch.vue +++ b/src/side-bar/demos/switch.vue @@ -82,7 +82,7 @@ const onSideBarChange = (value: TdSideBarProps['value']) => { .side-bar-wrapper { display: flex; height: 100vh; - background-color: #fff; + background-color: var(--bg-color-demo, #fff); overflow: hidden; .content { flex: 1; diff --git a/src/side-bar/demos/with-icon.vue b/src/side-bar/demos/with-icon.vue index fd2ae8129..1ca882568 100644 --- a/src/side-bar/demos/with-icon.vue +++ b/src/side-bar/demos/with-icon.vue @@ -124,7 +124,7 @@ const onScroll = (e: WheelEvent | Event) => { .side-bar-wrapper { display: flex; height: 100vh; - background-color: #fff; + background-color: var(--bg-color-demo, #fff); .content { flex: 1; overflow-y: scroll; diff --git a/src/skeleton/demos/animation.vue b/src/skeleton/demos/animation.vue index 0c9115c0a..c321414d6 100644 --- a/src/skeleton/demos/animation.vue +++ b/src/skeleton/demos/animation.vue @@ -23,7 +23,7 @@ const animationList = [ diff --git a/src/skeleton/demos/theme.vue b/src/skeleton/demos/theme.vue index 8836a2832..6edfcb6fb 100644 --- a/src/skeleton/demos/theme.vue +++ b/src/skeleton/demos/theme.vue @@ -34,7 +34,7 @@ const themeList = [ diff --git a/src/slider/demos/capsule.vue b/src/slider/demos/capsule.vue index 3ba1e655b..c8162ee48 100644 --- a/src/slider/demos/capsule.vue +++ b/src/slider/demos/capsule.vue @@ -32,7 +32,7 @@ const marks = { diff --git a/src/slider/demos/step.vue b/src/slider/demos/step.vue index 1e4de24f8..1950de47d 100644 --- a/src/slider/demos/step.vue +++ b/src/slider/demos/step.vue @@ -24,7 +24,7 @@ const marks = ref({ diff --git a/src/stepper/demos/min-max.vue b/src/stepper/demos/min-max.vue index 5d8847f8f..5ceb55256 100644 --- a/src/stepper/demos/min-max.vue +++ b/src/stepper/demos/min-max.vue @@ -36,6 +36,6 @@ const onOverlimit = ($type: string) => { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; - background-color: #fff; + background-color: var(--bg-color-demo, #fff); } diff --git a/src/stepper/demos/size.vue b/src/stepper/demos/size.vue index 3481b3a94..89f9f06d9 100644 --- a/src/stepper/demos/size.vue +++ b/src/stepper/demos/size.vue @@ -22,6 +22,6 @@ const handleChange = ($event: number) => { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; - background-color: #fff; + background-color: var(--bg-color-demo, #fff); } diff --git a/src/stepper/demos/status.vue b/src/stepper/demos/status.vue index 3db3b5dd0..0c0f72093 100644 --- a/src/stepper/demos/status.vue +++ b/src/stepper/demos/status.vue @@ -7,6 +7,6 @@ diff --git a/src/stepper/demos/theme.vue b/src/stepper/demos/theme.vue index 156f32e2e..5c56bf7fc 100644 --- a/src/stepper/demos/theme.vue +++ b/src/stepper/demos/theme.vue @@ -12,6 +12,6 @@ display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; - background-color: #fff; + background-color: var(--bg-color-demo, #fff); } diff --git a/src/steps/demos/mobile.vue b/src/steps/demos/mobile.vue index 3a24409c0..507343387 100644 --- a/src/steps/demos/mobile.vue +++ b/src/steps/demos/mobile.vue @@ -27,11 +27,11 @@ import special from './special.vue'; .steps-horizontal-demo-block { margin: 16px 0 24px; padding: 16px 0; - background-color: #fff; + background-color: var(--bg-color-demo, #fff); } .steps-vertical-demo-block { margin: 16px 0 24px; padding: 16px; - background-color: #fff; + background-color: var(--bg-color-demo, #fff); } diff --git a/src/sticky/demos/container.vue b/src/sticky/demos/container.vue index 429428868..e3caedcd4 100644 --- a/src/sticky/demos/container.vue +++ b/src/sticky/demos/container.vue @@ -15,7 +15,7 @@ const onScroll = (context: { scrollTop: number; isFixed: boolean }) => { .sticky-demo { width: 100%; height: 150px; - background-color: rgba(255, 255, 255, 1); + background-color: var(--bg-color-demo-secondary, #2c2c2c); } .common-button { color: #fff; diff --git a/src/style/index.js b/src/style/index.js index fcfc17545..6366843e7 100644 --- a/src/style/index.js +++ b/src/style/index.js @@ -1 +1,3 @@ import '../_common/style/web/_global.less'; +// theme(用于换肤) +import '../_common/style/mobile/theme/_index.less'; diff --git a/src/switch/demos/status.vue b/src/switch/demos/status.vue index 596e50d66..36da64b7e 100644 --- a/src/switch/demos/status.vue +++ b/src/switch/demos/status.vue @@ -33,7 +33,7 @@ .demo__title { margin: 24px 16px 16px; - color: rgba(0, 0, 0, 0.6); + color: var(--td-text-color-secondary, rgba(0, 0, 0, 0.6)); font-size: 14px; line-height: 22px; } diff --git a/src/tab-bar/demos/custom.vue b/src/tab-bar/demos/custom.vue index 7fc46c446..7bdae16c3 100644 --- a/src/tab-bar/demos/custom.vue +++ b/src/tab-bar/demos/custom.vue @@ -22,6 +22,12 @@ const list = ref([