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

style(docs): color-scheme reflects theme #1874

Merged
merged 1 commit into from
Dec 30, 2023
Merged

style(docs): color-scheme reflects theme #1874

merged 1 commit into from
Dec 30, 2023

Conversation

metonym
Copy link
Collaborator

@metonym metonym commented Dec 30, 2023

A couple of minor UX improvements regarding the theme:

  1. Synchronously initialize the persisted theme to avoid a flash-of-unstyled-theme (FOUT).
  2. Set :root { color-scheme: 'light' | 'dark' } based on the selected theme. One nicety is that this can style the browser scrollbar based on the scheme. For example, a dark Carbon theme should suggest to the browser to apply dark-themed scrollbars (see screenshot).

A small refactor includes using URLSearchParams to more reliably parse the theme key/value from the URL.


Screenshot 2023-12-30 at 10 24 14 AM

@metonym metonym merged commit 1600775 into master Dec 30, 2023
3 checks passed
@metonym metonym deleted the docs-color-scheme branch December 30, 2023 18:35
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.

1 participant