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

Add support for customizing navigation bar styles in the MkDocs theme #1930

Merged
merged 1 commit into from Dec 16, 2019

Conversation

jimporter
Copy link
Contributor

@jimporter jimporter commented Dec 15, 2019

See also: mkdocs/mkdocs-bootswatch#56

This patch allows documentation authors to configure the color of the navigation bar with one of three options (defined by the Bootswatch theme): primary (the default), dark, and light. This is primarily here to restore support for (what used to be called) inverse nav headers in mkdocs-bootswatch. Without this patch, mkdocs-bootswatch would have to redefine all of base.html for each theme to include the changes made here. Since this feature is relevant for the mkdocs theme, I figured it made more sense to add it in the base theme.

The Jinja template change is a bit hairy here, but I'm not sure if there's a better way to do it...

Here are some examples of what it looks like with the mkdocs theme:

primary
Primary theme

dark
Dark theme

light
light

Copy link
Member

@waylan waylan left a comment

Cool. Didn't realize this was an option bootstrap offered.

Add a note to the release notes and I'll merge this.

mkdocs/themes/mkdocs/base.html Show resolved Hide resolved
waylan
waylan approved these changes Dec 16, 2019
@waylan waylan merged commit 15e31f7 into mkdocs:master Dec 16, 2019
2 of 3 checks passed
@jimporter jimporter deleted the nav-styles branch Dec 17, 2019
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.

None yet

2 participants