rsnext/examples/blog-starter/src
Mayank 4e9b405c4c
Example/update blog starter (#66926)
What?

Updated blog-starter example to support dark theme. Also added a button
to switch modes (User preference).

→ User can opt for dark / light / system mode
→ Mode is persisted using localStorage
→ Mode is also synced across browsing contexts
→ No FOUC (Flash of Unstyled Content)
→ Full SSG
→ No additional dependency

Why?

Now that dark mode is a first-class feature of many operating systems,
it’s becoming more and more common to design a dark version of your
website to go along with the default design.

How?

- Used tailwind `dark:` modifier
- Used localStorage for persisting user's preference
- Used storage event to sync the mode across tabs/iframes
- Injected script to avoid FOUC
- Added appropriate comments in the code for clarity and readability
2024-06-23 01:19:09 -07:00
..
app Example/update blog starter (#66926) 2024-06-23 01:19:09 -07:00
interfaces Update blog-starter to App Router (#61170) 2024-01-30 17:16:55 +00:00
lib Update blog-starter to App Router (#61170) 2024-01-30 17:16:55 +00:00