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] Default to following the system dark/light mode #7888

Merged
merged 2 commits into from
Oct 10, 2023

Conversation

flying-sheep
Copy link
Contributor

@flying-sheep flying-sheep commented Oct 10, 2023

Summary

This fixes the theme toggle so it has the most useful setting on by default: following the system dark/light mode

See https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#automatic-light-dark-mode

Test Plan

It follows the official docs exactly. If the docs get published for each PR branch, we can also check there if it works as intended.

@flying-sheep flying-sheep changed the title Fix theme toggle [docs] Fix theme toggle Oct 10, 2023
@konstin
Copy link
Member

konstin commented Oct 10, 2023

That is a good idea, unfortunately it doesn't seem to work for me (firefox on ubuntu 22.04). Other tabs change theme, but the ruffs docs don't. I can see the "Linting the CPython codebase from scratch" figure switch themes though so i'm surprised the rest of the page doesn't.

@konstin konstin changed the title [docs] Fix theme toggle [docs] Default to following the system dark/light mode Oct 10, 2023
@flying-sheep
Copy link
Contributor Author

flying-sheep commented Oct 10, 2023

It says the change is only in tag insiders-4.18.0, and the little heart says “sponsors only”.

grafik

I’m not sure how building ruff’s docs works. Does the presence of mkdocs.insiders.yml mean that the docs can be built with and without insiders “mode”?

If that assumption is correct, my change should probably live in the mkdocs.insiders.yml instead.

@charliermarsh
Copy link
Member

@konstin - Just confirming, are you building with insiders locally?

@konstin
Copy link
Member

konstin commented Oct 10, 2023

Nope sorry i missed, i still have to check this with insiders (or someone else with access, i'm currently working on #7873 and would return to this PR later today)

Copy link
Member

@konstin konstin left a comment

Choose a reason for hiding this comment

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

With the insiders version it works, thanks!

@konstin konstin enabled auto-merge (squash) October 10, 2023 15:24
@konstin konstin merged commit d412e8e into astral-sh:main Oct 10, 2023
16 checks passed
@flying-sheep flying-sheep deleted the fix-theme-toggle branch October 10, 2023 21:02
konstin added a commit that referenced this pull request Oct 11, 2023
## Summary

This fixes the theme toggle so it has the most useful setting on by
default: following the system dark/light mode

See
https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#automatic-light-dark-mode

## Test Plan

It follows the official docs exactly. If the docs get published for each
PR branch, we can also check there if it works as intended.

---------

Co-authored-by: konstin <konstin@mailbox.org>
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.

3 participants