Skip to content
SprecherEast
Issue 225

bug: Rich text follows the computer's dark mode, not the site's theme

Back to our plan
Done
bugfrontendpriority: medium

Type

bug

Summary

Rich text follows the computer's light/dark setting instead of the site's theme, so links can be unreadable.

Problem

Tailwind v4's dark: variant uses prefers-color-scheme by default, and globals.css doesn't redefine it. The site's theme is data-theme on <html>. RichText (src/components/RichText/index.tsx:73) uses dark:prose-invert, so:

  • site dark, computer light: prose isn't inverted. On /contact, the "Other Ways to Connect" links are dark navy on near-black and can't be read (found in the review of #223).
  • site light, computer dark: prose is inverted on a light page.

Proposed fix

Add @custom-variant dark (&:where([data-theme='dark'], [data-theme='dark'] *)); to globals.css, so every dark: utility follows data-theme. Check the prose colours in both themes. It's the only dark: utility left once #223 merges.

Acceptance criteria

  • Not done: With the site set to dark and the computer set to light (and the reverse), rich-text body and links on /contact, a post and an event meet 4.5:1.
  • Not done: Screenshots at 320 and 1280 px in all four combinations.

Area

frontend

Priority

medium


Generated by Claude Code, opens in a new tab

See it on GitHub, opens in a new tab