Use text-shadow to mark which colour scheme is active

This commit is contained in:
Lewis Dale 2023-09-27 09:09:28 +01:00
parent a950d1423d
commit ad751e11f5
2 changed files with 27 additions and 20 deletions

View File

@ -28,35 +28,39 @@ header > * {
color: var(--color-disabled); color: var(--color-disabled);
} }
&:has(:focus-visible) { &:has(:focus-visible) {
outline: 1px solid var(--color-primary); outline: 1px solid var(--color-primary);
outline-offset: 4px; outline-offset: 4px;
border-radius: 5%; border-radius: 5%;
} }
&: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([value="dark"]) {
&::before { &::before {
font-family: "font awesome 6 free"; content: "\f186";
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"]) { &:has([value="light"]) {
&::before { &::before {
content: "\f186"; content: "\f185";
}
} }
}
&:has([value="light"]) { &:has(:checked)::before {
&::before { text-shadow: var(--color-decoration) 1px 0 10px;
content: "\f185"; }
}
}
}
} }
} }

View File

@ -10,16 +10,18 @@
:root { :root {
--color-secondary: var(--color-neutral-100); --color-secondary: var(--color-neutral-100);
--color-primary: var(--color-neutral-800); --color-primary: var(--color-neutral-800);
--color-decoration: var(--color-amber-800); --color-decoration: var(--color-yellow-400);
--color-subtle: var(--color-zinc-500); --color-subtle: var(--color-zinc-500);
--color-disabled: var(--color-neutral-600);
} }
} }
body[data-color-scheme="light"] { body[data-color-scheme="light"] {
--color-secondary: var(--color-neutral-100); --color-secondary: var(--color-neutral-100);
--color-primary: var(--color-neutral-800); --color-primary: var(--color-neutral-800);
--color-decoration: var(--color-amber-800); --color-decoration: var(--color-yellow-400);
--color-subtle: var(--color-zinc-500); --color-subtle: var(--color-zinc-500);
--color-disabled: var(--color-neutral-600);
} }
body[data-color-scheme="dark"] { body[data-color-scheme="dark"] {
@ -27,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-neutral-400);
} }
body { body {