-
Notifications
You must be signed in to change notification settings - Fork 27
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
Toggle between dark and light palette doesn't work #47
Comments
Thank you for your contribution! This is very appreciated. |
Thanks a lot. Could you also describe
|
Here is the anomaly - color of diagrams doesn't change on dark theme switch: |
As mentioned in another comment, this javascript code is wizardry to me. Perhaps @tylfin or @elgalu or @patrislav1, who worked on issue #39, could help here? In any case you might want to show what's in the
|
# Configuration
theme:
name: material
font:
text: Sarala
features:
- navigation.top
- search.suggest
- search.highlight
- search.share
- navigation.indexes
language: 'en'
# logo: 'images/logo.png'
# favicon: 'images/logo.png'
palette:
- media: "(prefers-color-scheme: light)"
scheme: deep purple
toggle:
icon: material/weather-night
name: Switch to dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
accent: green
primary: deep purple
toggle:
icon: material/weather-sunny
name: Switch to light mode
# Customisation
extra:
social:
- icon: fontawesome/brands/github
link: https://github.com/andynameistaken
generator: false
extra_css:
- 'stylesheets/extra.css'
extra_javascript:
# LaTeX support
- javascripts/mathjax.js
- https://polyfill.io/v3/polyfill.min.js?features=es6
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js
# Mermaid Graph
- extra/refresh_on_toggle_dark_light.js
- https://unpkg.com/mermaid/dist/mermaid.min.js
# sortable data tables
- https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.2.1/tablesort.min.js
- javascripts/tablesort.js
|
Turns out mkdocs-material changed their internal API between major releases. Thanks for the heads up. |
Thanks @patrislav1 for fixing the doc, this is great that you could fix the issue! It would be great if you could outline here (for a person who has notions of HTML/css/js) what had changed in the mkdocs-material internal API? |
The internal API to store and retrieve local settings, including the currently selected theme/palette, changed a little bit - previously the browser's See the diff of |
Thanks a lot! |
Toggle:
mkdocs.yml
docs/extra/refresh_on_toggle_dark_light.js
does not work with package versions:
pip freeze
:The text was updated successfully, but these errors were encountered: