summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2020-06-10 15:08:19 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-09-16 18:13:44 +0100
commitfa304c0129538d7a0b7a3922cd1fde2e242d6cab (patch)
tree4c07b6eb6fed81de6f8d5199601321fde3bb21f1
parent29af1cd2a4f379096f5dd6f4cacc0a9c9f211e7c (diff)
downloadbitbake-fa304c0129538d7a0b7a3922cd1fde2e242d6cab.tar.gz
sphinx: override theme CSS
It is possible to override CSS settings from the theme, by providing custom snippets of CSS stylesheet. Support for that is added in conf.py file. Most of the CSS customization is inherited from the DocBook CSS style. Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
-rw-r--r--doc/conf.py8
-rw-r--r--doc/sphinx-static/theme_overrides.css146
2 files changed, 153 insertions, 1 deletions
diff --git a/doc/conf.py b/doc/conf.py
index 77ea2e821..f5a3aa56c 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -63,4 +63,10 @@ html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
+html_static_path = ['sphinx-static']
+
+html_context = {
+ 'css_files': [
+ '_static/theme_overrides.css',
+ ],
+}
diff --git a/doc/sphinx-static/theme_overrides.css b/doc/sphinx-static/theme_overrides.css
new file mode 100644
index 000000000..adf0eb81b
--- /dev/null
+++ b/doc/sphinx-static/theme_overrides.css
@@ -0,0 +1,146 @@
+/*
+ SPDX-License-Identifier: CC-BY-2.0-UK
+*/
+
+body {
+ font-family: Verdana, Sans, sans-serif;
+
+ min-width: 640px;
+ margin: 0em auto;
+ color: #333;
+}
+
+h1,h2,h3,h4,h5,h6,h7 {
+ font-family: Arial, Sans;
+ color: #00557D;
+ clear: both;
+}
+
+h1 {
+ font-size: 2em;
+ text-align: left;
+ padding: 0em 0em 0em 0em;
+ margin: 2em 0em 0em 0em;
+}
+
+h2.subtitle {
+ margin: 0.10em 0em 3.0em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 1.8em;
+ padding-left: 20%;
+ font-weight: normal;
+ font-style: italic;
+}
+
+h2 {
+ margin: 2em 0em 0.66em 0em;
+ padding: 0.5em 0em 0em 0em;
+ font-size: 1.5em;
+ font-weight: bold;
+}
+
+h3.subtitle {
+ margin: 0em 0em 1em 0em;
+ padding: 0em 0em 0em 0em;
+ font-size: 142.14%;
+ text-align: right;
+}
+
+h3 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 140%;
+ font-weight: bold;
+}
+
+h4 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 120%;
+ font-weight: bold;
+}
+
+h5 {
+ margin: 1em 0em 0.5em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+h6 {
+ margin: 1em 0em 0em 0em;
+ padding: 1em 0em 0em 0em;
+ font-size: 110%;
+ font-weight: bold;
+}
+
+.wy-nav-content a {
+ text-decoration: underline;
+ color: #444;
+ background: transparent;
+}
+
+.wy-nav-content a:hover {
+ text-decoration: underline;
+ background-color: #dedede;
+}
+
+.wy-nav-content a:visited {
+ color: #444;
+}
+
+[alt='Permalink'] { color: #eee; }
+[alt='Permalink']:hover { color: black; }
+
+@media screen {
+ /* content column
+ *
+ * RTD theme's default is 800px as max width for the content, but we have
+ * tables with tons of columns, which need the full width of the view-port.
+ */
+
+ .wy-nav-content{max-width: none; }
+
+ /* inline literal: drop the borderbox, padding and red color */
+ code, .rst-content tt, .rst-content code {
+ color: inherit;
+ border: none;
+ padding: unset;
+ background: inherit;
+ font-size: 85%;
+ }
+
+ .rst-content tt.literal,.rst-content tt.literal,.rst-content code.literal {
+ color: inherit;
+ }
+
+ /* Admonition should be gray, not blue or green */
+ .rst-content .note .admonition-title, .rst-content .tip .admonition-title {
+ background: #f0f0f2;
+ color: #00557D;
+
+ }
+ .rst-content .note, .rst-content .tip {
+ background: #f0f0f2;
+ }
+
+ /* Remove the icon in front of note/tip element, and before the logo */
+ .icon-home:before, .rst-content .admonition-title:before {
+ display: none
+ }
+
+ /* a custom informalexample container is used in some doc */
+ .informalexample {
+ border: 1px solid;
+ border-color: #aaa;
+ margin: 1em 0em;
+ padding: 1em;
+ page-break-inside: avoid;
+ }
+
+ /* Remove the blue background in the top left corner, around the logo */
+ .wy-side-nav-search {
+ background: inherit;
+ }
+
+}