From 351b87939ddc61bc767e2b869e2a2673fe9af5ae Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Wed, 29 Nov 2023 11:37:50 -0500 Subject: [PATCH] Update mkdocs theme to Bootstrap/Bootswatch 5.3.2 Javascript has been updated to Bootstrap version 5.3.2 and CSS has been updated to the the Bootswatch Cerulean theme version 5.3.2. Adding support for a dark mode to the mkdocs theme is now possible. All local colors (in base.css, extra.css, etc.) are now defined using Bootstrap variables so that any future color modes (such as dark mode) will be consistent. Admonition styles have also been fully fleshed out with all colors being Bootstrap colors (via variables) rather than our own custom colors. Note that while Bootstrap version 5 dropped a dependency on jQuery, the mkdocs theme is still making use of jQuery at this time. However, future changes could remove the need for this dependency. Co-authored-by: Oleh Prypin --- .jshintignore | 2 +- docs/css/extra.css | 24 ++-- docs/index.md | 6 +- mkdocs/themes/mkdocs/base.html | 16 +-- mkdocs/themes/mkdocs/css/base.css | 109 +++++++++++++----- mkdocs/themes/mkdocs/css/bootstrap.min.css | 18 +-- .../themes/mkdocs/css/bootstrap.min.css.map | 1 + mkdocs/themes/mkdocs/js/base.js | 18 +-- .../themes/mkdocs/js/bootstrap.bundle.min.js | 7 ++ .../mkdocs/js/bootstrap.bundle.min.js.map | 1 + mkdocs/themes/mkdocs/js/bootstrap.min.js | 7 -- mkdocs/themes/mkdocs/keyboard-modal.html | 2 +- mkdocs/themes/mkdocs/nav-sub.html | 2 +- mkdocs/themes/mkdocs/search-modal.html | 2 +- mkdocs/themes/mkdocs/toc.html | 8 +- pyproject.toml | 2 +- 16 files changed, 126 insertions(+), 99 deletions(-) create mode 100644 mkdocs/themes/mkdocs/css/bootstrap.min.css.map create mode 100644 mkdocs/themes/mkdocs/js/bootstrap.bundle.min.js create mode 100644 mkdocs/themes/mkdocs/js/bootstrap.bundle.min.js.map delete mode 100644 mkdocs/themes/mkdocs/js/bootstrap.min.js diff --git a/.jshintignore b/.jshintignore index 72344b0aa5..8b54bdfa26 100644 --- a/.jshintignore +++ b/.jshintignore @@ -1,6 +1,6 @@ mkdocs/themes/**/js/jquery-**.min.js mkdocs/themes/mkdocs/js/highlight.pack.js -mkdocs/themes/mkdocs/js/bootstrap.min.js +mkdocs/themes/mkdocs/js/bootstrap.bundle.min.js mkdocs/themes/mkdocs/js/modernizr-**.min.js mkdocs/themes/readthedocs/js/theme.js mkdocs/themes/readthedocs/js/html5shiv.min.js diff --git a/docs/css/extra.css b/docs/css/extra.css index 912bbd540c..7dcbe47ce8 100644 --- a/docs/css/extra.css +++ b/docs/css/extra.css @@ -21,14 +21,14 @@ div.admonition.block>.admonition-title { } .admonition.new, details.new { - color: #15654a; - background-color: #edfff9; - border-color: #bcf1e8; + color: var(--bs-success-text-emphasis); + background-color: var(--bs-success-bg-subtle); + border-color: var(--bs-success-border-subtle); } .admonition.example, details.example { - color: #353579; - background-color: #f0f1ff; - border-color: #d8dcf0; + color: var(--bs-info-text-emphasis); + background-color: var(--bs-info-bg-subtle); + border-color: var(--bs-info-border-subtle); } /* Definition List styles */ @@ -45,16 +45,6 @@ dd { /* Homepage */ -body.homepage div.jumbotron { - margin-top: 1.5rem; - padding-top: 1rem; - padding-bottom: 0; -} - -body.homepage div.jumbotron div.card { - margin-bottom: 2rem; -} - body.homepage>div.container>div.row>div.col-md-3 { display: none; } @@ -69,7 +59,7 @@ body.homepage>div.container>div.row>div.col-md-9 { .doc-object { padding-left: 10px; - border-left: 4px solid rgba(230, 230, 230); + border-left: 4px solid var(--bs-light-border-subtle); } .doc-contents .field-body p:first-of-type { diff --git a/docs/index.md b/docs/index.md index 069d822201..f796a05457 100644 --- a/docs/index.md +++ b/docs/index.md @@ -18,12 +18,12 @@ configuration file. Start by reading the [introductory tutorial], then check the User Guide -
+

Features

-
+

Great themes available

@@ -40,7 +40,7 @@ configuration file. Start by reading the [introductory tutorial], then check the

-
+

Easy to customize

diff --git a/mkdocs/themes/mkdocs/base.html b/mkdocs/themes/mkdocs/base.html index 2b077bd016..a507d745e3 100644 --- a/mkdocs/themes/mkdocs/base.html +++ b/mkdocs/themes/mkdocs/base.html @@ -1,5 +1,5 @@ - + {%- block site_meta %} @@ -74,7 +74,7 @@ {%- if nav|length>1 or (page and (page.next_page or page.previous_page)) or config.repo_url %} - {%- endif %} @@ -87,8 +87,8 @@