@fesjs/fes-design
Version:
fes-design for PC
320 lines (319 loc) • 16.5 kB
CSS
ul.fes-timeline {
color: var(--f-text-color);
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
font-variant: tabular-nums;
line-height: 22px;
font-feature-settings: 'tnum';
display: flex;
margin: 0;
padding: calc(calc(var(--f-font-size-base) + 3px * 2) / 2);
font-size: var(--f-font-size-base);
list-style: none;
}
ul.fes-timeline * {
box-sizing: border-box;
}
ul.fes-timeline li.fes-timeline-item {
position: relative;
margin: 0;
list-style: none;
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-title {
position: relative;
color: var(--f-text-color);
line-height: calc(var(--f-font-size-base) + 3px * 2);
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-desc {
position: relative;
color: var(--f-text-color-secondary);
line-height: calc(var(--f-font-size-base) + 3px * 2);
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-content-wrapper {
position: relative;
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-content-wrapper .fes-timeline-item-desc.fes-timeline-item-desc-layout-under {
margin-top: 4px;
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-content-wrapper.fes-timeline-item-content-wrapper-start:has( > .fes-timeline-item-desc.fes-timeline-item-desc-layout-inline),
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-content-wrapper.fes-timeline-item-content-wrapper-end:has( > .fes-timeline-item-desc.fes-timeline-item-desc-layout-inline) {
display: flex;
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-content-wrapper.fes-timeline-item-content-wrapper-start:has( > .fes-timeline-item-desc.fes-timeline-item-desc-layout-inline) .fes-timeline-item-title,
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-content-wrapper.fes-timeline-item-content-wrapper-end:has( > .fes-timeline-item-desc.fes-timeline-item-desc-layout-inline) .fes-timeline-item-title {
white-space: nowrap;
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-content-wrapper.fes-timeline-item-content-wrapper-start:has( > .fes-timeline-item-desc.fes-timeline-item-desc-layout-inline) {
flex-direction: row-reverse;
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-content-wrapper.fes-timeline-item-content-wrapper-start:has( > .fes-timeline-item-desc.fes-timeline-item-desc-layout-inline) .fes-timeline-item-desc.fes-timeline-item-desc-layout-inline {
margin-right: 16px;
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-content-wrapper.fes-timeline-item-content-wrapper-end:has( > .fes-timeline-item-desc.fes-timeline-item-desc-layout-inline) {
flex-direction: row;
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-content-wrapper.fes-timeline-item-content-wrapper-end:has( > .fes-timeline-item-desc.fes-timeline-item-desc-layout-inline) .fes-timeline-item-desc.fes-timeline-item-desc-layout-inline {
margin-left: 16px;
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-icon {
position: absolute;
width: 8px;
height: 8px;
border: 2px solid transparent;
border-radius: 50%;
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-icon-custom {
display: flex;
align-items: center;
justify-content: center;
width: auto;
height: auto;
border: unset;
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-icon-info {
color: var(--f-primary-color);
border-color: var(--f-primary-color);
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-icon-success {
color: var(--f-success-color);
border-color: var(--f-success-color);
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-icon-warning {
color: var(--f-warning-color);
border-color: var(--f-warning-color);
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-icon-error {
color: var(--f-danger-color);
border-color: var(--f-danger-color);
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-tail {
position: absolute;
background-color: var(--f-border-color-disabled);
}
ul.fes-timeline li.fes-timeline-item .fes-timeline-item-tail-last {
display: none;
}
ul.fes-timeline.fes-timeline-direction-column {
flex-direction: column;
}
ul.fes-timeline.fes-timeline-direction-column li.fes-timeline-item {
padding-bottom: var(--f-padding-large);
}
ul.fes-timeline.fes-timeline-direction-column li.fes-timeline-item .fes-timeline-item-tail {
top: calc(8px / 2 + 4px);
width: var(--f-border-width-base);
height: calc(100% - 8px - 4px * 2);
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-layout-end:not(.fes-timeline-desc-opposite) li.fes-timeline-item .fes-timeline-item-icon {
top: 0;
left: 0;
transform: translate(-50%, -50%);
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-layout-end:not(.fes-timeline-desc-opposite) li.fes-timeline-item .fes-timeline-item-tail {
left: 0;
transform: translateX(-50%);
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-layout-end:not(.fes-timeline-desc-opposite) li.fes-timeline-item .fes-timeline-item-content-wrapper {
top: calc(0px - calc(var(--f-font-size-base) + 3px * 2) / 2);
margin-left: calc(8px / 2 + var(--f-padding-middle));
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-layout-start:not(.fes-timeline-desc-opposite) li.fes-timeline-item {
text-align: right;
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-layout-start:not(.fes-timeline-desc-opposite) li.fes-timeline-item .fes-timeline-item-icon {
top: 0;
right: 0;
transform: translate(50%, -50%);
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-layout-start:not(.fes-timeline-desc-opposite) li.fes-timeline-item .fes-timeline-item-tail {
right: 0;
transform: translateX(50%);
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-layout-start:not(.fes-timeline-desc-opposite) li.fes-timeline-item .fes-timeline-item-content-wrapper {
top: calc(0px - calc(var(--f-font-size-base) + 3px * 2) / 2);
margin-right: calc(8px / 2 + var(--f-padding-middle));
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-layout-alternate li.fes-timeline-item {
display: grid;
grid-template-areas: 'start end';
grid-template-columns: 1fr 1fr;
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-layout-alternate li.fes-timeline-item .fes-timeline-item-icon {
top: 0;
left: 50%;
transform: translate(-50%, -50%);
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-layout-alternate li.fes-timeline-item .fes-timeline-item-tail {
left: 50%;
transform: translateX(-50%);
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-layout-alternate li.fes-timeline-item .fes-timeline-item-content-wrapper {
top: calc(0px - calc(var(--f-font-size-base) + 3px * 2) / 2);
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-layout-alternate li.fes-timeline-item .fes-timeline-item-content-wrapper-start {
grid-area: start;
padding-right: calc(8px / 2 + var(--f-padding-middle));
text-align: right;
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-layout-alternate li.fes-timeline-item .fes-timeline-item-content-wrapper-end {
grid-area: end;
padding-left: calc(8px / 2 + var(--f-padding-middle));
text-align: left;
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-desc-opposite li.fes-timeline-item {
display: flex;
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-desc-opposite li.fes-timeline-item .fes-timeline-item-icon {
top: 0;
left: 50%;
transform: translate(-50%, -50%);
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-desc-opposite li.fes-timeline-item .fes-timeline-item-tail {
left: 50%;
transform: translateX(-50%);
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-desc-opposite li.fes-timeline-item .fes-timeline-item-content-wrapper {
top: calc(0px - calc(var(--f-font-size-base) + 3px * 2) / 2);
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-desc-opposite li.fes-timeline-item .fes-timeline-item-content-wrapper-start {
padding-right: calc(8px / 2 + var(--f-padding-middle));
text-align: right;
}
ul.fes-timeline.fes-timeline-direction-column.fes-timeline-desc-opposite li.fes-timeline-item .fes-timeline-item-content-wrapper-end {
flex: 1;
padding-left: calc(8px / 2 + var(--f-padding-middle));
text-align: left;
}
ul.fes-timeline.fes-timeline-direction-row li.fes-timeline-item,
ul.fes-timeline.fes-timeline-direction-row-reverse li.fes-timeline-item {
flex-grow: 1;
min-width: 105px;
}
ul.fes-timeline.fes-timeline-direction-row li.fes-timeline-item .fes-timeline-item-tail,
ul.fes-timeline.fes-timeline-direction-row-reverse li.fes-timeline-item .fes-timeline-item-tail {
width: calc(100% - 8px - 4px * 2);
height: var(--f-border-width-base);
}
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-layout-end li.fes-timeline-item .fes-timeline-item-tail,
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-layout-end li.fes-timeline-item .fes-timeline-item-tail {
top: 0;
transform: translateY(-50%);
}
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-layout-start li.fes-timeline-item .fes-timeline-item-tail,
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-layout-start li.fes-timeline-item .fes-timeline-item-tail {
bottom: 0;
transform: translateY(50%);
}
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-layout-alternate li.fes-timeline-item,
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-layout-alternate li.fes-timeline-item,
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-desc-opposite li.fes-timeline-item,
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-desc-opposite li.fes-timeline-item {
/**
* NOTE: 之所以使用 grid 布局,是因为对于 li.@{item} > .@{item}-content-wrapper
* - 不能使用 relative top:会无法撑开 li.@{item}
* - 不能使用 margin-top:百分比计算不正确
* 并不是根据包含块的高度百分比来计算 margin,而是宽度(https://developer.mozilla.org/zh-CN/docs/Web/CSS/Containing_block#%E6%A0%B9%E6%8D%AE%E5%8C%85%E5%90%AB%E5%9D%97%E8%AE%A1%E7%AE%97%E7%99%BE%E5%88%86%E5%80%BC)
* 而使用 grid 布局则可以直接对 li.@{item} 的 height 进行二等分
*/
display: grid;
grid-template-areas: 'start' 'end';
grid-template-rows: 1fr 1fr;
}
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-layout-alternate li.fes-timeline-item .fes-timeline-item-content-wrapper,
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-layout-alternate li.fes-timeline-item .fes-timeline-item-content-wrapper,
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-desc-opposite li.fes-timeline-item .fes-timeline-item-content-wrapper,
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-desc-opposite li.fes-timeline-item .fes-timeline-item-content-wrapper {
display: flex;
flex-direction: column;
}
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-layout-alternate li.fes-timeline-item .fes-timeline-item-content-wrapper.fes-timeline-item-content-wrapper-start,
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-layout-alternate li.fes-timeline-item .fes-timeline-item-content-wrapper.fes-timeline-item-content-wrapper-start,
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-desc-opposite li.fes-timeline-item .fes-timeline-item-content-wrapper.fes-timeline-item-content-wrapper-start,
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-desc-opposite li.fes-timeline-item .fes-timeline-item-content-wrapper.fes-timeline-item-content-wrapper-start {
grid-area: start;
justify-content: end;
padding-bottom: calc(8px / 2 + var(--f-padding-middle));
}
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-layout-alternate li.fes-timeline-item .fes-timeline-item-content-wrapper.fes-timeline-item-content-wrapper-end,
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-layout-alternate li.fes-timeline-item .fes-timeline-item-content-wrapper.fes-timeline-item-content-wrapper-end,
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-desc-opposite li.fes-timeline-item .fes-timeline-item-content-wrapper.fes-timeline-item-content-wrapper-end,
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-desc-opposite li.fes-timeline-item .fes-timeline-item-content-wrapper.fes-timeline-item-content-wrapper-end {
grid-area: end;
justify-content: start;
padding-top: calc(8px / 2 + var(--f-padding-middle));
}
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-layout-alternate li.fes-timeline-item .fes-timeline-item-tail,
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-layout-alternate li.fes-timeline-item .fes-timeline-item-tail,
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-desc-opposite li.fes-timeline-item .fes-timeline-item-tail,
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-desc-opposite li.fes-timeline-item .fes-timeline-item-tail {
top: 50%;
transform: translateY(-50%);
}
ul.fes-timeline.fes-timeline-direction-row {
flex-direction: row;
}
ul.fes-timeline.fes-timeline-direction-row li.fes-timeline-item {
padding-right: var(--f-padding-large);
}
ul.fes-timeline.fes-timeline-direction-row li.fes-timeline-item .fes-timeline-item-tail {
left: calc(8px / 2 + 4px);
}
ul.fes-timeline.fes-timeline-direction-row li.fes-timeline-item .fes-timeline-item-content-wrapper {
left: calc(0px - 8px / 2);
}
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-layout-end:not(.fes-timeline-desc-opposite) li.fes-timeline-item .fes-timeline-item-icon {
top: 0;
left: 0;
transform: translate(-50%, -50%);
}
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-layout-end:not(.fes-timeline-desc-opposite) li.fes-timeline-item .fes-timeline-item-content-wrapper {
margin-top: calc(8px / 2 + var(--f-padding-middle));
}
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-layout-start:not(.fes-timeline-desc-opposite) li.fes-timeline-item .fes-timeline-item-icon {
bottom: 0;
left: 0;
transform: translate(-50%, 50%);
}
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-layout-start:not(.fes-timeline-desc-opposite) li.fes-timeline-item .fes-timeline-item-content-wrapper {
margin-bottom: calc(8px / 2 + var(--f-padding-middle));
}
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-layout-alternate li.fes-timeline-item .fes-timeline-item-icon,
ul.fes-timeline.fes-timeline-direction-row.fes-timeline-desc-opposite li.fes-timeline-item .fes-timeline-item-icon {
top: 50%;
left: 0;
transform: translate(-50%, -50%);
}
ul.fes-timeline.fes-timeline-direction-row-reverse {
flex-direction: row-reverse;
}
ul.fes-timeline.fes-timeline-direction-row-reverse li.fes-timeline-item {
padding-left: var(--f-padding-large);
text-align: right;
}
ul.fes-timeline.fes-timeline-direction-row-reverse li.fes-timeline-item .fes-timeline-item-tail {
right: calc(8px / 2 + 4px);
}
ul.fes-timeline.fes-timeline-direction-row-reverse li.fes-timeline-item .fes-timeline-item-content-wrapper {
right: calc(0px - 8px / 2);
}
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-layout-end:not(.fes-timeline-desc-opposite) li.fes-timeline-item .fes-timeline-item-icon {
top: 0;
right: 0;
transform: translate(50%, -50%);
}
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-layout-end:not(.fes-timeline-desc-opposite) li.fes-timeline-item .fes-timeline-item-content-wrapper {
margin-top: calc(8px / 2 + var(--f-padding-middle));
}
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-layout-start:not(.fes-timeline-desc-opposite) li.fes-timeline-item .fes-timeline-item-icon {
right: 0;
bottom: 0;
transform: translate(50%, 50%);
}
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-layout-start:not(.fes-timeline-desc-opposite) li.fes-timeline-item .fes-timeline-item-content-wrapper {
margin-bottom: calc(8px / 2 + var(--f-padding-middle));
}
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-layout-alternate li.fes-timeline-item .fes-timeline-item-icon,
ul.fes-timeline.fes-timeline-direction-row-reverse.fes-timeline-desc-opposite li.fes-timeline-item .fes-timeline-item-icon {
top: 50%;
right: 0;
transform: translate(50%, -50%);
}