feat(theme): implement dual light/dark colour token system with WCAG AA contrast
Replace hard-coded hex values and ad-hoc `dark:` variants with a single
semantic token layer in `src/styles/global.css` (`@theme` + `html.dark`
re-declaration), so every component uses the same Tailwind class list in
both modes.
Key changes:
- Define semantic tokens (page, surface, ink, accent, edge, etc.) and raw
ingredient palette (--color-spaghetti-*, --color-marinara*, etc.)
- Configure dual Shiki themes (light-plus / everforest-dark) with
`defaultColor: false` for proper per-mode code block colours, replacing
the old `.prose pre { #1f2937 !important }` hack
- Tint background particles to match the warm cream/espresso palette
instead of pure black dots
- Document theme rules: add tokens not `dark:` variants, keep colour rules
inside `@layer`, never target Tailwind utility classes with unlayered
overrides, route prose colours through `--tw-prose-*` only
All text and interactive elements meet WCAG AA contrast (4.5:1 body, 3:1
large/interactive). Light mode is a warm cream plate with white cards; dark
mode is espresso (#140C08) with raised cards.
This commit is contained in:
1 parent
8b6be36f7a
commit
9e157a4fa3
23 files changed
+544
-373
No files matched your search
@@ -134,16 +134,16 @@ export default function Search(props: Props) {
|
||||
autocomplete="off"
|
||||
spellcheck={false}
|
||||
placeholder="What are you looking for?"
|
||||
class="w-full px-2.5 py-1.5 pl-10 rounded outline-none text-spaghetti-brown bg-spaghetti-yellow/20 dark:bg-spaghetti-yellow/20 border border-spaghetti-yellow/50 dark:border-spaghetti-yellow/50 focus:border-spaghetti-red focus:dark:border-spaghetti-red"
|
||||
class="w-full px-2.5 py-1.5 pl-10 rounded outline-none text-ink bg-chip border border-edge focus:border-link"
|
||||
/>
|
||||
<svg class="absolute size-6 left-1.5 top-1/2 -translate-y-1/2 stroke-current">
|
||||
<use href={`/ui.svg#search`}/>
|
||||
</svg>
|
||||
</form>
|
||||
{error() && <div class="mt-4 text-red-500">{error()}</div>}
|
||||
{error() && <div class="mt-4 text-status-down">{error()}</div>}
|
||||
{loading() && <div class="mt-4">Searching...<span class="ml-2 animate-spin">⏳</span></div>}
|
||||
{!loading() && !error() && !searched() && query().trim().length > 0 && query().trim().length < MIN_QUERY_LENGTH && (
|
||||
<div class="mt-4 text-sm uppercase text-spaghetti-brown/70 dark:text-spaghetti-dark-cream/70">
|
||||
<div class="mt-4 text-sm uppercase text-ink-muted">
|
||||
Keep typing — search needs at least {MIN_QUERY_LENGTH} characters
|
||||
</div>
|
||||
)}
|
||||
@@ -152,7 +152,7 @@ export default function Search(props: Props) {
|
||||
<div class="text-sm uppercase mb-2">
|
||||
No results for {`'${query()}'`}
|
||||
</div>
|
||||
<div class="text-sm text-spaghetti-brown/70 dark:text-spaghetti-dark-cream/70">
|
||||
<div class="text-sm text-ink-muted">
|
||||
Try a shorter or more general keyword — titles, tags and summaries are all searchable.
|
||||
</div>
|
||||
</div>
|
||||
@@ -164,7 +164,7 @@ export default function Search(props: Props) {
|
||||
</div>
|
||||
<div class="flex flex-col gap-6 mt-4">
|
||||
{results().posts.length > 0 && (
|
||||
<div class="border-t border-spaghetti-yellow/30 pt-4">
|
||||
<div class="border-t border-line pt-4">
|
||||
<div class="text-sm font-bold mb-2">Blog Posts</div>
|
||||
<ul class="flex flex-col gap-3">
|
||||
{results().posts.map(result => (
|
||||
@@ -176,7 +176,7 @@ export default function Search(props: Props) {
|
||||
</div>
|
||||
)}
|
||||
{results().projects.length > 0 && (
|
||||
<div class="border-t border-spaghetti-yellow/30 pt-4">
|
||||
<div class="border-t border-line pt-4">
|
||||
<div class="text-sm font-bold mb-2">Projects</div>
|
||||
<ul class="flex flex-col gap-3">
|
||||
{results().projects.map(result => (
|
||||
|
||||
Reference in new issue
Block a user