feat(docs): slate dark theme and contrast fixes #328
No reviewers
Labels
No labels
bug
discussion
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gram-lang/gram!328
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/docs-slate-dark-theme"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Reworks the docs site's dark theme and fixes the contrast issues found along the way.
Dark theme: bistro slate
#1c1c1b), chalk-colored text and the Gram orange kept for accents.#f2efe8instead of pure white: 14.9:1 instead of 17.3:1, no more halation on the dark ground.--gram-code-bg), their title bars and tabs one step above (--gram-code-chrome).Theme logic in one place
src/lib/theme.ts: storage key, parsing, resolution and the inline anti-flash script, shared byLayout.astroandThemeSelect.astroinstead of three copies. Default staysauto; Starlight's storage contract is unchanged, so existing choices carry over.Contrast fixes
#3a3836patch (8.2:1, 68% of the body text contrast) to an outlined#2a2927chip (10.2:1).--gram-on-accenttoken, 8.1:1 instead of light text at 2.1:1.#ad5600(5.1:1 on white, was 2.3:1); link hover follows.src/lib/shiki-themes.ts) and applied throughastro.config.mjs(~10:1, was ~3.8:1). The playground still loads its theme lazily.Tests
src/styles/contrast.test.tsreadsglobal.cssand checks every text pair a reader meets, in both themes: WCAG AA (4.5:1) everywhere, dark text under 15:1, inline code keeping at least 80% of the body text contrast, primary button text at rest and on hover.src/lib/theme.test.tschecks the inline script and the theme helpers agree across 12 stored/OS combinations.Checks
bun testinpackages/docs: 155 pass.bun run typecheck: 0 errors.astro buildchecked: comment color and inline code token present in the output.