Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example/update blog starter #66926

Merged
merged 24 commits into from
Jun 23, 2024
Merged

Conversation

mayank1513
Copy link
Contributor

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

@mayank1513 mayank1513 requested review from a team as code owners June 16, 2024 07:48
@mayank1513 mayank1513 requested review from ismaelrumzan and timeyoutakeit and removed request for a team June 16, 2024 07:48
@ijjk ijjk added the examples Issue/PR related to examples label Jun 16, 2024
@ijjk
Copy link
Member

ijjk commented Jun 16, 2024

Allow CI Workflow Run

  • approve CI run for commit: ac779c9

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@ijjk
Copy link
Member

ijjk commented Jun 16, 2024

Allow CI Workflow Run

  • approve CI run for commit: 796de3e

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

@mayank1513 mayank1513 force-pushed the example/update-blog-starter branch 3 times, most recently from 425a4aa to 52b7ed5 Compare June 20, 2024 18:35
@samcx samcx added the CI approved Approve running CI for fork label Jun 22, 2024
@samcx
Copy link
Member

samcx commented Jun 22, 2024

@mayank1513 Let me know when this ready for :approved: :blob_bowing:

@mayank1513
Copy link
Contributor Author

@mayank1513 Let me know when this ready for :approved: :blob_bowing:

I think this is ready for review/merge.

@samcx
Copy link
Member

samcx commented Jun 22, 2024

@mayank1513 Can you update the packages as well (e.g., latest :nextjs: canary)?

@mayank1513
Copy link
Contributor Author

Done sir! Thank you for pointing out.

@samcx samcx merged commit 4e9b405 into vercel:canary Jun 23, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI approved Approve running CI for fork examples Issue/PR related to examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants