Files
mkdocs/mkdocs.yml
Waylan Limberg a836155549 Add support for a 'dark mode' to mkdocs theme
Also add an optional toggle button for it.

Three new config options have been added:

1. 'color_mode' which can be set to one of 'light', 'dark', or 'auto'.
   Default is 'light' for backward compatability. The 'auto' color mode
   will check the system settings and automaticaly switch to light or
   dark mode on page load or when the system's color mode changes.
2. 'hljs_style_dark': the Highlight.js theme to use in 'dark_mode'.
   Default is 'github-dark' which matches the light mode default of
   'github'. The preexisting config option 'hljs_style' is used for
   'light' mode.
3. 'user_color_mode_toggle':
   Allow users to select their prefered color mode (light, dark, auto) from
   within the browser and save their preference for future page loads. The
   new config option 'user_color_mode_toggle' (default: 'False') can be
   enabled to display a toggle menu in the nav bar. The default value of the
   toggle menu on first load is the value set to 'color_mode'.

MkDocs' own documentation is now configured with 'color_mode: auto'.

Co-authored-by: Oleh Prypin <oleh@pryp.in>
2024-03-16 15:16:48 +01:00

80 lines
1.7 KiB
YAML

site_name: MkDocs
site_url: https://www.mkdocs.org/
site_description: Project documentation with Markdown.
site_author: MkDocs Team
repo_url: https://github.com/mkdocs/mkdocs/
edit_uri: blob/master/docs/
theme:
name: mkdocs
color_mode: auto
user_color_mode_toggle: true
locale: en
analytics: {gtag: 'G-274394082'}
highlightjs: true
hljs_languages:
- yaml
- django
nav:
- Home: index.md
- Getting Started: getting-started.md
- User Guide: user-guide/
- Developer Guide: dev-guide/
- About:
- Release Notes: about/release-notes.md
- Contributing: about/contributing.md
- License: about/license.md
extra_css:
- css/extra.css
exclude_docs: |
*.py
markdown_extensions:
- toc:
permalink:
- attr_list
- def_list
- tables
- pymdownx.highlight:
use_pygments: false
- pymdownx.snippets
- pymdownx.superfences
- callouts
- mdx_gh_links:
user: mkdocs
repo: mkdocs
- mkdocs-click
copyright: Copyright &copy; 2014 <a href="https://twitter.com/starletdreaming">Tom Christie</a>, Maintained by the <a href="/about/release-notes/#maintenance-team">MkDocs Team</a>.
hooks:
- docs/hooks.py
plugins:
- search
- redirects:
redirect_maps:
user-guide/plugins.md: dev-guide/plugins.md
user-guide/custom-themes.md: dev-guide/themes.md
user-guide/styling-your-docs.md: user-guide/choosing-your-theme.md
- autorefs
- literate-nav:
nav_file: README.md
implicit_index: true
- mkdocstrings:
handlers:
python:
options:
docstring_section_style: list
members_order: source
show_root_heading: true
show_source: false
show_signature_annotations: true
watch:
- mkdocs