style(next): refactor

This commit is contained in:
Adorian Doran 2025-01-17 01:06:25 +02:00
parent 2773d560b9
commit 4c84bc724d

View File

@ -188,12 +188,15 @@ optgroup {
/* The parent label */ /* The parent label */
label:has(input[type="radio"]), label:has(input[type="radio"]),
label:has(input[type="checkbox"]) { label:has(input[type="checkbox"]) {
--box-size: 1em;
--box-label-gap: .5em;
position: relative; position: relative;
} }
label:has(input[type="radio"]), label:has(input[type="radio"]),
label:has(input[type="checkbox"]) { label:has(input[type="checkbox"]) {
padding-left: 1.5em !important; padding-left: calc(var(--box-size) + var(--box-label-gap)) !important;
} }
/* The original input */ /* The original input */
@ -202,7 +205,7 @@ label > input[type="checkbox"] {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; left: 0;
width: 1em; width: var(--box-size);
height: 100%; height: 100%;
opacity: 0; opacity: 0;
} }
@ -216,8 +219,8 @@ label:has(input[type="checkbox"])::after {
top: 50%; top: 50%;
left: 0; left: 0;
translate: 0 -50%; translate: 0 -50%;
width: 1em; width: var(--box-size);
height: 1em; height: var(--box-size);
} }
label:has(input[type="radio"]:focus-visible)::before, label:has(input[type="radio"]:focus-visible)::before,