Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(milestone): [milestone] refactor the milestone theme. #2233

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/theme/src/milestone/aurora-theme.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export const tinyMilestoneAuroraTheme = {
'ti-milestone-icon-color': '#1890ff'
'tv-Milestone-icon-color': '#1890ff'
}
207 changes: 92 additions & 115 deletions packages/theme/src/milestone/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,139 +17,118 @@
@svg-prefix-cls: ~'@{css-prefix}svg';

.@{milestone-prefix-cls} {
.component-css-vars-milestone();
.inject-Milestone-vars();

overflow: hidden;
padding-top: 38px;

/* 节点本身 */
& &__node {
display: block;
float: left;
display: block;

&::before {
content: '';
width: 28px;
height: 28px;
display: block;
position: relative;
display: block;
left: ~'calc(50% - 14px)';
top: 28px;
z-index: 15;
content: '';
width: 28px;
height: 28px;
}

&.is-solid {
&::before {
background: var(--ti-milestone-bg-color);
background: var(--tv-Milestone-bg-color);
}

.@{svg-prefix-cls} {
fill: var(--ti-milestone-bg-color);
fill: #fff;
chenxi-20 marked this conversation as resolved.
Show resolved Hide resolved
}
}

.iconfix {
font-size: var(--ti-common-font-size-4);
}

/* completed 节点 */
&.node-status-completed {
.@{milestone-prefix-cls}__line {
background-color: var(--ti-milestone-line-bg-color-completed);
}
font-size: 20px;
chenxi-20 marked this conversation as resolved.
Show resolved Hide resolved
}
}

/* 图标节点 */
& &__icon {
background: var(--ti-milestone-bg-color);
width: var(--ti-milestone-icon-width, 20px);
height: var(--ti-milestone-icon-height, 20px);
line-height: var(--ti-milestone-icon-height, 20px);
position: relative;
font-size: var(--ti-milestone-font-size, 12px);
left: var(--tv-Milestone-icon-left);
top: var(--tv-Milestone-icon-top);
width: var(--tv-Milestone-icon-width);
height: var(--tv-Milestone-icon-height);
line-height: var(--tv-Milestone-icon-height);
font-size: var(--tv-Milestone-font-size);
text-align: center;
left: var(--ti-milestone-icon-left);
top: var(--ti-milestone-icon-top);
border-radius: 50%;
color: var(--ti-milestone-text-color);
color: #191919;
background: #fff;
chenxi-20 marked this conversation as resolved.
Show resolved Hide resolved
cursor: pointer;
z-index: 15;
border: var(--ti-milestone-icon-border-width) solid;
border: var(--tv-Milestone-icon-border-width) solid;
display: flex;
align-items: center;
justify-content: center;

.@{svg-prefix-cls} {
font-size: var(--ti-milestone-icon-size);
fill: var(--ti-milestone-icon-color);
font-size: var(--tv-Milestone-icon-size);
fill: var(--tv-Milestone-icon-color);
vertical-align: baseline;
}

&.is-completed {
border: var(--ti-milestone-icon-border-width-completed) solid;
border: var(--tv-Milestone-icon-border-width-completed) solid;
}
}

& &__line {
height: var(--ti-milestone-line-height);
width: var(--ti-milestone-line-width);
left: var(--ti-milestone-line-left);
top: var(--ti-milestone-line-top);
/* 节点线 */
& &__node.node-status-completed {
.@{milestone-prefix-cls}__line {
background-color: var(--tv-Milestone-line-bg-color-completed);
}
}

& &__line {
position: relative; // 里程碑线条不区分状态
background-color: var(--ti-milestone-line-bg-color);
}
left: var(--tv-Milestone-line-left);
top: var(--tv-Milestone-line-top);
height: var(--tv-Milestone-line-height);
width: var(--tv-Milestone-line-width);
background-color: var(--tv-Milestone-line-bg-color);

& &__line-end {
width: 0;
&-end {
width: 0;
}
}

/* 横向节点下方部分 */
& &__description {
position: relative;
line-height: 14px;
margin-top: 8px;
position: relative;
overflow: hidden;
text-align: center;
}

& &__description-name {
width: 100%;
color: #333;
font-size: var(--ti-milestone-font-size);
float: left;
}

& &__description-status {
color: var(--ti-milestone-status-text-color);
font-size: var(--ti-milestone-status-font-size);
float: left;
width: 100%;
margin-top: 4px;
}

& &__flag-tip {
position: fixed;
padding: 2px 4px;
line-height: var(--ti-milestone-flag-tip-line-height);
background: var(--ti-milestone-flag-tip-bg-color);
border-radius: var(--ti-milestone-flag-tip-border-radius);
border: solid 1px var(--ti-milestone-flag-tip-bg-color);
text-align: center;
word-wrap: break-word;

&::before {
position: absolute;
width: 0;
height: 0;
border-style: solid;
border: 1px solid;
border-width: 8px 8px 0px 8px;
border-color: #d9d9d9 transparent;
content: '';
left: ~'calc(50% - 4px)';
bottom: -6px;
// 标题
&-name {
float: left;
width: 100%;
color: #333;
font-size: var(--tv-Milestone-font-size);
}
// 日期
&-status {
float: left;
margin-top: 4px;
width: 100%;
color: var(--tv-Milestone-status-text-color);
font-size: var(--tv-Milestone-status-font-size);
}
}

/* 旗子部分 */
& &__flag {
position: absolute;
left: ~'calc(50% - 29px)';
Expand All @@ -161,59 +140,57 @@
&:hover {
z-index: 2;
}
}

& &__flag-content {
width: var(--ti-milestone-flag-width);
height: var(--ti-milestone-flag-height);
padding: var(--ti-milestone-flag-padding);
line-height: var(--ti-milestone-flag-line-height);
font-size: var(--ti-milestone-flag-content-font-size);
border-radius: var(--ti-milestone-flag-content-border-radius);
color: var(--ti-milestone-text-color);
background-color: var(--ti-milestone-flag-content-bg-color);
cursor: pointer;
vertical-align: middle;
display: table-cell;

p {
color: var(--ti-milestone-text-color);
width: var(--ti-milestone-flag-width);
font-size: var(--ti-milestone-flag-font-size);
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin: 0;
box-sizing: border-box;
}
&-content {
display: table-cell;
vertical-align: middle;
width: var(--tv-Milestone-flag-width);
height: var(--tv-Milestone-flag-height);
padding: var(--tv-Milestone-flag-padding);
line-height: var(--tv-Milestone-flag-line-height);
font-size: var(--tv-Milestone-flag-font-size);
border-radius: var(--tv-Milestone-flag-border-radius);
color: var(--tv-Milestone-text-color);
background-color: var(--tv-Milestone-flag-bg-color);
cursor: pointer;

p {
color: var(--tv-Milestone-text-color);
width: var(--tv-Milestone-flag-width);
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
margin: 0;
box-sizing: border-box;
}

.@{milestone-prefix-cls}__flag-name {
font-weight: var(--ti-milestone-flag-name-font-weight);
}
.@{milestone-prefix-cls}__flag-name {
font-weight: var(--tv-Milestone-flag-name-font-weight);
}

.@{milestone-prefix-cls}__flag-desc {
color: var(--ti-milestone-flag-desc-text-color);
font-size: var(--ti-milestone-flag-desc-font-size);
line-height: var(--ti-milestone-flag-desc-line-height);
.@{milestone-prefix-cls}__flag-desc {
color: var(--tv-Milestone-flag-desc-text-color);
font-size: var(--tv-Milestone-flag-desc-font-size);
}
}
}

/* 旗子线部分 */
& &__flag-line {
height: 30px;
width: 1px;
margin-left: var(--ti-milestone-flag-line-margin-left);
background: var(--ti-milestone-flag-line-bg-color);
margin-left: var(--tv-Milestone-flag-line-margin-left);
background: var(--tv-Milestone-flag-line-bg-color);
}

& &__dot {
display: var(--ti-milestone-dot-display);
background: var(--ti-milestone-flag-line-color);
border: solid 1px;
border-radius: 50%;
width: 5px;
height: 5px;
position: relative;
bottom: -29px;
right: 2px;
display: var(--tv-Milestone-dot-display);
width: 5px;
height: 5px;
border: solid 1px;
border-radius: 50%;
}
}
57 changes: 28 additions & 29 deletions packages/theme/src/milestone/old-theme.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
export const tinyMilestoneOldTheme = {
'ti-milestone-dot-display': 'block',
'ti-milestone-flag-line-bg-color': '#333',
'ti-milestone-flag-line-margin-left': '50%',
'ti-milestone-flag-desc-line-height': '14px',
'ti-milestone-flag-line-height': '14px',
'ti-milestone-flag-desc-font-size': 'var(--ti-common-font-size-base, 12px)',
'ti-milestone-text-color': 'var(--ti-common-color-light, #fff)',
'ti-milestone-flag-desc-text-color': 'var(--ti-common-color-light, #fff)',
'ti-milestone-flag-name-font-weight': 'var(--ti-common-font-weight-4)',
'ti-milestone-flag-content-bg-color': '#333',
'ti-milestone-flag-content-border-radius': 'var(--ti-common-border-radius-1, 4px)',
'ti-milestone-flag-padding': 'var(--ti-common-size-0, 0px) var(--ti-common-size-base, 4px)',
'ti-milestone-flag-height': '34px',
'ti-milestone-flag-width': '50px',
'ti-milestone-status-font-size': 'var(--ti-common-font-size-1)',
'ti-milestone-line-top': '-8px',
'ti-milestone-line-left': '50%',
'ti-milestone-line-width': '100%',
'ti-milestone-line-height': 'var(--ti-common-size-base, 4px)',
'ti-milestone-line-bg-color-completed': '#dbdbdb',
'ti-milestone-line-bg-color': '#dbdbdb',
'ti-milestone-icon-top': 'var(--ti-common-size-base, 4px)',
'ti-milestone-icon-left': "~'calc(50% - 10px)'",
'ti-milestone-icon-color': '#1890ff',
'ti-milestone-icon-size': 'var(--ti-common-font-size-base)',
'ti-milestone-icon-border-width-completed': 'var(--ti-common-border-weight-1)',
'ti-milestone-icon-border-width': 'var(--ti-common-size-0)',
'ti-milestone-icon-height': 'var(--ti-common-size-5x, 20px)',
'ti-milestone-icon-width': 'var(--ti-common-size-5x, 20px)'
'tv-Milestone-dot-display': 'block',
'tv-Milestone-flag-line-bg-color': '#333',
'tv-Milestone-flag-line-margin-left': '50%',
'tv-Milestone-flag-line-height': '14px',
'tv-Milestone-flag-desc-font-size': 'var(--ti-common-font-size-base, 12px)',
'tv-Milestone-text-color': 'var(--ti-common-color-light, #fff)',
'tv-Milestone-flag-desc-text-color': 'var(--ti-common-color-light, #fff)',
'tv-Milestone-flag-name-font-weight': 'var(--ti-common-font-weight-4)',
'tv-Milestone-flag-bg-color': '#333',
'tv-Milestone-flag-border-radius': 'var(--ti-common-border-radius-1, 4px)',
'tv-Milestone-flag-padding': 'var(--ti-common-size-0, 0px) var(--ti-common-size-base, 4px)',
'tv-Milestone-flag-height': '34px',
'tv-Milestone-flag-width': '50px',
'tv-Milestone-status-font-size': 'var(--ti-common-font-size-1)',
'tv-Milestone-line-top': '-8px',
'tv-Milestone-line-left': '50%',
'tv-Milestone-line-width': '100%',
'tv-Milestone-line-height': 'var(--ti-common-size-base, 4px)',
'tv-Milestone-line-bg-color-completed': '#dbdbdb',
'tv-Milestone-line-bg-color': '#dbdbdb',
'tv-Milestone-icon-top': 'var(--ti-common-size-base, 4px)',
'tv-Milestone-icon-left': "~'calc(50% - 10px)'",
'tv-Milestone-icon-color': '#1890ff',
'tv-Milestone-icon-size': 'var(--ti-common-font-size-base)',
'tv-Milestone-icon-border-width-completed': 'var(--ti-common-border-weight-1)',
'tv-Milestone-icon-border-width': 'var(--ti-common-size-0)',
'tv-Milestone-icon-height': 'var(--ti-common-size-5x, 20px)',
'tv-Milestone-icon-width': 'var(--ti-common-size-5x, 20px)'
}
Loading
Loading