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

Dark-mode styling #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Dark-mode styling #13

wants to merge 1 commit into from

Conversation

irsyadpage
Copy link
Contributor

User that has prefers-color-scheme as dark will automatically see the dark mode version.

I override color only when neccessary to keep the changes as minimal as possible. The shade schemes are selected based on the original shade. As an example, original font color for body is darker than a, and a is darker than a:hover. Hence, in dark-mode, I used opposite shade: body is brighter than a, and a is brighter than a:hover.

Although .copy-button has color property, I don't override this color since there is no text in the element. If text would be included in the future, the following properties could be add:

@media (prefers-color-scheme: dark) {
  .copy-button {
    color: #fff;
  }
}

Copy link

vercel bot commented Feb 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unduck ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 16, 2025 8:34am

Copy link

@okunamayanad okunamayanad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! This is definitely needed as it flashes all white when searching for a split second for dark mode users. This fixed the flashing issue for me.

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

Successfully merging this pull request may close these issues.

2 participants