Files
Spaghet.io/src/pages/legal/[...slug].astro
T
spaghet 9e157a4fa3 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.
2026-11-12 20:48:10 -05:00

37 lines
1.0 KiB
Plaintext

---
export const prerender = true;
import { getCollection } from "astro:content"
import PageLayout from "@layouts/PageLayout.astro"
import TopLayout from "@layouts/TopLayout.astro"
import BottomLayout from "@layouts/BottomLayout.astro"
import { formatDate } from "@lib/utils"
import { SITE } from "@consts"
export async function getStaticPaths() {
const entries = await getCollection("legal")
return entries.map((entry) => ({
params: { slug: entry.id },
props: { entry },
}))
}
const { entry } = Astro.props
const doc = entry
---
<PageLayout title={doc.data.title} description={`${doc.data.title} for ${SITE.TITLE}`}>
<TopLayout>
<div class="animate">
<div class="page-heading">
{doc.data.title}
</div>
<p class="font-normal opacity-75">
Last updated: {formatDate(doc.data.date)}
</p>
</div>
</TopLayout>
<BottomLayout>
<article class="animate prose dark:prose-invert text-ink" set:html={doc.rendered?.html}></article>
</BottomLayout>
</PageLayout>