naive-ui/styles/Timeline.scss

147 lines
3.8 KiB
SCSS
Raw Normal View History

2019-08-12 18:57:44 +08:00
@import './mixins/mixins.scss';
@import './themes/vars.scss';
2019-08-12 18:57:44 +08:00
$--timeline-header-font-size: (
'medium': 14px,
'large': 16px
);
$--timeline-header-margin-top: (
'medium': 0,
'large': -1px
);
2019-10-18 18:26:09 +08:00
@mixin timeline-type-mixin ($type) {
@include m($type + '-type') {
@include b(timeline-item-timeline) {
@include e(circle) {
border-color: map-get($--timeline-item-circle-border-color, $type);
2019-08-12 18:57:44 +08:00
}
}
}
2019-10-18 18:26:09 +08:00
}
@mixin timeline-size-mixin ($size) {
@include m($size + '-size') {
@include b(timeline-item) {
@include b(timeline-item-content) {
@include e(title) {
margin-top: map-get($--timeline-header-margin-top, $size)
}
@include e(title) {
font-size: map-get($--timeline-header-font-size, $size);
}
}
}
}
}
2019-10-18 18:26:09 +08:00
@include themes-mixin {
@include b(timeline) {
@include once {
@include timeline-size-mixin ("medium");
@include timeline-size-mixin ("large");
2019-10-18 18:26:09 +08:00
position: relative;
width: 100%;
display: flex;
flex-direction: column;
@include m(left-placement) {
@include b(timeline-item) {
@include b(timeline-item-content) {
text-align: right;
margin-right: 26px;
}
@include b(timeline-item-timeline) {
width: 14px;
right: 0;
}
}
}
@include m(right-placement) {
@include b(timeline-item) {
@include b(timeline-item-content) {
margin-left: 26px;
}
@include b(timeline-item-timeline) {
left: 0;
}
}
}
}
@include b(timeline-item) {
2019-10-18 18:26:09 +08:00
@include timeline-type-mixin('default');
@include timeline-type-mixin('success');
@include timeline-type-mixin('info');
@include timeline-type-mixin('warning');
@include timeline-type-mixin('error');
@include once {
position: relative;
&:last-child {
@include b(timeline-item-timeline) {
@include e(line) {
display: none;
}
2019-10-18 18:26:09 +08:00
}
}
2019-08-12 18:57:44 +08:00
}
2019-10-18 18:26:09 +08:00
@include b(timeline-item-content) {
@include e(title) {
@include once {
transition: color .3s $--n-ease-in-out-cubic-bezier;
font-size: 14px;
2019-12-23 16:48:49 +08:00
font-weight: 500;
margin-bottom: 6px;
}
2019-10-18 18:26:09 +08:00
color: $--timeline-item-title-color;
}
@include e(content) {
@include once {
transition: color .3s $--n-ease-in-out-cubic-bezier;
font-size: 14px;
}
2019-10-18 18:26:09 +08:00
color: $--timeline-item-content-color;
}
@include e(meta) {
@include once {
transition: color .3s $--n-ease-in-out-cubic-bezier;
font-size: 12px;
margin-top: 6px;
margin-bottom: 20px;
}
2019-10-18 18:26:09 +08:00
color: $--timeline-item-meta-color;
}
2019-08-12 18:57:44 +08:00
}
2019-10-18 18:26:09 +08:00
@include b(timeline-item-timeline) {
@include once {
width: 26px;
position: absolute;
top: 2px;
bottom: 0;
height: 100%;
}
@include once {
@include e(circle) {
transition: background-color .3s $--n-ease-in-out-cubic-bezier, border-color .3s $--n-ease-in-out-cubic-bezier;
width: 14px;
height: 14px;
border-radius: 7px;
box-sizing: border-box;
border-style: solid;
border-width: 2px;
}
2019-10-18 18:26:09 +08:00
}
@include e(line) {
@include once {
transition: background-color .3s $--n-ease-in-out-cubic-bezier;
position: absolute;
top: 14px;
left: 6px;
bottom: 0px;
width: 2px;
}
2019-10-18 18:26:09 +08:00
background-color: $--timeline-line-background-color;
}
2019-08-12 18:57:44 +08:00
}
}
}
2019-12-17 18:09:46 +08:00
}