forked from external-repos/squoosh
Provides better keyboard accessibility for: * Checkboxes * Range Inputs * Copy-over Buttons * Option-reveal Elements Along with some minor design improvements
47 lines
740 B
CSS
47 lines
740 B
CSS
.checkbox {
|
|
display: inline-block;
|
|
position: relative;
|
|
--size: 17px;
|
|
|
|
&::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 50%;
|
|
left: 50%;
|
|
width: 200%;
|
|
height: 200%;
|
|
background-color: var(--main-theme-color);
|
|
border-radius: 999px;
|
|
opacity: 0.25;
|
|
|
|
transform: translate(-50%, -50%) scale(0);
|
|
transition-property: transform;
|
|
transition-duration: 250ms;
|
|
}
|
|
|
|
&:focus-within::before {
|
|
transform: translate(-50%, -50%) scale(1);
|
|
}
|
|
}
|
|
|
|
.real-checkbox {
|
|
top: 0;
|
|
position: absolute;
|
|
opacity: 0;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.icon {
|
|
display: block;
|
|
width: var(--size);
|
|
height: var(--size);
|
|
}
|
|
|
|
.checked {
|
|
fill: var(--main-theme-color);
|
|
}
|
|
|
|
.disabled {
|
|
fill: var(--dark-gray);
|
|
}
|