Skip to content

docs: respect system colorscheme#10667

Merged
Viicos merged 1 commit intopydantic:mainfrom
NiclasvanEyk:use-system-colorscheme-by-default
Oct 21, 2024
Merged

docs: respect system colorscheme#10667
Viicos merged 1 commit intopydantic:mainfrom
NiclasvanEyk:use-system-colorscheme-by-default

Conversation

@NiclasvanEyk
Copy link
Copy Markdown
Contributor

@NiclasvanEyk NiclasvanEyk commented Oct 20, 2024

Change Summary

Screen.Recording.2024-10-20.at.22.45.41.mov

The left browser window shows the current version of the docs, the right one contains the changes from this PR

This PR makes the docs respect the systems color preference by default. As can be seen in the video, it currently defaults to light mode, even if I've set my OS to dark mode.

This also adds a new option to the theme picker next to the search. This means the cycle is now

  • "auto" (default)
  • "always light"
  • "always dark"

Related issue number

Not an issue, but the dark mode seems to have been introduced in #2913. The convention that the button icon and alt text reflects the action instead of the current state is retained. The latest comment on the referenced PR also indicates that other users also expect the systems color preference to be the default.

Other Related Things

Here is a link to the docs of Mkdocs Material, where they describe the automatic dark/light mode: https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#automatic-light-dark-mode

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Tests pass on CI
  • Documentation reflects the changes where applicable
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

Selected Reviewer: @sydney-runkle

The docs now use the systems color preference by default. A new third
option was added to the theme picker, which automatically adjusts the
light/dark mode.
@github-actions github-actions Bot added the relnotes-fix Used for bugfixes. label Oct 20, 2024
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Oct 20, 2024

CodSpeed Performance Report

Merging #10667 will not alter performance

Comparing NiclasvanEyk:use-system-colorscheme-by-default (9735149) with main (06a04b5)

Summary

✅ 44 untouched benchmarks

@github-actions
Copy link
Copy Markdown
Contributor

Coverage report

This PR does not seem to contain any modification to coverable code.

@NiclasvanEyk
Copy link
Copy Markdown
Contributor Author

please review

Copy link
Copy Markdown
Member

@Viicos Viicos left a comment

Choose a reason for hiding this comment

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

Thanks for adding the video example. This looks good

@Viicos Viicos merged commit 220b2f6 into pydantic:main Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants