2024-03-29 12:56:01 +08:00
|
|
|
/* based on Fomantic UI checkbox module, with just the parts extracted that we use. If you find any
|
|
|
|
unused rules here after refactoring, please remove them. */
|
|
|
|
|
|
|
|
input[type="checkbox"],
|
|
|
|
input[type="radio"] {
|
|
|
|
width: var(--checkbox-size);
|
|
|
|
height: var(--checkbox-size);
|
|
|
|
}
|
|
|
|
|
|
|
|
.ui.checkbox {
|
|
|
|
position: relative;
|
|
|
|
display: inline-block;
|
|
|
|
vertical-align: baseline;
|
|
|
|
min-height: var(--checkbox-size);
|
|
|
|
line-height: var(--checkbox-size);
|
|
|
|
min-width: var(--checkbox-size);
|
|
|
|
padding: 1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ui.checkbox input[type="checkbox"],
|
|
|
|
.ui.checkbox input[type="radio"] {
|
|
|
|
position: absolute;
|
2024-04-09 11:09:43 +08:00
|
|
|
top: 1px;
|
2024-03-29 12:56:01 +08:00
|
|
|
left: 0;
|
|
|
|
width: var(--checkbox-size);
|
|
|
|
height: var(--checkbox-size);
|
|
|
|
}
|
|
|
|
|
|
|
|
.ui.checkbox input[type="checkbox"]:enabled,
|
|
|
|
.ui.checkbox input[type="radio"]:enabled,
|
|
|
|
.ui.checkbox label:enabled {
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ui.checkbox label {
|
|
|
|
cursor: auto;
|
|
|
|
position: relative;
|
|
|
|
display: block;
|
|
|
|
user-select: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ui.checkbox label,
|
|
|
|
.ui.radio.checkbox label {
|
2024-05-06 14:32:05 +08:00
|
|
|
margin-left: 20px;
|
2024-03-29 12:56:01 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.ui.checkbox + label {
|
|
|
|
vertical-align: middle;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ui.disabled.checkbox label,
|
|
|
|
.ui.checkbox input[disabled] ~ label {
|
|
|
|
cursor: default !important;
|
|
|
|
opacity: 0.5;
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ui.radio.checkbox {
|
|
|
|
min-height: var(--checkbox-size);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* "switch" styled checkbox */
|
|
|
|
|
|
|
|
.ui.toggle.checkbox {
|
|
|
|
min-height: 1.5rem;
|
|
|
|
}
|
|
|
|
.ui.toggle.checkbox input {
|
|
|
|
width: 3.5rem;
|
2024-04-17 06:39:19 +08:00
|
|
|
height: 21px;
|
2024-03-29 12:56:01 +08:00
|
|
|
opacity: 0;
|
|
|
|
z-index: 3;
|
|
|
|
}
|
|
|
|
.ui.toggle.checkbox label {
|
|
|
|
min-height: 1.5rem;
|
|
|
|
padding-left: 4.5rem;
|
|
|
|
padding-top: 0.15em;
|
|
|
|
}
|
|
|
|
.ui.toggle.checkbox label::before {
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
content: "";
|
|
|
|
z-index: 1;
|
|
|
|
top: 0;
|
2024-04-17 06:39:19 +08:00
|
|
|
width: 49px;
|
|
|
|
height: 21px;
|
2024-03-29 12:56:01 +08:00
|
|
|
border-radius: 500rem;
|
|
|
|
left: 0;
|
|
|
|
}
|
|
|
|
.ui.toggle.checkbox label::after {
|
|
|
|
background: var(--color-white);
|
2024-04-17 06:39:19 +08:00
|
|
|
box-shadow: 1px 1px 4px 1px var(--color-shadow);
|
2024-03-29 12:56:01 +08:00
|
|
|
position: absolute;
|
|
|
|
content: "";
|
|
|
|
opacity: 1;
|
|
|
|
z-index: 2;
|
2024-04-17 06:39:19 +08:00
|
|
|
width: 18px;
|
|
|
|
height: 18px;
|
|
|
|
top: 1.5px;
|
|
|
|
left: 1.5px;
|
2024-03-29 12:56:01 +08:00
|
|
|
border-radius: 500rem;
|
|
|
|
transition: background 0.3s ease, left 0.3s ease;
|
|
|
|
}
|
|
|
|
.ui.toggle.checkbox input ~ label::after {
|
2024-04-17 06:39:19 +08:00
|
|
|
left: 1.5px;
|
2024-03-29 12:56:01 +08:00
|
|
|
}
|
|
|
|
.ui.toggle.checkbox input:checked ~ label::after {
|
2024-04-17 06:39:19 +08:00
|
|
|
left: 29px;
|
2024-03-29 12:56:01 +08:00
|
|
|
}
|
|
|
|
.ui.toggle.checkbox input:focus ~ label::before,
|
|
|
|
.ui.toggle.checkbox label::before {
|
|
|
|
background: var(--color-input-toggle-background);
|
|
|
|
}
|
|
|
|
.ui.toggle.checkbox label,
|
|
|
|
.ui.toggle.checkbox input:checked ~ label,
|
|
|
|
.ui.toggle.checkbox input:focus:checked ~ label {
|
|
|
|
color: var(--color-text) !important;
|
|
|
|
}
|
|
|
|
.ui.toggle.checkbox input:checked ~ label::before,
|
|
|
|
.ui.toggle.checkbox input:focus:checked ~ label::before {
|
|
|
|
background: var(--color-primary) !important;
|
|
|
|
}
|