Switch documentation to custom furo theme with dark mode option.

Co-authored-by: Saran Tunyasuvunakool <stunya@google.com>
Co-authored-by: Yuval Tassa <tassa@google.com>
PiperOrigin-RevId: 488975449
Change-Id: Ia2db8ac7ecd27a00ca2c4c9ca5e85b9167813473
This commit is contained in:
Kevin Zakka
2022-11-16 10:23:13 -08:00
committed by Copybara-Service
parent 7b0fbc63f8
commit 571b703f1c
6 changed files with 199 additions and 55 deletions
+79 -30
View File
@@ -1,37 +1,48 @@
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400;1,500;1,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Text:ital,wght@0,400;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital,wght@0,400;1,400&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,400;0,500;1,400;1,500&display=swap');
/* Disable scroll on anchor. */
html {
scroll-behavior: auto;
}
body {
font-family: 'DM Sans', 'Helvetica Neue', 'Arial', sans-serif;
-webkit-font-smoothing: antialiased;
color: rgb(20, 35, 75);
color: var(--body-color);
}
.rst-content .toctree-wrapper>p.caption,h1 {
font-size: 250%;
font-family: 'DM Serif Display', 'Times New Roman', serif;
font-weight: 400;
color: rgb(0, 83, 214);
.sidebar-brand-text {
display: none;
}
.rst-content .toctree-wrapper>p.caption,h2,h3,h4,h5,h6,legend {
h1 {
font-size: 300%;
font-family: 'DM Sans', 'Helvetica Neue', 'Arial', sans-serif;
font-weight: 600;
color: var(--primary-header-color);
margin-top: 1em;
}
h2,h3,h4,h5,h6,legend {
font-family: 'DM Sans', 'Helvetica Neue', 'Arial', sans-serif;
-webkit-font-smoothing: antialiased;
font-weight: 700;
color: rgb(18, 54, 147);
color: var(--secondary-header-color);
}
/* Decrease bottom margin of some headings for tighter vertical spacing. */
.rst-content h2 {
margin-bottom: 20px;
h2 {
margin-top: 1.2em;
margin-bottom: 0.75em;
}
.rst-content h3 {
margin-bottom: 10px;
h3 {
margin-top: 0.75em;
margin-bottom: 0.5em;
}
.rst-content h4 {
margin-bottom: 5px;
h4 {
margin-top: 0.5em;
margin-bottom: 0.25em;
}
/* Paragraph margins don't apply to table cell contents. */
@@ -44,10 +55,10 @@ body {
padding: 6px;
}
/* Don't change color of visited links. */
/* Don't change color of visited links.
.rst-content a.reference:visited {
color: #2980b9;
}
color: var(--rst-content-a-color);
} */
.rst-content code, .rst-content tt {
font-size: 90%;
@@ -63,17 +74,24 @@ body {
ul.simple {
list-style: disc;
margin-left: 24px;
margin-top: 0.5em;
margin-bottom: 0.5em;
}
ul.simple li {
list-style: disc;
}
ol {
margin-top: 0.5em;
margin-bottom: 0.5em;
}
/* Change background color of the nav bars. */
.wy-side-nav-search,
.wy-nav-top,
.wy-nav-side {
background-color: rgb(0, 83, 214);
background-color: var(--wy-nav-side-background-color);
}
/* Make text wrap in table cells. */
@@ -121,7 +139,7 @@ html.writer-html5 .rst-content table.docutils th>p {
.wy-menu-vertical li.toctree-l8 a:hover span.toctree-expand,
.wy-menu-vertical li.toctree-l9 a:hover span.toctree-expand,
.wy-menu-vertical li.toctree-l10 a:hover span.toctree-expand {
color: white;
color: var(--wy-menu-vertical-color);
}
/* Change color of TOC background. */
@@ -139,30 +157,49 @@ html.writer-html5 .rst-content table.docutils th>p {
.wy-menu-vertical li.toctree-l7.current li.toctree-l8>a,
.wy-menu-vertical li.toctree-l8.current li.toctree-l9>a,
.wy-menu-vertical li.toctree-l9.current li.toctree-l10>a {
background-color: rgb(0, 83, 214);
background-color: var(--wy-menu-vertical-background-color);
border: none;
}
/* Alternate row colors. */
table.docutils:not(.mjcf-attributes) > tbody > tr.row-odd {
background-color: var(--row-odd-background-color);
}
/* MJCF attributes table. */
.rst-content table.mjcf-attributes {
table.mjcf-attributes {
border-style: none;
margin-left: 0px;
margin-right: 0px;
width: 100%;
box-shadow: none;
}
.rst-content table.mjcf-attributes:not(.field-list) tr td,
.rst-content table.mjcf-attributes:not(.field-list) tr:nth-child(2n-1) td {
table.mjcf-attributes tbody tr td,
table.mjcf-attributes tbody tr:nth-child(2n-1) td {
border-style: none;
background-color: rgba(255, 255, 255, 0);
padding: 0px 0px 0px 0px;
width: 33%;
}
table.mjcf-attributes tbody tr td p {
margin: 0;
}
div.table-wrapper.mjcf-attributes {
margin: 0.5em;
padding: 0;
}
table td > div.wy-table-responsive {
margin-bottom: 0px;
}
/* Remove vertical spacing before/after code blocks. */
div[class*=" highlight-"], div[class^=highlight-] {
margin: 0;
}
/* MJCF element names. */
.el {
font-weight: bold;
@@ -170,12 +207,16 @@ table td > div.wy-table-responsive {
/* MJCF attribute names. */
.at {
color: darkred;
color: var(--at-color);
}
dt .at {
font-weight: 600;
}
/* MJCF attribute value specs. */
.at-val {
color: darkred;
color: var(--at-val-color);
font-weight: normal;
}
@@ -183,3 +224,11 @@ table td > div.wy-table-responsive {
.toctree-l1 .el-prefix {
display: none;
}
.admonition p:not(.admonition-title) {
margin-left: 0.5em;
}
details summary {
font-weight: 600;
}