Add support for light mode - #85
Conversation
9615843 to
51fc803
Compare
51fc803 to
e95445e
Compare
|
Is anybody available for a review? |
|
It needs some improvements. I'll make them and merge soon. Thanks! |
|
Of course. I used Codex so that's natural. I look forward to see your changes. And thanks again |
|
@nunowar why do we need light mode tho? |
That's a good question. Personally, I don't miss this feature, but some people prefer reading in light mode, especially on documentation pages. We can add it soon, but I want to do it properly and keep the PEST brand strong and consistent across both modes... |
|
Because there are a lot of people, like me, who find it very hard to read in dark mode. I personally cannot look at a dark mode site for more than 30 seconds before my eyes get blurry. |
|
It's about usability. The same reason we have keyboard shortcuts, add alt text, and use aria attributed. |
This PR adds a theme switcher and supports for light mode. The default is still dark mode though. It has been done with the help of Codex AI.
CSS variables have been added for both dark and light mode and used throughout.
The logos in the Community section on the homepage have been left unaltered, as I would have had to research each company to understand how to correctly display their logo in light mode.
By default the syntax highlight themes are
draculafor dark mode andgithub-lightfor light mode. They can be customised by theTORCHLIGHT_DARK_THEMEandTORCHLIGHT_LIGHT_THEMEenv variables.For reference I have attached the plan I and Codex followed and the audit file used during the plan.
LIGHT_MODE_PLAN.md
LIGHT_MODE_AUDIT.md
Questions for the reviewer(s)
dark:class modifier. If you prefer using the Tailwind classes directly I can have a go at converting something likebg-[var(--theme-bg)]tobg-white dark:bg-zinc-900