naive-ui/styles/Steps.scss

185 lines
5.5 KiB
SCSS
Raw Normal View History

2019-08-01 14:52:52 +08:00
@import './mixins/mixins.scss';
2020-02-11 14:44:29 +08:00
2019-12-12 15:41:18 +08:00
@mixin steps-size-mixin ($size) {
@include m($size + '-size') {
2020-02-21 14:59:17 +08:00
$title-font-size: map-get($--n-steps-header-font-size, $size);
$indicator-size: map-get($--n-steps-indicator-size, $size);
$indicator-icon-size: map-get($--n-steps-indicator-icon-size, $size);
$indicator-index-font-size: map-get($--n-steps-indicator-index-font-size, $size);
2019-12-12 15:41:18 +08:00
$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) {
2020-02-21 14:59:17 +08:00
background-color: map-get($--steps-step-splitor-background-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) {
2020-02-21 14:59:17 +08:00
color: map-get($--steps-step-title-text-color, $status);
2019-08-01 14:52:52 +08:00
}
2019-10-21 19:16:31 +08:00
@include e(description) {
2020-02-21 14:59:17 +08:00
color: map-get($--steps-step-content-text-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) {
2020-02-21 14:59:17 +08:00
color: map-get($--steps-step-indicator-text-color, $status);
2019-12-12 15:41:18 +08:00
}
@include b(icon) {
2020-02-21 14:59:17 +08:00
fill: map-get($--steps-step-indicator-text-color, $status);
stroke: map-get($--steps-step-indicator-text-color, $status);
2019-12-12 15:41:18 +08:00
}
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 $--n-ease-in-out-cubic-bezier,
background-color .3s $--n-ease-in-out-cubic-bezier;
2019-12-12 15:49:20 +08:00
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 $--n-ease-in-out-cubic-bezier, background-color .3s $--n-ease-in-out-cubic-bezier;
2019-12-12 15:49:20 +08:00
position: relative;
display: flex;
2020-02-27 23:02:58 +08:00
font-weight: $--n-strong-weight;
2019-12-12 15:49:20 +08:00
margin-left: 9px;
@include e(title) {
white-space: nowrap;
flex: 0;
}
}
2019-12-12 15:41:18 +08:00
@include e(description) {
transition: color .3s $--n-ease-in-out-cubic-bezier, background-color .3s $--n-ease-in-out-cubic-bezier;
2019-12-12 15:49:20 +08:00
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 $--n-ease-in-out-cubic-bezier,
box-shadow .3s $--n-ease-in-out-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 $--n-ease-in-out-cubic-bezier;
2019-12-12 15:49:20 +08:00
position: absolute;
left: 0;
top: 0;
transform: $--n-transform-debounce-scale;
2019-12-12 15:49:20 +08:00
}
@include b(icon) {
@include icon-switch-transition();
}
2019-10-21 19:16:31 +08:00
}
2019-08-01 14:52:52 +08:00
}
@include m(transition-disabled) {
@include b(step-indicator) {
@include b(step-indicator-slot) {
@include e(index) {
transition: none !important;
}
}
}
}
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
}
}