-
+
{dotNode}
+ {!isCustomDot.value &&
}
- {labelNode &&
{labelNode}
}
{slots.default &&
{slots.default()}
}
+ {labelNode &&
{labelNode}
}
)
diff --git a/packages/components/timeline/style/index.less b/packages/components/timeline/style/index.less
index 90bd79661..2f8330a9f 100644
--- a/packages/components/timeline/style/index.less
+++ b/packages/components/timeline/style/index.less
@@ -8,7 +8,6 @@
line-height: @timeline-line-height;
display: flex;
flex-direction: column;
-
.@{timeline-item-prefix} {
position: relative;
@@ -29,26 +28,46 @@
}
&-dot {
+ border: none;
+ background-color: @color-white;
+ display: flex;
+ align-items: center;
+ justify-content: center;
width: @timeline-dot-size;
height: @timeline-dot-size;
- border: @timeline-dot-border;
- border-radius: 50%;
font-size: @timeline-dot-font-size;
- .timeline-color-classes(@preset-colors);
- .timeline-color-classes(@status-colors);
+ &-inner {
+ width: 50%;
+ height: 50%;
+ background-color: @color-primary;
+ border-radius: 50%;
+ }
&-custom {
position: absolute;
- border: none;
background-color: @color-white;
display: flex;
align-items: center;
- justify-content: center
+ justify-content: center;
}
}
}
+ &:first-child .@{timeline-item-prefix}-head-dot {
+ border: @timeline-dot-border;
+ border-radius: 50%;
+ background: transparent;
+
+ &-custom {
+ border: none;
+ }
+
+ &-inner {
+ display: none;
+ }
+ }
+
&:last-child {
.@{timeline-item-prefix}-head-line {
display: none;
@@ -59,22 +78,24 @@
position: relative;
color: @timeline-content-color;
margin-bottom: @timeline-content-margin-bottom;
-
+
&-label {
color: @timeline-content-label-color;
+ margin-top: @timeline-content-label-margin-top;
}
}
}
+ .timeline-dot-color-classes(@preset-colors);
+ .timeline-dot-color-classes(@status-colors);
+
&-pending:not(&-reverse) {
-
.@{timeline-item-prefix}:nth-last-child(2) {
.timeline-dotted-line();
}
}
&-pending&-reverse {
-
.@{timeline-item-prefix} {
&-pending {
.timeline-dotted-line();
@@ -92,7 +113,6 @@
&-start {
.@{timeline-item-prefix} {
-
&-head {
right: 0;
width: @timeline-dot-size;
@@ -103,7 +123,6 @@
}
&-dot {
-
&-custom {
right: @timeline-custom-dot-gap;
transform: translate(50%, -50%);
@@ -119,14 +138,11 @@
}
&-alternate {
-
.timeline-line-align-center();
.@{timeline-item-prefix} {
-
&-start {
.@{timeline-item-prefix} {
-
&-content {
width: calc(50% - @timeline-content-gap);
text-align: right;
@@ -136,7 +152,6 @@
&-end {
.@{timeline-item-prefix} {
-
&-content {
margin-left: calc(50% + @timeline-content-gap);
width: 50%;
@@ -158,17 +173,17 @@
}
&-not-both {
-
.timeline-line-align-center();
.@{timeline-item-prefix} {
-
&-content {
&-label {
position: absolute;
+ margin-top: 0;
+ top: 0;
}
}
-
+
&-start {
.@{timeline-item-prefix} {
&-content {
diff --git a/packages/components/timeline/style/mixin.less b/packages/components/timeline/style/mixin.less
index 6e589c50e..ef4f03857 100644
--- a/packages/components/timeline/style/mixin.less
+++ b/packages/components/timeline/style/mixin.less
@@ -1,10 +1,31 @@
-.timeline-color-classes(@colors, @i: length(@colors)) when (@i > 0) {
- .timeline-color-classes(@colors, @i - 1);
+.timeline-first-dot-color-classes(@colors, @i: length(@colors)) when (@i > 0) {
+ .timeline-first-dot-color-classes(@colors, @i - 1);
@color: extract(@colors, @i);
@color-name: 'color-@{color}';
- &-@{color} {
- border-color: @@color-name;
+
+ .@{timeline-item-prefix}:first-child .@{timeline-item-prefix}-head-dot {
+ &-@{color} {
+ border-color: @@color-name;
+ color: @@color-name;
+ }
+ }
+}
+
+.timeline-dot-color-classes(@colors, @i: length(@colors)) when (@i > 0) {
+ .timeline-dot-color-classes(@colors, @i - 1);
+
+ @color: extract(@colors, @i);
+ @color-name: 'color-@{color}';
+ @dot-class: ~'@{timeline-item-prefix}-head-dot';
+
+ .@{timeline-item-prefix} .@{dot-class}.@{dot-class}-@{color} {
color: @@color-name;
+ .@{dot-class}-inner {
+ background-color: @@color-name;
+ }
+ }
+ .@{timeline-item-prefix} .@{dot-class}.@{dot-class}-@{color} {
+ border-color: @@color-name;
}
}
@@ -25,7 +46,6 @@
.timeline-dotted-line() {
.@{timeline-item-prefix} {
-
&-head-line {
background: @timeline-dotted-line-background;
background-size: @timeline-dotted-line-background-size;
diff --git a/packages/components/timeline/style/themes/default.variable.less b/packages/components/timeline/style/themes/default.variable.less
index 217f5e76e..589411cad 100644
--- a/packages/components/timeline/style/themes/default.variable.less
+++ b/packages/components/timeline/style/themes/default.variable.less
@@ -14,6 +14,7 @@
@timeline-content-gap: @timeline-item-timeline-width;
@timeline-content-color: @text-color;
@timeline-content-label-color: @color-graphite;
+@timeline-content-label-margin-top: 0;
@timeline-line-gap: ((@timeline-dot-size - @timeline-dot-border-width) / 2);
@timeline-line-width: 2px;
diff --git a/packages/components/timeline/style/themes/seer.variable.less b/packages/components/timeline/style/themes/seer.variable.less
index 498793af1..0e3db3be6 100644
--- a/packages/components/timeline/style/themes/seer.variable.less
+++ b/packages/components/timeline/style/themes/seer.variable.less
@@ -1 +1,4 @@
@import './default.variable.less';
+
+@timeline-line-height: 1;
+@timeline-content-label-margin-top: 8px;
\ No newline at end of file