ui-lib/lib/ui/css/checkbox.scss
Tsanie Lily 5baf00de64
add: getText compatibility.
add: `AssetSelector` and `TemplateSelector`.
add: `popup-selector` style class.
add: `ui.resolvePopup` function.
add: `switch` in checkbox.
add: `GridColumn.filterTemplate` supports.
add: add `action` callback in `createIcon`.
change: replace `setTimeout(..., 0)` with `requestAnimationFrame`.
change: Popup result structure adjustment ({ result: any, popup: Popup }).
change: complete add work order flow.
change: reduce Popup title height.
fix: Grid column sort in number.
2024-06-21 17:28:11 +08:00

115 lines
2.3 KiB
SCSS

@import "./functions/func.scss";
.ui-check-image-wrapper {
>input[type="checkbox"] {
display: none;
&:checked {
~.checked {
display: inline;
}
~.unchecked {
display: none;
}
}
}
>.checked {
display: none;
}
>.unchecked {
display: inline;
}
}
.ui-check-wrapper {
display: inline-flex;
align-items: center;
padding: 0 8px;
height: 36px;
@include ui-check();
.ui-check-inner {
flex: 0 0 auto;
+* {
flex: 1 1 auto;
font-weight: 400;
font-size: var(--font-size);
padding-left: 8px;
padding-right: 6px;
align-self: center;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
cursor: pointer;
color: var(--color);
}
}
}
.ui-switch {
line-height: 1rem;
user-select: none;
cursor: pointer;
&.disabled {
cursor: default;
}
>span:first-of-type {
display: inline-flex;
align-items: center;
position: relative;
&::before {
content: '';
width: 30px;
min-width: 30px;
max-width: 30px;
height: 16px;
margin-right: 4px;
background-color: var(--switch-bg-color);
border-radius: 8px;
transition: background-color .08s ease;
}
&::after {
content: '';
position: absolute;
left: 1px;
top: calc(50% - 7px);
width: 14px;
height: 14px;
background-color: white;
border-radius: 7px;
box-shadow: 1px 1px 8px rgb(0 0 0 / 20%);
transition: left .08s ease;
}
}
>input[type="checkbox"] {
display: none;
&:checked+span:first-of-type {
&::before {
background-color: var(--switch-active-bg-color);
}
&::after {
left: 15px;
}
}
&:disabled+span:first-of-type {
cursor: default;
&::before {
opacity: .3;
}
}
}
}