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

docs: respect system colorscheme #10667

Merged

Conversation

NiclasvanEyk
Copy link
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

Sorry, something went wrong.

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
Copy link

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

Copy link
Contributor

Coverage report

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

@NiclasvanEyk
Copy link
Contributor Author

please review

Copy link
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
59 checks passed
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.

None yet

3 participants