]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
doc/_theme: customize sphinx_rtd_theme 39457/head
authorKefu Chai <kchai@redhat.com>
Sat, 13 Feb 2021 04:57:19 +0000 (12:57 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 5 Mar 2021 01:59:16 +0000 (09:59 +0800)
* move the breadcrumbs to the top
* add border around admonition elements
* use different colors and fonts for section headers
* add decoration lines at the bottom of breadcrumbs
* remove left and right borders in tables
* override the injected versions, the name of theme
  is different from "sphinx_rtd_theme", but the
  versions element is still displayed at the
  bottom-left corner as "versions.html" defines.
  without overriding .rst-badge CSS styling,
  readthedocs puts the injected versions at
  the default bottom-right corner, see
  https://github.com/readthedocs/readthedocs.org/blob/2a519f1146142d18f6a63b61c2f08984067280e0/readthedocs/api/v2/templates/restapi/footer.html

Signed-off-by: Kefu Chai <kchai@redhat.com>
doc/_themes/ceph/layout.html
doc/_themes/ceph/static/ceph.css_t
doc/conf.py

index ca16d1662b49261d2248f24d34bbff7cb61d97ab..81821d1b09d2ea58500719fac69a6953b0620d94 100644 (file)
 <body class="wy-body-for-nav">
 
   {% block extrabody %} {% endblock %}
+  <header class="top-bar">
+    {% include "breadcrumbs.html" %}
+  </header>
   <div class="wy-grid-for-nav">
     {# SIDE NAV, TOGGLES ON MOBILE #}
     <nav data-toggle="wy-nav-shift" class="wy-nav-side">
         {% else %}
         <div class="rst-content">
         {% endif %}
-          {% include "breadcrumbs.html" %}
           <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           {%- block document %}
            <div itemprop="articleBody">
index a9d0da4a29511f489f43507ec63dacd84dedd0bd..dea014c947185679712aa52f14dc642f13d948c3 100644 (file)
@@ -1 +1,162 @@
 @import url("css/theme.css");
+@import url('https://fonts.googleapis.com/css?family=Titillium+Web:400,300,700');
+
+.top-bar {
+  position: fixed;
+  min-width: auto;
+  top: 0;
+  left: 0;
+  width: 100%;
+  z-index: 5050;
+}
+
+.top-bar > div[role=navigation] {
+  border-top: 5px solid #F05C56;
+}
+
+.top-bar > div[role=navigation] > ul {
+  border-top: 5px solid #9C4850;
+}
+
+.top-bar > div[role=navigation] > hr {
+  margin: 0 0 10px;
+}
+
+body {
+  padding-top: 40px;
+}
+
+.wy-nav-side {
+  padding-top: 33px;
+}
+
+.wy-nav-content {
+  padding-top: 0;
+  min-width: 450px;
+  max-width: 940px;
+}
+
+.wy-breadcrumbs {
+  background-color: #80D2DC;
+  font-size: 0.9em;
+}
+
+div.section h1,
+div.section h2,
+div.section h3,
+div.section h4,
+div.section h5,
+div.section h6 {
+  font-weight: normal;
+  margin: 30px 0px 10px 0px;
+  padding: 5px 0 5px 10px;
+  color: #212224;
+  text-transform: uppercase;
+}
+
+div.section h1 {
+  border-top: 20px solid white; margin-top: 0;
+}
+
+div.section h1 { font-family: Titillium Web; font-size: 200%; background-color: #99DAE3;}
+div.section h2 { font-family: Titillium Web; font-size: 150%; background-color: #B2E3EA; }
+div.section h3 { font-family: Titillium Web; font-size: 120%; background-color: #CCECF1; }
+div.section h4 { font-family: Helvetica, Arial, sans-serif; font-size: 110%; background-color: #CCECF1; }
+div.section h5 { font-family: Helvetica, Arial, sans-serif; font-size: 100%; background-color: #CCECF1; }
+div.section h6 { font-family: Helvetica, Arial, sans-serif; font-size: 100%; background-color: #CCECF1; }
+
+/* nature theme */
+div.highlight {
+  background-color: white;
+}
+
+/* admonition */
+.rst-content .tip .admonition-title {
+  background-color: #1abc9c;
+}
+
+.admonition.tip {
+  background-color: #B2EBD8;
+  border: 1px solid #55AEBA;
+}
+
+.admonition.note {
+  background-color: #A9D1EC;
+  border: 1px solid #6AB0DE;
+}
+
+
+.rst-content .important .admonition-title {
+  background-color: #F05C56;
+}
+
+.admonition.important {
+  background-color: #FBD9D4;
+  border: 1px solid #F6A99E;
+}
+
+.admonition.warning {
+  border: 1px solid #F5DBC6;
+}
+
+.rst-content .admonition.important a {
+  color: #E6E8E8;
+}
+
+/* table */
+.rst-content table.docutils {
+  border: 0;
+  border-collapse: collapse;
+}
+
+.rst-content table dl:not(.docutils) dt {
+  display: inline-block;
+}
+
+.rst-content table.docutils tr p:last-child {
+  margin-bottom: 0;
+}
+
+html.writer-html5 .rst-content table.docutils th,
+.rst-content table.docutils th,
+.rst-content table.docutils td,
+.rst-content table.docutils tbody > tr:last-child td {
+  border-top: 0;
+  border-left: 0;
+  border-right: 0;
+  border-bottom: 1px solid #aaa;
+  white-space: normal;
+}
+
+/* versions */
+.injected .rst-versions.rst-badge {
+  left: 0;
+  right: 0;
+  bottom: 0;
+}
+
+.injected .rst-versions.rst-badge .rst-current-version {
+  bottom: 0;
+  line-height: 1px;
+  padding: 12px;
+  height: auto;
+}
+
+.columns-2,
+.columns-3 {
+  display: flex;
+}
+
+.columns-2 > div,
+.columns-3 > div {
+  flex: 1;
+  padding: 0 10px 10px 0;
+}
+
+.columns-2 > div {
+  width: 50%;
+}
+
+.columns-3 > div {
+  width: 33.33%;
+}
index 841e3c3b612121425c6b18d1affc69244ef9acd7..7b6b50c0e86f06088add11555ad7e7887dad5ebe 100644 (file)
@@ -50,7 +50,7 @@ html_theme_options = {
     'prev_next_buttons_location': 'bottom',
     'style_external_links': False,
     'vcs_pageview_mode': '',
-    'style_nav_header_background': 'white',
+    'style_nav_header_background': '#eee',
     # Toc options
     'collapse_navigation': True,
     'sticky_navigation': True,