2019-09-29 16:02:28 +08:00
|
|
|
@import "./mixins/mixins.scss";
|
2019-06-13 19:17:41 +08:00
|
|
|
|
2020-03-06 23:41:21 +08:00
|
|
|
@mixin checkbox-size-mixin ($size) {
|
|
|
|
@include m($size + '-size') {
|
|
|
|
height: map-get($--n-font-size, $size);
|
|
|
|
line-height: map-get($--n-font-size, $size);
|
|
|
|
font-size: map-get($--n-font-size, $size);
|
|
|
|
@include b(checkbox-box) {
|
|
|
|
height: map-get($--n-checkbox-size, $size);
|
|
|
|
width: map-get($--n-checkbox-size, $size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-09-29 16:02:28 +08:00
|
|
|
@include themes-mixin {
|
|
|
|
@include once {
|
|
|
|
@include b(checkbox-group) {
|
2019-10-11 17:01:23 +08:00
|
|
|
font-size: 14px;
|
2019-12-24 21:49:45 +08:00
|
|
|
line-height: 14px;
|
2019-10-11 17:01:23 +08:00
|
|
|
@include b(checkbox) {
|
2019-09-29 16:02:28 +08:00
|
|
|
margin-right: 18px;
|
|
|
|
}
|
2019-06-28 15:08:31 +08:00
|
|
|
}
|
2019-09-29 16:02:28 +08:00
|
|
|
@include b(checkbox) {
|
2020-03-06 23:41:21 +08:00
|
|
|
@include checkbox-size-mixin('small');
|
|
|
|
@include checkbox-size-mixin('medium');
|
|
|
|
@include checkbox-size-mixin('large');
|
2019-10-11 17:01:23 +08:00
|
|
|
outline: none;
|
|
|
|
cursor: pointer;
|
|
|
|
display: inline-block;
|
|
|
|
white-space: nowrap;
|
2019-10-10 00:54:56 +08:00
|
|
|
@include b(checkbox-box) {
|
2019-10-11 17:01:23 +08:00
|
|
|
display: inline-block;
|
2019-09-29 16:02:28 +08:00
|
|
|
box-sizing: border-box;
|
2020-02-25 22:32:05 +08:00
|
|
|
vertical-align: bottom;
|
2019-09-29 16:02:28 +08:00
|
|
|
border-radius: 4px;
|
|
|
|
position: relative;
|
2020-02-21 16:48:45 +08:00
|
|
|
transition:
|
|
|
|
box-shadow 0.3s $--n-ease-in-out-cubic-bezier,
|
2019-12-22 15:50:37 +08:00
|
|
|
background-color 0.3s $--n-ease-in-out-cubic-bezier;
|
2019-10-11 17:01:23 +08:00
|
|
|
@include e(line-mark, check-mark) {
|
2019-09-29 16:02:28 +08:00
|
|
|
position: absolute;
|
|
|
|
top: 1px;
|
2019-10-10 00:54:56 +08:00
|
|
|
left: 1px;
|
|
|
|
right: 1px;
|
|
|
|
bottom: 1px;
|
|
|
|
width: calc(100% - 2px);
|
2019-09-29 16:02:28 +08:00
|
|
|
opacity: 0;
|
2019-10-10 00:54:56 +08:00
|
|
|
transform: scale(0.5);
|
2019-09-29 16:02:28 +08:00
|
|
|
transform-origin: center;
|
2020-02-19 22:37:20 +08:00
|
|
|
transition:
|
|
|
|
fill 0.3s $--n-ease-in-out-cubic-bezier,
|
|
|
|
transform 0.3s $--n-ease-in-out-cubic-bezier,
|
2019-12-23 21:40:45 +08:00
|
|
|
opacity 0.3s $--n-ease-in-out-cubic-bezier,
|
|
|
|
border-color 0.3s $--n-ease-in-out-cubic-bezier;
|
2019-09-29 16:02:28 +08:00
|
|
|
}
|
|
|
|
}
|
2019-10-11 17:01:23 +08:00
|
|
|
@include e(label) {
|
2019-12-22 15:50:37 +08:00
|
|
|
transition: color .3s $--n-ease-in-out-cubic-bezier;
|
2019-10-11 17:01:23 +08:00
|
|
|
user-select: none;
|
2019-11-07 22:49:08 +08:00
|
|
|
padding-left: 8px;
|
2019-10-11 17:01:23 +08:00
|
|
|
}
|
|
|
|
@include m(checked) {
|
2019-10-10 00:54:56 +08:00
|
|
|
@include b(checkbox-box) {
|
|
|
|
@include e(check-mark) {
|
2019-09-29 16:02:28 +08:00
|
|
|
opacity: 1;
|
2019-10-10 00:54:56 +08:00
|
|
|
transform: scale(1);
|
2019-09-29 16:02:28 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-10-11 17:01:23 +08:00
|
|
|
@include m(indeterminate) {
|
2019-10-10 00:54:56 +08:00
|
|
|
@include b(checkbox-box) {
|
|
|
|
@include e(check-mark) {
|
2019-09-29 16:02:28 +08:00
|
|
|
opacity: 0;
|
2019-10-10 00:54:56 +08:00
|
|
|
transform: scale(.5);
|
2019-09-29 16:02:28 +08:00
|
|
|
}
|
2019-10-10 00:54:56 +08:00
|
|
|
@include e(line-mark) {
|
2019-09-29 16:02:28 +08:00
|
|
|
opacity: 1;
|
|
|
|
transform: scale(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-10-11 17:01:23 +08:00
|
|
|
@include m(disabled) {
|
|
|
|
cursor: not-allowed;
|
2019-06-27 15:17:16 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-03-06 17:10:12 +08:00
|
|
|
@include as-modal-content {
|
|
|
|
@include b(checkbox) {
|
|
|
|
@include m(table-header) {
|
|
|
|
@include not-m(checked) {
|
|
|
|
@include not-m(indeterminate) {
|
|
|
|
@include not-m(disabled) {
|
|
|
|
@include b(checkbox-box) {
|
|
|
|
background-color: map-get($--checkbox-background-color, 'modal-table');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-09-29 16:02:28 +08:00
|
|
|
@include b(checkbox) {
|
2019-10-11 17:01:23 +08:00
|
|
|
&:hover {
|
|
|
|
@include b(checkbox-box) {
|
2020-02-19 22:37:20 +08:00
|
|
|
box-shadow: inset 0 0 0 1px map-get($--checkbox-border-color, 'active');
|
2019-10-11 17:01:23 +08:00
|
|
|
}
|
2019-09-29 16:02:28 +08:00
|
|
|
}
|
2019-10-11 17:01:23 +08:00
|
|
|
&:focus {
|
|
|
|
@include b(checkbox-box) {
|
2020-02-19 22:37:20 +08:00
|
|
|
box-shadow: inset 0 0 0 1px map-get($--checkbox-border-color, 'active');
|
2019-08-14 19:28:03 +08:00
|
|
|
}
|
2019-10-11 17:01:23 +08:00
|
|
|
}
|
|
|
|
@include b(checkbox-box) {
|
2019-11-08 16:40:53 +08:00
|
|
|
background-color: map-get($--checkbox-background-color, 'default');
|
2020-02-19 22:37:20 +08:00
|
|
|
box-shadow: inset 0 0 0 1px map-get($--checkbox-border-color, 'default');
|
|
|
|
@include e(line-mark, check-mark) {
|
|
|
|
fill: map-get($--checkbox-icon-color, 'default');
|
2019-06-27 15:17:16 +08:00
|
|
|
}
|
2019-09-29 16:02:28 +08:00
|
|
|
}
|
2019-10-12 00:50:34 +08:00
|
|
|
@include e(label) {
|
2019-12-04 18:43:55 +08:00
|
|
|
color: map-get($--checkbox-label-text-color, 'default');
|
2019-10-12 00:50:34 +08:00
|
|
|
}
|
2020-03-06 17:10:12 +08:00
|
|
|
@include m(table-header) {
|
|
|
|
@include b(checkbox-box) {
|
|
|
|
background-color: map-get($--checkbox-background-color, 'table');
|
|
|
|
}
|
|
|
|
}
|
2019-10-11 17:01:23 +08:00
|
|
|
@include m(checked, indeterminate) {
|
|
|
|
&:focus {
|
|
|
|
@include b(checkbox-box) {
|
2020-02-19 22:37:20 +08:00
|
|
|
box-shadow: inset 0 0 0 1px map-get($--checkbox-border-color, 'active'), 0 0 0 2px change-color(map-get($--checkbox-border-color, 'active'), $alpha: .3);
|
2019-10-11 17:01:23 +08:00
|
|
|
}
|
|
|
|
}
|
2019-10-10 00:54:56 +08:00
|
|
|
@include b(checkbox-box) {
|
2020-02-19 22:37:20 +08:00
|
|
|
background-color: map-get($--checkbox-border-color, 'active');
|
|
|
|
box-shadow: inset 0 0 0 1px map-get($--checkbox-border-color, 'active');
|
2020-02-21 16:48:45 +08:00
|
|
|
@include once {
|
|
|
|
border-left: 0;
|
|
|
|
border-top: 0;
|
|
|
|
}
|
2019-09-29 16:02:28 +08:00
|
|
|
}
|
|
|
|
}
|
2019-10-11 17:01:23 +08:00
|
|
|
@include m(disabled) {
|
2019-10-10 00:54:56 +08:00
|
|
|
@include b(checkbox-box) {
|
2019-11-08 16:40:53 +08:00
|
|
|
background-color: map-get($--checkbox-background-color, 'disabled');
|
2020-02-19 22:37:20 +08:00
|
|
|
box-shadow: inset 0 0 0 1px map-get($--checkbox-border-color, 'disabled');
|
|
|
|
@include e(check-mark, line-mark) {
|
|
|
|
fill: map-get($--checkbox-icon-color, 'disabled');
|
2019-09-29 16:02:28 +08:00
|
|
|
}
|
2019-08-14 19:28:03 +08:00
|
|
|
}
|
2019-10-11 17:01:23 +08:00
|
|
|
@include e(label) {
|
2019-12-04 18:43:55 +08:00
|
|
|
color: map-get($--checkbox-label-text-color, 'disabled');
|
2019-10-11 17:01:23 +08:00
|
|
|
}
|
2019-06-13 19:17:41 +08:00
|
|
|
}
|
|
|
|
}
|
2019-10-10 00:54:56 +08:00
|
|
|
}
|