2019-12-04 22:17:59 +08:00
|
|
|
// scss-lint:disable SelectorDepth QualifyingElement
|
|
|
|
|
2019-12-01 04:24:50 +08:00
|
|
|
:root {
|
|
|
|
--sci-checkbox-size: 16px;
|
|
|
|
}
|
|
|
|
|
2020-01-24 22:43:13 +08:00
|
|
|
.sci-checkbox-container {
|
|
|
|
display: inline-block;
|
|
|
|
height: var(--sci-checkbox-size);
|
|
|
|
position: relative;
|
2021-12-01 18:16:45 +08:00
|
|
|
vertical-align: middle;
|
2020-01-24 22:43:13 +08:00
|
|
|
width: var(--sci-checkbox-size);
|
|
|
|
}
|
|
|
|
|
2019-12-01 04:24:50 +08:00
|
|
|
input[type="checkbox"].sci-checkbox {
|
|
|
|
cursor: pointer;
|
|
|
|
flex-shrink: 0;
|
|
|
|
height: var(--sci-checkbox-size);
|
|
|
|
margin: 0;
|
|
|
|
opacity: 0;
|
|
|
|
position: relative;
|
|
|
|
width: var(--sci-checkbox-size);
|
|
|
|
z-index: 2;
|
|
|
|
|
|
|
|
+ .sci-checkbox-label {
|
|
|
|
display: inline-block;
|
|
|
|
flex-shrink: 0;
|
|
|
|
height: var(--sci-checkbox-size);
|
2020-01-14 18:39:15 +08:00
|
|
|
margin-left: calc(var(--sci-checkbox-size) * -1);
|
|
|
|
position: absolute;
|
2022-09-22 17:24:02 +08:00
|
|
|
right: 0;
|
|
|
|
top: 0;
|
2019-12-01 04:24:50 +08:00
|
|
|
width: var(--sci-checkbox-size);
|
|
|
|
|
|
|
|
&::before {
|
2019-12-19 21:18:09 +08:00
|
|
|
@include font-awesome;
|
2019-12-01 04:24:50 +08:00
|
|
|
animation-timing-function: $timing-function-sharp;
|
|
|
|
background: $color-white;
|
2023-09-11 18:03:17 +08:00
|
|
|
border: 1px solid var(--sn-black);
|
2019-12-01 04:24:50 +08:00
|
|
|
border-radius: 1px;
|
|
|
|
color: $color-white;
|
|
|
|
content: "";
|
2019-12-04 22:17:59 +08:00
|
|
|
font-size: calc(var(--sci-checkbox-size) - var(--sci-checkbox-size) * .375);
|
2019-12-01 04:24:50 +08:00
|
|
|
height: var(--sci-checkbox-size);
|
|
|
|
left: 0;
|
|
|
|
line-height: calc(var(--sci-checkbox-size) - 2px);
|
|
|
|
position: absolute;
|
|
|
|
text-align: center;
|
|
|
|
transition: .2s;
|
|
|
|
width: var(--sci-checkbox-size);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
&.hidden + .sci-checkbox-label {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:checked + .sci-checkbox-label {
|
|
|
|
&::before {
|
2023-09-11 18:03:17 +08:00
|
|
|
background-color: var(--sn-science-blue);
|
|
|
|
background-image: image-url("icon_small/sn-check.svg");
|
|
|
|
background-position: center;
|
|
|
|
border: 1px solid var(--sn-science-blue);
|
2019-12-01 04:24:50 +08:00
|
|
|
|
2022-05-11 16:39:51 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-23 20:12:58 +08:00
|
|
|
&:indeterminate + .sci-checkbox-label {
|
|
|
|
&::after {
|
|
|
|
content: '';
|
|
|
|
background: $color-volcano;
|
|
|
|
height: calc(var(--sci-checkbox-size) - 6px);
|
|
|
|
left: 3px;
|
|
|
|
position: absolute;
|
|
|
|
top: 3px;
|
|
|
|
width: calc(var(--sci-checkbox-size) - 6px);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-10-09 17:28:18 +08:00
|
|
|
&:focus {
|
|
|
|
outline: none;
|
|
|
|
outline-offset: 0;
|
|
|
|
}
|
|
|
|
|
2020-03-24 03:02:57 +08:00
|
|
|
&:disabled {
|
|
|
|
cursor: default;
|
|
|
|
|
|
|
|
+ .sci-checkbox-label {
|
|
|
|
&::before {
|
|
|
|
border: $border-tertiary;
|
|
|
|
}
|
2019-12-01 04:24:50 +08:00
|
|
|
}
|
2024-02-06 17:49:04 +08:00
|
|
|
|
|
|
|
&:checked + .sci-checkbox-label {
|
|
|
|
&::before {
|
|
|
|
background-color: var(--sn-sleepy-grey);
|
|
|
|
border: 1px solid var(--sn-sleepy-grey);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2019-12-01 04:24:50 +08:00
|
|
|
}
|
2019-12-04 22:17:59 +08:00
|
|
|
}
|