Skip to content

Commit c1080ec

Browse files
authored
fix(button): [button,tag] fix the display problem of the button and tag components in dark mode (#2928)
* fix(button): fix button in dark mode, is-icon and is-only-icon dont have color * fix(tag): add lost style for tag's demo * fix(tag): update tag adapter dark mode
1 parent 1957cbf commit c1080ec

10 files changed

+48
-13
lines changed

examples/sites/demos/pc/app/tag/color-border-composition-api.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ import { TinyTag } from '@opentiny/vue'
2121
</script>
2222

2323
<style scoped>
24-
.tiny-tag-demo > * {
25-
margin-bottom: 8px;
26-
margin-top: 8px;
24+
.tiny-tag-demo .tiny-tag {
25+
margin-right: 10px;
26+
margin-bottom: 10px;
2727
}
2828
</style>

examples/sites/demos/pc/app/tag/color-border.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export default {
2727
</script>
2828

2929
<style scoped>
30-
.tiny-tag-demo > * {
31-
margin-bottom: 8px;
32-
margin-top: 8px;
30+
.tiny-tag-demo .tiny-tag {
31+
margin-right: 10px;
32+
margin-bottom: 10px;
3333
}
3434
</style>

examples/sites/demos/pc/app/tag/effect-composition-api.vue

+7
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,10 @@ const items = ref([
2929
{ type: 'warning', label: '标签五' }
3030
])
3131
</script>
32+
33+
<style scoped>
34+
.tiny-tag-demo .tiny-tag {
35+
margin-right: 10px;
36+
margin-bottom: 10px;
37+
}
38+
</style>

examples/sites/demos/pc/app/tag/effect.vue

+7
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,10 @@ export default {
3737
}
3838
}
3939
</script>
40+
41+
<style scoped>
42+
.tiny-tag-demo .tiny-tag {
43+
margin-right: 10px;
44+
margin-bottom: 10px;
45+
}
46+
</style>

examples/sites/demos/pc/app/tag/size-composition-api.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { IconHeartempty } from '@opentiny/vue-icon'
1717
const TinyIconHeartempty = IconHeartempty()
1818
</script>
1919

20-
<style>
20+
<style scoped>
2121
.tiny-tag-demo .tiny-tag {
2222
margin-right: 10px;
2323
margin-bottom: 10px;

examples/sites/demos/pc/app/tag/size.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default {
2222
}
2323
</script>
2424

25-
<style>
25+
<style scoped>
2626
.tiny-tag-demo .tiny-tag {
2727
margin-right: 10px;
2828
margin-bottom: 10px;

examples/sites/demos/pc/app/tag/tag-event-click-composition-api.vue

+7
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,10 @@ function handleClick() {
2222
TinyModal.message('click 事件')
2323
}
2424
</script>
25+
26+
<style scoped>
27+
.tiny-tag-demo .tiny-tag {
28+
margin-right: 10px;
29+
margin-bottom: 10px;
30+
}
31+
</style>

examples/sites/demos/pc/app/tag/tag-event-click.vue

+7
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,10 @@ export default {
3131
}
3232
}
3333
</script>
34+
35+
<style scoped>
36+
.tiny-tag-demo .tiny-tag {
37+
margin-right: 10px;
38+
margin-bottom: 10px;
39+
}
40+
</style>

packages/theme/src/button/index.less

+7
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,11 @@
325325
&.@{button-prefix-cls}--mini {
326326
.size-only-icon-ontext-iconsize-mixin(-mini);
327327
}
328+
329+
& .@{svg-prefix-cls} {
330+
fill: var(--tv-color-icon);
331+
color: var(--tv-color-icon);
332+
}
328333
}
329334
}
330335

@@ -360,6 +365,8 @@
360365
align-items: center;
361366

362367
.tiny-svg {
368+
fill: var(--tv-color-icon);
369+
color: var(--tv-color-icon);
363370
margin-right: var(--tv-Button-margin-right-isicon-svg);
364371
}
365372
}

packages/theme/src/tag/vars.less

+5-5
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
// 默认标签plain的文本色
9292
--tv-Tag-text-color-plain: var(--tv-color-text);
9393
// 默认标签plain的背景色
94-
--tv-Tag-bg-color-plain: var(--tv-color-bg-secondary);
94+
--tv-Tag-bg-color-plain: transparent;
9595
// 默认标签plain的边框色
9696
--tv-Tag-border-color-plain: var(--tv-color-border-hover); // 没有正确的边框色
9797

@@ -110,7 +110,7 @@
110110
// success 主题时标签plain的文本色
111111
--tv-Tag-text-color-plain-success: var(--tv-color-success-text);
112112
// success 主题时标签plain的背景色
113-
--tv-Tag-bg-color-plain-success: var(--tv-color-success-text-white);
113+
--tv-Tag-bg-color-plain-success: transparent;
114114
// success 主题时标签plain的边框色
115115
--tv-Tag-border-color-plain-success: var(--tv-color-success-border);
116116

@@ -129,7 +129,7 @@
129129
// error 主题时标签plain的文本色
130130
--tv-Tag-text-color-plain-danger: var(--tv-color-error-text);
131131
// error 主题时标签plain的背景色
132-
--tv-Tag-bg-color-plain-danger: var(--tv-color-error-bg-white);
132+
--tv-Tag-bg-color-plain-danger: transparent;
133133
// error 主题时标签plain的边框色
134134
--tv-Tag-border-color-plain-danger: var(--tv-color-error-border);
135135

@@ -148,7 +148,7 @@
148148
// warning 主题时标签plain的文本色
149149
--tv-Tag-text-color-plain-warning: var(--tv-color-warn-text);
150150
// warning 主题时标签plain的背景色
151-
--tv-Tag-bg-color-plain-warning: var(--tv-color-warn-text-white);
151+
--tv-Tag-bg-color-plain-warning: transparent;
152152
// warning 主题时标签plain的边框色
153153
--tv-Tag-border-color-plain-warning: var(--tv-color-warn-border);
154154

@@ -167,7 +167,7 @@
167167
// info 主题时标签plain的文本色
168168
--tv-Tag-text-color-plain-info: var(--tv-color-info-text);
169169
// info 主题时标签plain的背景色
170-
--tv-Tag-bg-color-plain-info: var(--tv-color-info-bg-white);
170+
--tv-Tag-bg-color-plain-info: transparent;
171171
// info 主题时标签plain的边框色
172172
--tv-Tag-border-color-plain-info: var(--tv-color-info-border);
173173

0 commit comments

Comments
 (0)