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

Run theme switching in mkdocs-material only on print event #21

Closed
timvink opened this issue Oct 7, 2020 · 1 comment
Closed

Run theme switching in mkdocs-material only on print event #21

timvink opened this issue Oct 7, 2020 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@timvink
Copy link
Owner

timvink commented Oct 7, 2020

I prefer dark mode in mkdocs-material, and going to the print site page, it will switch to light mode (for printing purposes). I do this using javascript.

It looks like you can run bits of javascript only when printing: https://stackoverflow.com/a/11060206/5525118

This enables switching the color theme from dark to white only at the moment is it needed, keeping the print page in the nice dark theme as well, and in effect hiding this color theme switch from users.

@timvink timvink added enhancement New feature or request good first issue Good for newcomers labels Oct 7, 2020
@timvink
Copy link
Owner Author

timvink commented Oct 8, 2020

This will be part of the next release, unless it's incorporated into mkdocs-material itself in the meantime. (squidfunk/mkdocs-material#1973)

@timvink timvink closed this as completed Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant