Add better styling for checkboxes to make them more distinct
This commit is contained in:
parent
08fb6768ad
commit
daa88fb272
3 changed files with 59 additions and 0 deletions
|
|
@ -3,4 +3,54 @@
|
||||||
--input-height: 2.5rem;
|
--input-height: 2.5rem;
|
||||||
font-size: 1.75rem;
|
font-size: 1.75rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&[type="checkbox"] {
|
||||||
|
--checkbox-checked-color: var(--color-warm-1);
|
||||||
|
width: var(--checkbox-size);
|
||||||
|
height: var(--checkbox-size);
|
||||||
|
background: var(--input-background-color);
|
||||||
|
border: 2px solid var(--color-cool-3);
|
||||||
|
position: relative;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
&::before, &::after {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:focus-visible {
|
||||||
|
outline: 2px solid var(--checkbox-checked-color);
|
||||||
|
outline-offset: 3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:checked::after {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
inset: 4px;
|
||||||
|
z-index: 1;
|
||||||
|
content: "";
|
||||||
|
border-radius: 4px;
|
||||||
|
background: var(--checkbox-checked-color);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:disabled {
|
||||||
|
opacity: 0.5;
|
||||||
|
cursor: not-allowed;
|
||||||
|
|
||||||
|
&::before {
|
||||||
|
display: block;
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
content: "";
|
||||||
|
background: var(--color-level-error-bg);
|
||||||
|
border-radius: 2px;
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
cursor: not-allowed;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
/* Resets */
|
/* Resets */
|
||||||
@import url("./resets/hr.css") layer(resets);
|
@import url("./resets/hr.css") layer(resets);
|
||||||
|
@import url("./resets/inputs.css") layer(resets);
|
||||||
|
|
||||||
/* Themes */
|
/* Themes */
|
||||||
@import url("./themes/dark.css") layer(themes);
|
@import url("./themes/dark.css") layer(themes);
|
||||||
|
|
|
||||||
8
styles/resets/inputs.css
Normal file
8
styles/resets/inputs.css
Normal file
|
|
@ -0,0 +1,8 @@
|
||||||
|
.taf > .window-content {
|
||||||
|
input[type="checkbox"] {
|
||||||
|
all: initial;
|
||||||
|
&::after, &::before {
|
||||||
|
all: initial;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue