remix-run / react-router-website

The React Router website
https://reactrouter.com
MIT License
149 stars 33 forks source link

fix: pre/code links don't change color when :active in dark mode #111

Closed kisaragi-hiu closed 1 week ago

kisaragi-hiu commented 1 month ago

...unlike normal links in dark mode, or both types of links in light mode.

Inline code link, before (hover & active) Inline code link, after (hover & active)
20240602T052818+0900 20240602T052748+0900
Normal link (hover & active) Inline code link, light mode (hover & active)
20240602T052843+0900 20240602T053409+0900

(Test page: route/route)

This is the same issue as https://github.com/remix-run/remix-website/pull/262: the dark mode plain color rule has higher specificity than the text-inherit rule, so dark:inherit is needed to allow the :active color to continue to be applied. In this case it is more subtle (which is why I initially though there is no problem here), as links are still distinguishable as links.