[PR #2913] [MERGED] docs: Enable automatic theme switching #2932

Closed
opened 2025-12-29 04:19:43 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/2913
Author: @pwuersch
Created: 11/22/2025
Status: Merged
Merged: 11/24/2025
Merged by: @nblock

Base: mainHead: docs/enable-automatic-dark-theme


📝 Commits (1)

  • 633b9e5 docs: Enable automatic theme switching

📊 Changes

1 file changed (+9 additions, -3 deletions)

View changed files

📝 mkdocs.yml (+9 -3)

📄 Description

Hi there 👋

While browsing the docs for headscale, I noticed that the MkDocs theme was not automatically set to my browser's preferred theme. This feature was introduced in mkdocs-material-9.5.0, which is the requested version used by headscale: 72d5fd04a7/docs/requirements.txt (L4)

The code comes directly from the reference in the theme's docs with an added primary: white option set for the light theme (since that's what was there before): https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#automatic-light-dark-mode. Locally tested, it looks exactly like before, just with the default now showing the browser's preferred color scheme.

I chose not to create a discussion issue about this since it's a fairly unopinionated change and already used by many Material for MkDocs sites across the web. Users can still change it to whatever color scheme they prefer manually by clicking on the theme button, which acts as a 3-way switch.

Thank you for considering this small pull request and have a great weekend.

Cheers

PR checklist
  • have read the CONTRIBUTING.md file
  • raised a GitHub issue or discussed it on the projects chat beforehand
  • added unit tests
  • added integration tests
  • updated documentation if needed
  • updated CHANGELOG.md

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/2913 **Author:** [@pwuersch](https://github.com/pwuersch) **Created:** 11/22/2025 **Status:** ✅ Merged **Merged:** 11/24/2025 **Merged by:** [@nblock](https://github.com/nblock) **Base:** `main` ← **Head:** `docs/enable-automatic-dark-theme` --- ### 📝 Commits (1) - [`633b9e5`](https://github.com/juanfont/headscale/commit/633b9e551a2b9d84e2c534e4166da1ce296295d9) docs: Enable automatic theme switching ### 📊 Changes **1 file changed** (+9 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `mkdocs.yml` (+9 -3) </details> ### 📄 Description Hi there :wave: While browsing the docs for headscale, I noticed that the MkDocs theme was not automatically set to my browser's preferred theme. This feature was introduced in [`mkdocs-material-9.5.0`](https://github.com/squidfunk/mkdocs-material/releases/tag/9.5.0), which is the requested version used by headscale: https://github.com/juanfont/headscale/blob/72d5fd04a74fae6ec248aeaf1b8ad8a5c6920375/docs/requirements.txt#L4 The code comes directly from the reference in the theme's docs with an added `primary: white` option set for the light theme (since that's what was there before): https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#automatic-light-dark-mode. Locally tested, it looks exactly like before, just with the default now showing the browser's [preferred color scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-color-scheme). I chose not to create a discussion issue about this since it's a fairly unopinionated change and already used by many Material for MkDocs sites across the web. Users can still change it to whatever color scheme they prefer manually by clicking on the theme button, which acts as a 3-way switch. Thank you for considering this small pull request and have a great weekend. Cheers <details> <summary>PR checklist</summary> - [x] have read the [CONTRIBUTING.md](./CONTRIBUTING.md) file - [ ] ~raised a GitHub issue or discussed it on the projects chat beforehand~ - [ ] ~added unit tests~ - [ ] ~added integration tests~ - [ ] ~updated documentation if needed~ - [ ] ~updated CHANGELOG.md~ </details> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 04:19:43 +01:00
adam closed this issue 2025-12-29 04:19:43 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#2932