naive-ui/styles/Steps.scss

192 lines
5.4 KiB
SCSS
Raw Normal View History

2019-08-01 14:52:52 +08:00
@import './mixins/mixins.scss';
@import './themes/vars.scss';
2019-08-01 14:52:52 +08:00
2019-12-12 15:41:18 +08:00
$--steps-header-font-size: (
'small': 14px,
'medium': 16px
);
$--steps-indicator-index-font-size: (
'small': 14px,
'medium': 16px
);
$--steps-indicator-size: (
'small': 22px,
'medium': 28px
);
$--steps-indicator-icon-size: (
'small': 16px,
'medium': 22px
);
@mixin steps-size-mixin ($size) {
@include m($size + '-size') {
$title-font-size: map-get($--steps-header-font-size, $size);
$indicator-size: map-get($--steps-indicator-size, $size);
$indicator-icon-size: map-get($--steps-indicator-icon-size, $size);
$indicator-index-font-size: map-get($--steps-indicator-index-font-size, $size);
$indicator-title-margin-top: ($indicator-size - $title-font-size) / 2;
@include b(step-splitor) {
margin-top: $indicator-size / 2 - $indicator-title-margin-top;
}
@include m(vertical) {
@include b(step-splitor) {
left: $indicator-size / 2;
height: calc(100% - #{$indicator-size});
}
}
@include b(step-content) {
@include b(step-content-header) {
margin-top: $indicator-title-margin-top;
line-height: $title-font-size;
font-size: $title-font-size;
}
}
@include b(step-indicator) {
height: $indicator-size;
width: $indicator-size;
border-radius: $indicator-size / 2;
@include b(step-indicator-slot) {
width: $indicator-icon-size;
height: $indicator-icon-size;
font-size: $indicator-icon-size;
line-height: $indicator-icon-size;
@include e(index) {
font-size: $indicator-index-font-size;
width: $indicator-icon-size;
height: $indicator-icon-size;
line-height: $indicator-icon-size;
}
}
}
}
}
2019-10-21 19:16:31 +08:00
@mixin steps-status-mixin ($status) {
@include m($status) {
@include b(step-splitor) {
background-color: map-get($--steps-step-splitor-color, $status);
2019-08-01 14:52:52 +08:00
}
2019-10-21 19:16:31 +08:00
@include b(step-content) {
2019-12-12 15:41:18 +08:00
@include b(step-content-header) {
2019-10-21 19:16:31 +08:00
color: map-get($--steps-step-title-color, $status);
2019-08-01 14:52:52 +08:00
}
2019-10-21 19:16:31 +08:00
@include e(description) {
color: map-get($--steps-step-content-color, $status);
2019-08-01 14:52:52 +08:00
}
}
2019-10-21 19:16:31 +08:00
@include b(step-indicator) {
background-color: map-get($--steps-step-background-color, $status);
box-shadow: 0 0 0 1px map-get($--steps-step-border-color, $status);
2019-12-12 15:41:18 +08:00
@include b(step-indicator-slot) {
@include e(index) {
color: map-get($--steps-step-indicator-color, $status);
}
@include b(icon) {
fill: map-get($--steps-step-indicator-color, $status);
}
2019-11-28 14:42:11 +08:00
}
2019-08-01 14:52:52 +08:00
}
2019-10-21 19:16:31 +08:00
}
}
@include themes-mixin {
@include b(steps) {
2019-12-12 15:49:20 +08:00
@include once {
@include steps-size-mixin('small');
@include steps-size-mixin('medium');
width: 100%;
2019-12-12 15:41:18 +08:00
display: flex;
2019-12-12 15:49:20 +08:00
@include b(step-splitor) {
transition: color .3s $default-cubic-bezier, background-color .3s $default-cubic-bezier;
height: 1px;
flex: 1;
align-self: flex-start;
margin-left: 12px;
margin-right: 12px;
2019-12-12 15:41:18 +08:00
}
@include b(step-content) {
2019-12-12 15:49:20 +08:00
flex: 1;
@include b(step-content-header) {
transition: color .3s $default-cubic-bezier, background-color .3s $default-cubic-bezier;
position: relative;
display: flex;
font-weight: 700;
margin-left: 9px;
@include e(title) {
white-space: nowrap;
flex: 0;
}
}
2019-12-12 15:41:18 +08:00
@include e(description) {
2019-12-12 15:49:20 +08:00
transition: color .3s $default-cubic-bezier, background-color .3s $default-cubic-bezier;
margin-top: 12px;
margin-left: 9px;
2019-08-01 18:19:03 +08:00
}
}
2019-12-12 15:49:20 +08:00
@include b(step-indicator) {
transition: background-color .3s $default-cubic-bezier, box-shadow .3s $default-cubic-bezier;
2019-10-21 19:16:31 +08:00
display: flex;
2019-12-12 15:49:20 +08:00
align-items: center;
justify-content: center;
@include b(step-indicator-slot) {
position: relative;
@include e(index) {
@include icon-switch-transition();
2019-12-12 15:49:20 +08:00
display: inline-block;
text-align: center;
transition: color .3s $default-cubic-bezier;
position: absolute;
left: 0;
top: 0;
transform: scale(0.9999);
}
@include b(icon) {
@include icon-switch-transition();
}
2019-10-21 19:16:31 +08:00
}
2019-08-01 14:52:52 +08:00
}
2019-12-12 15:49:20 +08:00
@include m(vertical) {
flex-direction: column;
$step-margin-bottom: 16px;
@include b(step) {
margin-bottom: $step-margin-bottom;
&:last-child {
margin-bottom: 0;
}
}
@include b(step-indicator) {
@include b(step-splitor) {
position: absolute;
bottom: -$step-margin-bottom / 2;
width: 1px;
margin: 0 !important;
}
}
@include b(step-content) {
@include e(description) {
margin-top: 8px;
}
}
2019-08-01 14:52:52 +08:00
}
}
2019-12-12 15:49:20 +08:00
@include b(step) {
@include steps-status-mixin('finish');
@include steps-status-mixin('error');
@include steps-status-mixin('wait');
@include steps-status-mixin('process');
@include once {
2019-12-12 15:41:18 +08:00
position: relative;
2019-12-12 15:49:20 +08:00
display: flex;
flex: 1;
&:last-child {
@include b(step-splitor) {
display: none;
}
2019-12-12 15:41:18 +08:00
}
2019-08-01 18:19:03 +08:00
}
}
2019-08-01 14:52:52 +08:00
}
}