Extract generic .checkbox from .step__checkbox

This commit is contained in:
Alexander Zaytsev
2026-03-05 18:06:10 +01:00
parent 615ac948c8
commit 932d40878f
6 changed files with 41 additions and 38 deletions
+37
View File
@@ -314,4 +314,41 @@
margin: 0;
}
}
/* Checkboxes */
.checkbox {
appearance: none;
background-color: var(--color-canvas);
block-size: 1.1em;
border: 1px solid currentColor;
border-radius: 0.15em;
color: currentColor;
display: grid;
font: inherit;
inline-size: 1.1em;
margin: 0;
place-content: center;
transform: translateY(0.1em);
&::before {
background-color: CanvasText;
block-size: 0.65em;
box-shadow: inset 1em 1em currentColor;
clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
content: "";
inline-size: 0.65em;
transform: scale(0);
transform-origin: center;
transition: 150ms transform ease-in-out;
}
&:checked::before {
transform: scale(1) rotate(10deg);
}
&:where([disabled]):not(:hover):not(:active) {
filter: none;
opacity: 0.5;
}
}
}
-34
View File
@@ -8,40 +8,6 @@
.step__checkbox {
--hover-color: var(--card-color);
appearance: none;
background-color: var(--color-canvas);
block-size: 1.1em;
border: 1px solid currentColor;
border-radius: 0.15em;
color: currentColor;
display: grid;
font: inherit;
inline-size: 1.1em;
margin: 0;
place-content: center;
transform: translateY(0.1em);
&::before {
background-color: CanvasText;
block-size: 0.65em;
box-shadow: inset 1em 1em currentColor;
clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
content: "";
inline-size: 0.65em;
transform: scale(0);
transform-origin: center;
transition: 150ms transform ease-in-out;
}
&:checked::before {
transform: scale(1) rotate(10deg);
}
&:where([disabled]):not(:hover):not(:active) {
filter: none;
opacity: 0.5;
}
}
.step__content {