Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Add ability for user to view website in dark mode. #63

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

damiensedgwick
Copy link
Contributor

This PR adds the ability for a user to choose to display the website in dark mode by using the toggle that has been placed in the right hand side of the navigation bar.

This is made possible as tailwind includes a dark: prefix that can be applied to elements in the html markup once a class of dark has been applied to an outer most element, in this case the Layout wrapper. This change is then stored in localStorage as a preference so that it is persisted the next time the user visits the website.

I also added a couple of components as when displaying mdx pages in dark mode, header tags were not picking up the correct colours and neither was text encapsulated in back-ticks. For some reason, a code element component did not fix the back-ticked examples and I fond the easiest solution was to simply escape each back-tick so that it picked up the styling correctly.

You can see the change working below.

pr

@vercel
Copy link

vercel bot commented Aug 8, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/mattpocock/xstate-catalogue/48KUdPCf1VLmBoG8wWAAvvt1KSw7
✅ Preview: https://xstate-catalogue-git-fork-damiensedgwick-feat-891d4b-mattpocock.vercel.app

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant