Skip to content

Commit 2b81a72

Browse files
committed
fix: timeline custom color should work on antd icons
1 parent ccf9a41 commit 2b81a72

File tree

3 files changed

+18
-5
lines changed

3 files changed

+18
-5
lines changed

components/tabs/style/index.less

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171

172172
&&-active &-btn {
173173
color: @tabs-highlight-color;
174-
text-shadow: 0 0 0.25px currentColor;
174+
text-shadow: 0 0 0.25px currentcolor;
175175
}
176176

177177
&&-disabled {

components/timeline/TimelineItem.tsx

+2-4
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,12 @@ export default defineComponent({
3838
[`${prefixCls.value}-item-head-custom`]: dot,
3939
[`${prefixCls.value}-item-head-${color}`]: true,
4040
});
41+
const customColor = /blue|red|green|gray/.test(color || '') ? undefined : color;
4142
return (
4243
<li class={itemClassName}>
4344
{label && <div class={`${prefixCls.value}-item-label`}>{label}</div>}
4445
<div class={`${prefixCls.value}-item-tail`} />
45-
<div
46-
class={dotClassName}
47-
style={{ borderColor: /blue|red|green|gray/.test(color) ? undefined : color }}
48-
>
46+
<div class={dotClassName} style={{ borderColor: customColor, color: customColor }}>
4947
{dot}
5048
</div>
5149
<div class={`${prefixCls.value}-item-content`}>{slots.default?.()}</div>

components/timeline/demo/color.vue

+15
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,20 @@ Set the color of circles. `green` means completed or success status, `red` means
4040
<p>Technical testing 2</p>
4141
<p>Technical testing 3 2015-09-01</p>
4242
</a-timeline-item>
43+
<a-timeline-item color="#00CCFF">
44+
<template #dot>
45+
<SmileOutlined />
46+
</template>
47+
<p>Custom color testing</p>
48+
</a-timeline-item>
4349
</a-timeline>
4450
</template>
51+
<script lang="ts">
52+
import { defineComponent } from 'vue';
53+
import { SmileOutlined } from '@ant-design/icons-vue';
54+
export default defineComponent({
55+
components: {
56+
SmileOutlined,
57+
},
58+
});
59+
</script>

0 commit comments

Comments
 (0)