2019-06-18 14:53:24 +08:00
|
|
|
@import './mixins/mixins.scss';
|
2020-02-11 14:44:29 +08:00
|
|
|
|
2019-09-20 17:36:18 +08:00
|
|
|
@mixin button-size-mixin($size) {
|
2020-02-23 11:00:31 +08:00
|
|
|
@include m($size + '-size') {
|
2020-02-22 20:25:10 +08:00
|
|
|
$height: map-get($--n-height, $size);
|
2020-02-22 14:11:34 +08:00
|
|
|
$font-size: map-get($--n-button-font-size, $size);
|
2020-02-29 18:09:22 +08:00
|
|
|
$icon-size: map-get($--n-button-icon-size, $size);
|
2020-02-21 14:59:17 +08:00
|
|
|
border-radius: $--n-button-border-radius;
|
2019-09-16 17:52:31 +08:00
|
|
|
font-size: $font-size;
|
2019-12-08 17:21:44 +08:00
|
|
|
@include not-m(text) {
|
|
|
|
height: $height;
|
2020-02-29 17:39:27 +08:00
|
|
|
line-height: $height - 2px;
|
2020-02-22 14:11:34 +08:00
|
|
|
padding: map-get($--n-button-padding, $size);
|
2019-12-08 17:21:44 +08:00
|
|
|
}
|
2019-09-17 23:42:03 +08:00
|
|
|
white-space: nowrap;
|
2019-09-16 17:52:31 +08:00
|
|
|
@include m(round) {
|
2020-02-22 14:11:34 +08:00
|
|
|
padding: map-get($--n-button-round-padding, $size);
|
2019-09-16 17:52:31 +08:00
|
|
|
border-radius: $height / 2;
|
|
|
|
}
|
2019-09-18 19:11:27 +08:00
|
|
|
@include m(circle) {
|
|
|
|
border-radius: $height / 2;
|
|
|
|
width: $height;
|
|
|
|
padding: 0!important;
|
|
|
|
}
|
2019-09-16 17:52:31 +08:00
|
|
|
@include e(content) {
|
2019-09-17 23:42:03 +08:00
|
|
|
display: inline-block;
|
2019-12-08 17:21:44 +08:00
|
|
|
line-height: inherit;
|
2019-09-16 17:52:31 +08:00
|
|
|
}
|
|
|
|
@include e(icon) {
|
2019-09-17 23:42:03 +08:00
|
|
|
display: inline-block;
|
|
|
|
position: relative;
|
2020-02-29 17:39:27 +08:00
|
|
|
line-height: $height - 2px;
|
|
|
|
height: $height - 2px;
|
2019-09-16 17:52:31 +08:00
|
|
|
width: $icon-size;
|
|
|
|
max-width: $icon-size;
|
2019-09-17 23:42:03 +08:00
|
|
|
vertical-align: bottom;
|
2019-10-24 18:04:31 +08:00
|
|
|
@include b(icon) {
|
2019-09-16 17:52:31 +08:00
|
|
|
font-size: $icon-size;
|
2019-09-17 23:42:03 +08:00
|
|
|
}
|
2020-01-31 21:58:21 +08:00
|
|
|
@include b(base-loading) {
|
2020-02-29 18:09:22 +08:00
|
|
|
height: $icon-size - 2px;
|
|
|
|
width: $icon-size - 2px;
|
2019-09-17 23:42:03 +08:00
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
top: 50%;
|
|
|
|
transform: translateY(-50%);
|
2019-09-16 17:52:31 +08:00
|
|
|
display: block;
|
2019-12-16 16:35:28 +08:00
|
|
|
@include icon-switch-transition($top: 50%, $original-transform: translateY(-50%));
|
2019-09-16 17:52:31 +08:00
|
|
|
}
|
|
|
|
@include m(slot) {
|
|
|
|
width: $icon-size;
|
2019-09-17 23:42:03 +08:00
|
|
|
font-size: $icon-size;
|
|
|
|
display: inline-flex;
|
|
|
|
align-items: center;
|
|
|
|
vertical-align: bottom;
|
2019-10-24 18:04:31 +08:00
|
|
|
@include b(icon-slot) {
|
2019-12-16 16:35:28 +08:00
|
|
|
@include icon-switch-transition($top: 50%, $original-transform: translateY(-50%));
|
|
|
|
position: absolute;
|
|
|
|
left: 0;
|
|
|
|
top: 50%;
|
|
|
|
transform: translateY(-50%);
|
2019-09-17 23:42:03 +08:00
|
|
|
display: block;
|
|
|
|
line-height: $icon-size;
|
2019-09-16 17:52:31 +08:00
|
|
|
height: $icon-size;
|
|
|
|
width: $icon-size;
|
|
|
|
font-size: $icon-size;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-12-08 17:21:44 +08:00
|
|
|
@include m(text) {
|
|
|
|
padding: 0;
|
|
|
|
border-radius: 0;
|
2020-02-29 18:09:22 +08:00
|
|
|
@include e(icon) {
|
|
|
|
height: $icon-size;
|
|
|
|
line-height: $icon-size;
|
|
|
|
}
|
2019-12-08 17:21:44 +08:00
|
|
|
}
|
2019-09-16 17:52:31 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-20 17:36:18 +08:00
|
|
|
@mixin button-type-mixin ($type) {
|
2020-02-23 11:00:31 +08:00
|
|
|
@include m($type + '-type') {
|
|
|
|
color: map-get($--button-text-color, $type);
|
2020-02-22 14:11:34 +08:00
|
|
|
background-color: map-get($--button-background-color, $type);
|
2020-02-29 17:39:27 +08:00
|
|
|
border: 1px solid map-get($--button-border-color, $type);
|
2020-02-29 18:09:22 +08:00
|
|
|
@include m(ghost, text) {
|
2020-02-23 11:00:31 +08:00
|
|
|
background-color: map-get($--button-ghost-typed-background-color, $type);
|
|
|
|
color: map-get($--button-ghost-typed-text-color, $type);
|
2020-02-29 17:39:27 +08:00
|
|
|
border: 1px solid map-get($--button-ghost-typed-border-color, $type);
|
2019-09-18 19:11:27 +08:00
|
|
|
@include not-m(disabled) {
|
|
|
|
@include m(enter-pressed) {
|
2020-02-23 11:00:31 +08:00
|
|
|
background-color: map-get($--button-ghost-typed-background-color, $type + '-active');
|
|
|
|
color: map-get($--button-ghost-typed-text-color, $type + '-active');
|
2020-02-29 17:39:27 +08:00
|
|
|
@include e(border-mask) {
|
|
|
|
box-shadow: map-get($--button-ghost-typed-border-mask-box-shadow, $type + '-active');
|
|
|
|
}
|
2020-02-23 11:00:31 +08:00
|
|
|
@include e(icon) {
|
|
|
|
@include b(icon) {
|
|
|
|
fill: map-get($--button-ghost-typed-text-color, $type + '-active') !important;
|
|
|
|
stroke: map-get($--button-ghost-typed-text-color, $type + '-active') !important;
|
|
|
|
}
|
|
|
|
@include b(base-loading) {
|
|
|
|
fill: map-get($--button-ghost-typed-text-color, $type + '-active') !important;
|
|
|
|
stroke: map-get($--button-ghost-typed-text-color, $type + '-active') !important;
|
|
|
|
}
|
|
|
|
}
|
2019-09-18 19:11:27 +08:00
|
|
|
}
|
|
|
|
&:not(:active):focus {
|
|
|
|
@include not-m(enter-pressed) {
|
2020-02-23 11:00:31 +08:00
|
|
|
color: map-get($--button-ghost-typed-text-color, $type + '-focus');
|
|
|
|
background-color: map-get($--button-ghost-typed-background-color, $type + '-focus');
|
2020-02-29 17:39:27 +08:00
|
|
|
@include e(border-mask) {
|
|
|
|
box-shadow: map-get($--button-ghost-typed-border-mask-box-shadow, $type + '-focus');
|
|
|
|
}
|
2020-02-23 11:00:31 +08:00
|
|
|
@include e(icon) {
|
|
|
|
@include b(icon) {
|
|
|
|
fill: map-get($--button-ghost-typed-text-color, $type + '-focus') !important;
|
|
|
|
stroke: map-get($--button-ghost-typed-text-color, $type + '-focus') !important;
|
|
|
|
}
|
|
|
|
@include b(base-loading) {
|
|
|
|
fill: map-get($--button-ghost-typed-text-color, $type + '-focus') !important;
|
|
|
|
stroke: map-get($--button-ghost-typed-text-color, $type + '-focus') !important;
|
|
|
|
}
|
|
|
|
}
|
2019-09-18 19:11:27 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@include not-m(enter-pressed) {
|
|
|
|
&:hover {
|
2020-02-23 11:00:31 +08:00
|
|
|
background-color: map-get($--button-ghost-typed-background-color, $type + '-hover');
|
|
|
|
color: map-get($--button-ghost-typed-text-color, $type + '-hover');
|
2020-02-29 17:39:27 +08:00
|
|
|
@include e(border-mask) {
|
|
|
|
box-shadow: map-get($--button-ghost-typed-border-mask-box-shadow, $type + '-hover');
|
|
|
|
}
|
2020-02-23 11:00:31 +08:00
|
|
|
@include e(icon) {
|
|
|
|
@include b(icon) {
|
|
|
|
fill: map-get($--button-ghost-typed-text-color, $type + '-hover') !important;
|
|
|
|
stroke: map-get($--button-ghost-typed-text-color, $type + '-hover') !important;
|
|
|
|
}
|
|
|
|
@include b(base-loading) {
|
|
|
|
fill: map-get($--button-ghost-typed-text-color, $type + '-hover') !important;
|
|
|
|
stroke: map-get($--button-ghost-typed-text-color, $type + '-hover') !important;
|
|
|
|
}
|
|
|
|
}
|
2019-09-18 19:11:27 +08:00
|
|
|
}
|
|
|
|
&:active {
|
2020-02-23 11:00:31 +08:00
|
|
|
background-color: map-get($--button-ghost-typed-background-color, $type + '-active');
|
|
|
|
color: map-get($--button-ghost-typed-text-color, $type + '-active');
|
2020-02-29 17:39:27 +08:00
|
|
|
@include e(border-mask) {
|
|
|
|
box-shadow: map-get($--button-ghost-typed-border-mask-box-shadow, $type + '-active');
|
|
|
|
}
|
2020-02-23 11:00:31 +08:00
|
|
|
@include e(icon) {
|
|
|
|
@include b(icon) {
|
|
|
|
fill: map-get($--button-ghost-typed-text-color, $type + '-active') !important;
|
|
|
|
stroke: map-get($--button-ghost-typed-text-color, $type + '-active') !important;
|
|
|
|
}
|
|
|
|
@include b(base-loading) {
|
|
|
|
fill: map-get($--button-ghost-typed-text-color, $type + '-active') !important;
|
|
|
|
stroke: map-get($--button-ghost-typed-text-color, $type + '-active') !important;
|
|
|
|
}
|
|
|
|
}
|
2019-09-18 19:11:27 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-09-20 17:36:18 +08:00
|
|
|
@include e(icon) {
|
2019-11-29 15:34:37 +08:00
|
|
|
@include b(icon) {
|
2020-02-23 11:00:31 +08:00
|
|
|
fill: map-get($--button-ghost-typed-text-color, $type) !important;
|
|
|
|
stroke: map-get($--button-ghost-typed-text-color, $type) !important;
|
2019-10-24 18:04:31 +08:00
|
|
|
}
|
2020-02-23 11:00:31 +08:00
|
|
|
@include b(base-loading) {
|
|
|
|
fill: map-get($--button-ghost-typed-text-color, $type) !important;
|
|
|
|
stroke: map-get($--button-ghost-typed-text-color, $type) !important;
|
2019-09-18 19:11:27 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-02-29 18:09:22 +08:00
|
|
|
@include m(text) {
|
|
|
|
@include e(border-mask) {
|
|
|
|
box-shadow: none !important;
|
|
|
|
}
|
|
|
|
border: none;
|
|
|
|
background-color: transparent;
|
|
|
|
color: map-get($--button-text-typed-text-color, $type);
|
|
|
|
@include not-m(disabled) {
|
|
|
|
@include m(rippling) {
|
|
|
|
&::after {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@include m(enter-pressed) {
|
|
|
|
background-color: transparent;
|
|
|
|
color: map-get($--button-text-typed-text-color, $type + '-active');
|
|
|
|
}
|
|
|
|
&:not(:active):focus {
|
|
|
|
@include not-m(enter-pressed) {
|
|
|
|
background-color: transparent;
|
|
|
|
color: map-get($--button-text-typed-text-color, $type + '-focus');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@include not-m(enter-pressed) {
|
|
|
|
&:hover {
|
|
|
|
background-color: transparent;
|
|
|
|
color: map-get($--button-text-typed-text-color, $type + '-hover');
|
|
|
|
}
|
|
|
|
&:active {
|
|
|
|
background-color: transparent;
|
|
|
|
color: map-get($--button-text-typed-text-color, $type + '-active');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-02-23 11:00:31 +08:00
|
|
|
@include e(icon) {
|
|
|
|
@include b(icon) {
|
|
|
|
fill: map-get($--button-text-color, $type) !important;
|
|
|
|
stroke: map-get($--button-text-color, $type) !important;
|
|
|
|
}
|
|
|
|
@include b(base-loading) {
|
|
|
|
fill: map-get($--button-text-color, $type) !important;
|
|
|
|
stroke: map-get($--button-text-color, $type) !important;
|
2019-09-20 00:22:13 +08:00
|
|
|
}
|
|
|
|
}
|
2019-09-16 17:52:31 +08:00
|
|
|
@include not-m(disabled) {
|
2019-09-17 00:57:51 +08:00
|
|
|
@include m(enter-pressed) {
|
2020-02-22 14:11:34 +08:00
|
|
|
background-color: map-get($--button-background-color, $type + '-active');
|
2020-02-23 11:00:31 +08:00
|
|
|
color: map-get($--button-text-color, $type + '-active');
|
2020-02-29 17:39:27 +08:00
|
|
|
@include e(border-mask) {
|
|
|
|
box-shadow: map-get($--button-border-mask-box-shadow, $type + '-active');
|
|
|
|
}
|
2020-02-23 11:00:31 +08:00
|
|
|
@include e(icon) {
|
|
|
|
@include b(icon) {
|
|
|
|
fill: map-get($--button-text-color, $type + '-active') !important;
|
|
|
|
stroke: map-get($--button-text-color, $type + '-active') !important;
|
|
|
|
}
|
|
|
|
@include b(base-loading) {
|
|
|
|
fill: map-get($--button-text-color, $type + '-active') !important;
|
|
|
|
stroke: map-get($--button-text-color, $type + '-active') !important;
|
|
|
|
}
|
|
|
|
}
|
2019-09-17 00:57:51 +08:00
|
|
|
}
|
2019-09-16 17:52:31 +08:00
|
|
|
@include m(rippling) {
|
2019-09-17 00:57:51 +08:00
|
|
|
&::after {
|
2019-10-10 00:07:24 +08:00
|
|
|
z-index: 1;
|
2019-09-17 19:28:07 +08:00
|
|
|
animation-name: #{$theme}-#{$type}-button-ripple--spread, #{$theme}-#{$type}-button-ripple--opacity;
|
2019-09-17 00:57:51 +08:00
|
|
|
animation-duration: .6s;
|
|
|
|
animation-timing-function: cubic-bezier(0, .4, .5, .9), cubic-bezier(.5, .2, .8, .5);
|
|
|
|
}
|
2019-09-16 17:52:31 +08:00
|
|
|
}
|
|
|
|
&:not(:active):focus {
|
|
|
|
@include not-m(enter-pressed) {
|
2020-02-23 11:00:31 +08:00
|
|
|
background-color: map-get($--button-background-color, $type + '-focus');
|
|
|
|
color: map-get($--button-text-color, $type + '-focus');
|
2020-02-29 17:39:27 +08:00
|
|
|
@include e(border-mask) {
|
|
|
|
box-shadow: map-get($--button-border-mask-box-shadow, $type + '-focus');
|
|
|
|
}
|
2020-02-23 11:00:31 +08:00
|
|
|
@include e(icon) {
|
|
|
|
@include b(icon) {
|
|
|
|
fill: map-get($--button-text-color, $type + '-focus') !important;
|
|
|
|
stroke: map-get($--button-text-color, $type + '-focus') !important;
|
|
|
|
}
|
|
|
|
@include b(base-loading) {
|
|
|
|
fill: map-get($--button-text-color, $type + '-focus') !important;
|
|
|
|
stroke: map-get($--button-text-color, $type + '-focus') !important;
|
|
|
|
}
|
|
|
|
}
|
2019-09-16 17:52:31 +08:00
|
|
|
}
|
|
|
|
}
|
2019-09-17 23:42:03 +08:00
|
|
|
@include not-m(enter-pressed) {
|
|
|
|
&:hover {
|
2020-02-22 14:11:34 +08:00
|
|
|
background-color: map-get($--button-background-color, $type + '-hover');
|
2020-02-23 11:00:31 +08:00
|
|
|
color: map-get($--button-text-color, $type + '-hover');
|
2020-02-29 17:39:27 +08:00
|
|
|
@include e(border-mask) {
|
|
|
|
box-shadow: map-get($--button-border-mask-box-shadow, $type + '-hover');
|
|
|
|
}
|
2020-02-23 11:00:31 +08:00
|
|
|
@include e(icon) {
|
|
|
|
@include b(icon) {
|
|
|
|
fill: map-get($--button-text-color, $type + '-hover') !important;
|
|
|
|
stroke: map-get($--button-text-color, $type + '-hover') !important;
|
|
|
|
}
|
|
|
|
@include b(base-loading) {
|
|
|
|
fill: map-get($--button-text-color, $type + '-hover') !important;
|
|
|
|
stroke: map-get($--button-text-color, $type + '-hover') !important;
|
|
|
|
}
|
|
|
|
}
|
2019-09-17 23:42:03 +08:00
|
|
|
}
|
2019-09-18 19:11:27 +08:00
|
|
|
&:active {
|
2020-02-22 14:11:34 +08:00
|
|
|
background-color: map-get($--button-background-color, $type + '-active');
|
2020-02-23 11:00:31 +08:00
|
|
|
color: map-get($--button-text-color, $type + '-active');
|
2020-02-29 17:39:27 +08:00
|
|
|
@include e(border-mask) {
|
|
|
|
box-shadow: map-get($--button-border-mask-box-shadow, $type + '-active');
|
|
|
|
}
|
2020-02-23 11:00:31 +08:00
|
|
|
@include e(icon) {
|
|
|
|
@include b(icon) {
|
|
|
|
fill: map-get($--button-text-color, $type + '-active') !important;
|
|
|
|
stroke: map-get($--button-text-color, $type + '-active') !important;
|
|
|
|
}
|
|
|
|
@include b(base-loading) {
|
|
|
|
fill: map-get($--button-text-color, $type + '-active') !important;
|
|
|
|
stroke: map-get($--button-text-color, $type + '-active') !important;
|
|
|
|
}
|
|
|
|
}
|
2019-09-18 19:11:27 +08:00
|
|
|
}
|
2019-09-16 17:52:31 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-02-23 11:00:31 +08:00
|
|
|
@mixin button-ripple-mixin($type) {
|
2019-09-17 19:28:07 +08:00
|
|
|
@keyframes #{$theme}-#{$type}-button-ripple--spread {
|
2019-09-16 17:52:31 +08:00
|
|
|
from {
|
2020-02-23 11:00:31 +08:00
|
|
|
box-shadow: map-get($--button-ripple-box-shadow, $type + '-start');
|
2019-09-16 17:52:31 +08:00
|
|
|
}
|
|
|
|
to {
|
2020-02-23 11:00:31 +08:00
|
|
|
box-shadow: map-get($--button-ripple-box-shadow, $type + '-end');
|
2019-09-17 00:57:51 +08:00
|
|
|
}
|
|
|
|
}
|
2019-09-17 19:28:07 +08:00
|
|
|
@keyframes #{$theme}-#{$type}-button-ripple--opacity {
|
2019-09-17 00:57:51 +08:00
|
|
|
from {
|
|
|
|
opacity: .4;
|
|
|
|
}
|
|
|
|
to {
|
|
|
|
opacity: 0;
|
2019-09-16 17:52:31 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-07 15:48:49 +08:00
|
|
|
@include themes-mixin {
|
2020-02-23 11:00:31 +08:00
|
|
|
@include button-ripple-mixin('default');
|
|
|
|
@include button-ripple-mixin('primary');
|
|
|
|
@include button-ripple-mixin('error');
|
|
|
|
@include button-ripple-mixin('success');
|
|
|
|
@include button-ripple-mixin('warning');
|
|
|
|
@include button-ripple-mixin('info');
|
2019-09-17 19:28:07 +08:00
|
|
|
@include b(button) {
|
|
|
|
@include once {
|
2020-02-29 17:39:27 +08:00
|
|
|
box-sizing: border-box;
|
2019-09-17 19:28:07 +08:00
|
|
|
outline: none;
|
|
|
|
position: relative;
|
2020-02-29 17:39:27 +08:00
|
|
|
z-index: auto;
|
2019-09-17 19:28:07 +08:00
|
|
|
border: none;
|
2020-02-22 14:11:34 +08:00
|
|
|
font-family: inherit;
|
2019-09-17 23:42:03 +08:00
|
|
|
display: inline-block;
|
2019-09-17 19:28:07 +08:00
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
|
|
|
user-select: none;
|
|
|
|
text-align: center;
|
2020-02-18 15:14:24 +08:00
|
|
|
transition:
|
|
|
|
background-color .3s $--n-ease-in-out-cubic-bezier,
|
|
|
|
opacity .3s $--n-ease-in-out-cubic-bezier,
|
2020-02-29 17:39:27 +08:00
|
|
|
border-color .3s $--n-ease-in-out-cubic-bezier;
|
2019-09-17 19:28:07 +08:00
|
|
|
cursor: pointer;
|
|
|
|
&::after {
|
2020-03-04 13:57:22 +08:00
|
|
|
pointer-events: none;
|
2019-09-17 19:28:07 +08:00
|
|
|
content: "";
|
|
|
|
border-radius: inherit;
|
|
|
|
position: absolute;
|
2020-02-29 17:39:27 +08:00
|
|
|
left: -1px;
|
|
|
|
top: -1px;
|
|
|
|
right: -1px;
|
|
|
|
bottom: -1px;
|
|
|
|
}
|
|
|
|
@include e(border-mask) {
|
|
|
|
position: absolute;
|
|
|
|
left: -1px;
|
|
|
|
top: -1px;
|
|
|
|
right: -1px;
|
|
|
|
bottom: -1px;
|
|
|
|
border-radius: inherit;
|
|
|
|
box-shadow: inset 0 0 0 1px transparent;
|
|
|
|
transition: box-shadow .3s $--n-ease-in-out-cubic-bezier;
|
2020-03-04 13:57:22 +08:00
|
|
|
pointer-events: none;
|
2020-03-07 15:48:49 +08:00
|
|
|
z-index: 1;
|
2019-09-17 19:28:07 +08:00
|
|
|
}
|
|
|
|
@include e(icon) {
|
|
|
|
@include fade-in-width-expand-transition();
|
2019-12-22 15:50:37 +08:00
|
|
|
transition: color .3s $--n-ease-in-out-cubic-bezier;
|
2019-09-18 19:11:27 +08:00
|
|
|
}
|
2019-09-17 19:28:07 +08:00
|
|
|
@include e(content) {
|
|
|
|
white-space: nowrap;
|
2019-12-22 15:50:37 +08:00
|
|
|
transition: color .3s $--n-ease-in-out-cubic-bezier;
|
2019-09-18 19:11:27 +08:00
|
|
|
}
|
2019-09-20 00:22:13 +08:00
|
|
|
@include m(left-icon) {
|
|
|
|
@include e(icon) {
|
2019-09-18 19:11:27 +08:00
|
|
|
margin-right: 6px;
|
|
|
|
}
|
2019-09-17 19:28:07 +08:00
|
|
|
}
|
2019-09-20 00:22:13 +08:00
|
|
|
@include m(right-icon) {
|
|
|
|
@include e(icon) {
|
|
|
|
margin-left: 6px;
|
|
|
|
}
|
|
|
|
}
|
2019-09-17 19:28:07 +08:00
|
|
|
@include m(block) {
|
|
|
|
display: block;
|
2019-09-18 19:11:27 +08:00
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
@include m(loading) {
|
|
|
|
cursor: default;
|
|
|
|
opacity: 1;
|
2019-09-17 19:28:07 +08:00
|
|
|
}
|
|
|
|
@include m(disabled) {
|
|
|
|
cursor: not-allowed;
|
|
|
|
}
|
|
|
|
&::-moz-focus-inner {
|
|
|
|
border: 0;
|
|
|
|
}
|
2019-09-20 17:36:18 +08:00
|
|
|
@include button-size-mixin('tiny');
|
|
|
|
@include button-size-mixin('small');
|
|
|
|
@include button-size-mixin('medium');
|
|
|
|
@include button-size-mixin('large');
|
2019-07-04 10:41:59 +08:00
|
|
|
}
|
2020-02-20 15:26:12 +08:00
|
|
|
@include m(disabled) {
|
|
|
|
opacity: $--button-disabled-opacity;
|
|
|
|
}
|
2019-09-20 17:36:18 +08:00
|
|
|
@include button-type-mixin('default');
|
|
|
|
@include button-type-mixin('primary');
|
|
|
|
@include button-type-mixin('info');
|
|
|
|
@include button-type-mixin('success');
|
|
|
|
@include button-type-mixin('warning');
|
|
|
|
@include button-type-mixin('error');
|
2019-06-18 14:53:24 +08:00
|
|
|
}
|
2019-09-18 19:19:22 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
@include b(button-group) {
|
2019-09-19 11:13:05 +08:00
|
|
|
white-space: nowrap;
|
2019-10-09 17:38:08 +08:00
|
|
|
display: inline-block;
|
2019-10-10 00:07:24 +08:00
|
|
|
position: relative;
|
2019-09-19 11:13:05 +08:00
|
|
|
@include not-m(vertical) {
|
2019-11-13 00:02:42 +08:00
|
|
|
@include m(block) {
|
|
|
|
display: flex;
|
|
|
|
flex-wrap: nowrap;
|
|
|
|
@include b(button) {
|
|
|
|
flex-grow: 1;
|
|
|
|
}
|
|
|
|
}
|
2019-09-19 11:13:05 +08:00
|
|
|
@include b(button) {
|
2019-10-23 23:08:29 +08:00
|
|
|
&:first-child:not(:last-child) {
|
2019-09-19 11:13:05 +08:00
|
|
|
margin-right: 0!important;
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
}
|
2019-10-23 23:08:29 +08:00
|
|
|
&:last-child:not(:first-child) {
|
2019-09-19 11:13:05 +08:00
|
|
|
margin-left: 0!important;
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
}
|
|
|
|
&:not(:first-child):not(:last-child) {
|
|
|
|
margin-left: 0!important;
|
|
|
|
margin-right: 0!important;
|
|
|
|
border-radius: 0!important;
|
|
|
|
}
|
2019-10-09 17:38:08 +08:00
|
|
|
/**
|
2020-02-29 17:39:27 +08:00
|
|
|
* Not an perfect implementation,
|
|
|
|
* since their border is not really "shared"
|
2019-10-09 17:38:08 +08:00
|
|
|
*/
|
2020-02-11 17:19:00 +08:00
|
|
|
@include m(default-type) {
|
|
|
|
& + {
|
|
|
|
@include b(button) {
|
|
|
|
@include m(default-type) {
|
2020-02-29 17:39:27 +08:00
|
|
|
border-left-width: 0px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@include m(ghost) {
|
|
|
|
@include m(primary-type) {
|
|
|
|
& + {
|
|
|
|
@include b(button) {
|
|
|
|
@include m(primary-type) {
|
|
|
|
border-left-width: 0px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@include m(success-type) {
|
|
|
|
& + {
|
|
|
|
@include b(button) {
|
|
|
|
@include m(success-type) {
|
|
|
|
border-left-width: 0px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@include m(error-type) {
|
|
|
|
& + {
|
|
|
|
@include b(button) {
|
|
|
|
@include m(error-type) {
|
|
|
|
border-left-width: 0px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@include m(info-type) {
|
|
|
|
& + {
|
|
|
|
@include b(button) {
|
|
|
|
@include m(info-type) {
|
|
|
|
border-left-width: 0px;
|
|
|
|
}
|
2020-02-11 17:19:00 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-10-09 17:38:08 +08:00
|
|
|
}
|
2019-09-18 19:19:22 +08:00
|
|
|
}
|
2019-09-19 11:13:05 +08:00
|
|
|
}
|
|
|
|
@include m(vertical) {
|
|
|
|
display: inline-flex;
|
|
|
|
flex-direction: column;
|
|
|
|
@include b(button) {
|
|
|
|
&:first-child {
|
|
|
|
margin-bottom: 0!important;
|
|
|
|
margin-left: 0!important;
|
|
|
|
margin-right: 0!important;
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
}
|
|
|
|
&:last-child {
|
|
|
|
margin-top: 0!important;
|
|
|
|
margin-left: 0!important;
|
|
|
|
margin-right: 0!important;
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
}
|
|
|
|
&:not(:first-child):not(:last-child) {
|
|
|
|
margin: 0!important;
|
|
|
|
border-radius: 0!important;
|
|
|
|
}
|
2020-02-29 17:39:27 +08:00
|
|
|
@include m(default-type) {
|
|
|
|
& + {
|
|
|
|
@include b(button) {
|
|
|
|
@include m(default-type) {
|
|
|
|
border-top-width: 0px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@include m(ghost) {
|
|
|
|
@include m(info-type) {
|
|
|
|
& + {
|
|
|
|
@include b(button) {
|
|
|
|
@include m(info-type) {
|
|
|
|
border-top-width: 0px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@include m(success-type) {
|
|
|
|
& + {
|
|
|
|
@include b(button) {
|
|
|
|
@include m(success-type) {
|
|
|
|
border-top-width: 0px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@include m(warning-type) {
|
|
|
|
& + {
|
|
|
|
@include b(button) {
|
|
|
|
@include m(warning-type) {
|
|
|
|
border-top-width: 0px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@include m(error-type) {
|
|
|
|
& + {
|
|
|
|
@include b(button) {
|
|
|
|
@include m(error-type) {
|
|
|
|
border-top-width: 0px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@include m(primary-type) {
|
|
|
|
& + {
|
|
|
|
@include b(button) {
|
|
|
|
@include m(primary-type) {
|
|
|
|
border-top-width: 0px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-09-18 19:19:22 +08:00
|
|
|
}
|
|
|
|
}
|
2019-06-18 14:53:24 +08:00
|
|
|
}
|