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 {
border: 0;
padding: 0;
display: flex;
gap: var(--space-size-xs);
flex-grow: 1;
justify-content: center;
justify-self: flex-end;
legend {
position:absolute;
@ -13,30 +21,41 @@
clip:rect(0 0 0 0);
}
label:has(:not(:checked)) {
color: var(--color-subtle);
}
label {
cursor: pointer;
label:has(:focus-visible) {
outline: 1px solid var(--color-primary);
outline-offset: 2px;
}
&:has(:not(:checked)) {
color: var(--color-disabled);
}
label:has([name="color-scheme"])::before {
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(:focus-visible) {
outline: 1px solid var(--color-primary);
outline-offset: 2px;
}
label:has([name="color-scheme"][value="dark"])::before {
content: "\f186";
}
&:has([name="color-scheme"]) {
label:has([name="color-scheme"][value="light"])::before {
content: "\f185";
&::before {
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-decoration: var(--color-amber-200);
--color-subtle: var(--color-zinc-400);
--color-disabled: var(--color-zinc-600);
}
@media (prefers-color-scheme: light) {
@ -11,6 +12,7 @@
--color-primary: var(--color-neutral-800);
--color-decoration: var(--color-amber-800);
--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-decoration: var(--color-amber-800);
--color-subtle: var(--color-zinc-500);
--color-disabled: var(--color-zinc-400);
}
body[data-color-scheme="dark"] {
@ -26,6 +29,7 @@ body[data-color-scheme="dark"] {
--color-secondary: var(--color-neutral-800);
--color-decoration: var(--color-amber-200);
--color-subtle: var(--color-zinc-400);
--color-disabled: var(--color-zinc-600);
}
body {