center the colour picker

This commit is contained in:
Lewis Dale 2023-09-26 20:53:42 +01:00
parent f213a499e2
commit 74ddce603a
2 changed files with 44 additions and 21 deletions

View File

@ -1,7 +1,15 @@
header > * {
flex-grow: 1;
}
.color-scheme { .color-scheme {
border: 0; border: 0;
padding: 0;
display: flex; display: flex;
gap: var(--space-size-xs); gap: var(--space-size-xs);
flex-grow: 1;
justify-content: center;
justify-self: flex-end;
legend { legend {
position:absolute; position:absolute;
@ -13,30 +21,41 @@
clip:rect(0 0 0 0); clip:rect(0 0 0 0);
} }
label:has(:not(:checked)) { label {
color: var(--color-subtle); cursor: pointer;
}
label:has(:focus-visible) { &:has(:not(:checked)) {
outline: 1px solid var(--color-primary); color: var(--color-disabled);
outline-offset: 2px; }
}
label:has([name="color-scheme"])::before { &:has(:focus-visible) {
font-family: "font awesome 6 free"; outline: 1px solid var(--color-primary);
font-style: normal; outline-offset: 2px;
font-variant: normal; }
text-rendering: auto;
font-weight: 900;
-webkit-font-smoothing: antialiased;
font-size: var(--text-size-s);
}
label:has([name="color-scheme"][value="dark"])::before { &:has([name="color-scheme"]) {
content: "\f186";
}
label:has([name="color-scheme"][value="light"])::before { &::before {
content: "\f185"; font-family: "font awesome 6 free";
font-style: normal;
font-variant: normal;
text-rendering: auto;
font-weight: 900;
-webkit-font-smoothing: antialiased;
font-size: var(--text-size-s);
}
&:has([value="dark"]) {
&::before {
content: "\f186";
}
}
&:has([value="light"]) {
&::before {
content: "\f185";
}
}
}
} }
} }

View File

@ -3,6 +3,7 @@
--color-secondary: var(--color-neutral-800); --color-secondary: var(--color-neutral-800);
--color-decoration: var(--color-amber-200); --color-decoration: var(--color-amber-200);
--color-subtle: var(--color-zinc-400); --color-subtle: var(--color-zinc-400);
--color-disabled: var(--color-zinc-600);
} }
@media (prefers-color-scheme: light) { @media (prefers-color-scheme: light) {
@ -11,6 +12,7 @@
--color-primary: var(--color-neutral-800); --color-primary: var(--color-neutral-800);
--color-decoration: var(--color-amber-800); --color-decoration: var(--color-amber-800);
--color-subtle: var(--color-zinc-500); --color-subtle: var(--color-zinc-500);
--color-disabled: var(--color-zinc-400);
} }
} }
@ -19,6 +21,7 @@ body[data-color-scheme="light"] {
--color-primary: var(--color-neutral-800); --color-primary: var(--color-neutral-800);
--color-decoration: var(--color-amber-800); --color-decoration: var(--color-amber-800);
--color-subtle: var(--color-zinc-500); --color-subtle: var(--color-zinc-500);
--color-disabled: var(--color-zinc-400);
} }
body[data-color-scheme="dark"] { body[data-color-scheme="dark"] {
@ -26,6 +29,7 @@ body[data-color-scheme="dark"] {
--color-secondary: var(--color-neutral-800); --color-secondary: var(--color-neutral-800);
--color-decoration: var(--color-amber-200); --color-decoration: var(--color-amber-200);
--color-subtle: var(--color-zinc-400); --color-subtle: var(--color-zinc-400);
--color-disabled: var(--color-zinc-600);
} }
body { body {