Skip to content

Commit 2c3ba03

Browse files
authored
refactor: 全面基于CSS Token改造 (#157)
* 去除冗余的less vars * 替换less vars为css vars * 统一css vars前缀
1 parent 474cd2b commit 2c3ba03

38 files changed

Lines changed: 504 additions & 502 deletions

File tree

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ onMounted(() => {
2020
@import '@/style/variables.less';
2121
2222
#nprogress .bar {
23-
background: @brand-color !important;
23+
background: var(--tdvns-brand-color) !important;
2424
}
2525
</style>

src/assets/assets-setting-auto.svg

Lines changed: 10 additions & 10 deletions
Loading
Lines changed: 10 additions & 10 deletions
Loading

src/components/color/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const style = computed(() => {
2121
const { value } = props;
2222
const { colorList } = store;
2323
return {
24-
background: value !== 'dynamic' ? getBrandColor(value, colorList)['@brand-color'] : panelColor,
24+
background: value !== 'dynamic' ? getBrandColor(value, colorList)['--td-brand-color'] : panelColor,
2525
};
2626
});
2727
</script>

src/components/product-card/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ const handleClickDelete = (product: CardProductType) => {
108108
margin-bottom: 8px;
109109
font-size: 16px;
110110
font-weight: 400;
111-
color: @text-color-primary;
111+
color: var(--tdvns-text-color-primary);
112112
}
113113
114114
&--desc {
115-
color: @text-color-secondary;
115+
color: var(--tdvns-text-color-secondary);
116116
font-size: 12px;
117117
line-height: 20px;
118118
overflow: hidden;

src/components/result/index.vue

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,20 @@ const dynamicComponent = computed(() => {
4848
4949
.result {
5050
&-link {
51-
color: @brand-color;
51+
color: var(--tdvns-brand-color);
5252
text-decoration: none;
5353
cursor: pointer;
5454
5555
&:hover {
56-
color: @brand-color;
56+
color: var(--tdvns-brand-color);
5757
}
5858
5959
&:active {
60-
color: @brand-color;
60+
color: var(--tdvns-brand-color);
6161
}
6262
6363
&--active {
64-
color: @brand-color;
64+
color: var(--tdvns-brand-color);
6565
}
6666
6767
&:focus {
@@ -81,23 +81,23 @@ const dynamicComponent = computed(() => {
8181
8282
&-bg-img {
8383
width: 200px;
84-
color: @brand-color;
84+
color: var(--tdvns-brand-color);
8585
}
8686
8787
&-title {
8888
font-style: normal;
8989
font-weight: 500;
9090
margin-top: 8px;
91-
color: @text-color-primary;
92-
font-size: @font-size-xl;
93-
line-height: @text-line-height-xl;
91+
color: var(--tdvns-text-color-primary);
92+
font-size: var(--tdvns-font-size-xl);
93+
line-height: var(--tdvns-text-line-height-xl);
9494
}
9595
9696
&-tip {
9797
margin: 8px 0 32px;
98-
font-size: @font-size-base;
99-
color: @text-color-secondary;
100-
line-height: @text-line-height-base;
98+
font-size: var(--tdvns-font-size-base);
99+
color: var(--tdvns-text-color-secondary);
100+
line-height: var(--tdvns-text-line-height-base);
101101
}
102102
}
103103
</style>

src/components/thumbnail/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const className = computed(() => {
3232
}
3333
3434
&-circle {
35-
border-radius: @border-radius-50;
35+
border-radius: var(--tdvns-border-radius-50);
3636
}
3737
3838
&-layout {

src/components/trend/index.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,25 @@ const iconCls = computed(() => ['trend-icon-container']);
5252
.trend {
5353
&-container {
5454
&__up {
55-
color: @error-color;
55+
color: var(--tdvns-error-color);
5656
display: inline-flex;
5757
align-items: center;
5858
justify-content: center;
5959
6060
.trend-icon-container {
61-
background: @error-color-2;
61+
background: var(--tdvns-error-color-2);
6262
margin-right: 8px;
6363
}
6464
}
6565
6666
&__down {
67-
color: @success-color;
67+
color: var(--tdvns-success-color);
6868
display: inline-flex;
6969
align-items: center;
7070
justify-content: center;
7171
7272
.trend-icon-container {
73-
background: @success-color-2;
73+
background: var(--tdvns-success-color-2);
7474
margin-right: 8px;
7575
}
7676
}
@@ -82,7 +82,7 @@ const iconCls = computed(() => ['trend-icon-container']);
8282
justify-content: center;
8383
8484
.trend-icon-container {
85-
background: @brand-color-5;
85+
background: var(--tdvns-brand-color-5);
8686
margin-right: 8px;
8787
}
8888
}

0 commit comments

Comments
 (0)