Actualiza los estilos para encajarlos en los temas

This commit is contained in:
Manuel Cillero 2022-07-24 19:36:09 +02:00
parent 396f9df5ee
commit eb3e354f2f
6 changed files with 705 additions and 694 deletions

View file

@ -3,7 +3,7 @@ authors = ["Manuel Cillero"]
language = "en" language = "en"
multilingual = false multilingual = false
src = "src" src = "src"
title = "PageTop Guide" title = "PageTop Guides"
[build] [build]
build-dir = "../static/doc" build-dir = "../static/doc"

View file

@ -3,257 +3,263 @@
@import 'variables.css'; @import 'variables.css';
::-webkit-scrollbar { ::-webkit-scrollbar {
background: var(--bg); background: var(--bg);
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
background: var(--scrollbar); background: var(--scrollbar);
} }
html {
scrollbar-color: var(--scrollbar) var(--bg); #mdbook {
position: relative;
scrollbar-color: var(--scrollbar) var(--bg);
} }
#searchresults a, #mdbook .content {
.content a:link, position: relative;
a:visited, }
a > .hljs {
color: var(--links); #mdbook #searchresults a,
#mdbook .content a:link,
#mdbook a:visited,
#mdbook a > .hljs {
color: var(--links);
} }
/* Menu Bar */ /* Menu Bar */
#menu-bar, #menu-bar,
#menu-bar-hover-placeholder { #menu-bar-hover-placeholder {
z-index: 101; z-index: 101;
margin: auto calc(0px - var(--page-padding)); margin: auto calc(0px - var(--page-padding));
} }
#menu-bar { #menu-bar {
position: relative; position: relative;
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
background-color: var(--bg); background-color: var(--bg);
border-bottom-color: var(--bg); border-bottom-color: var(--bg);
border-bottom-width: 1px; border-bottom-width: 1px;
border-bottom-style: solid; border-bottom-style: solid;
} }
#menu-bar.sticky, #menu-bar.sticky,
.js #menu-bar-hover-placeholder:hover + #menu-bar, .js #menu-bar-hover-placeholder:hover + #menu-bar,
.js #menu-bar:hover, .js #menu-bar:hover,
.js.sidebar-visible #menu-bar { .js.sidebar-visible #menu-bar {
position: -webkit-sticky; position: -webkit-sticky;
position: sticky; position: sticky;
top: 0 !important; top: 0 !important;
} }
#menu-bar-hover-placeholder { #menu-bar-hover-placeholder {
position: sticky; position: sticky;
position: -webkit-sticky; position: -webkit-sticky;
top: 0; top: 0;
height: var(--menu-bar-height); height: var(--menu-bar-height);
} }
#menu-bar.bordered { #menu-bar.bordered {
border-bottom-color: var(--table-border-color); border-bottom-color: var(--table-border-color);
} }
#menu-bar i, #menu-bar .icon-button { #menu-bar i, #menu-bar .icon-button {
position: relative; position: relative;
padding: 0 8px; padding: 0 8px;
z-index: 10; z-index: 10;
line-height: var(--menu-bar-height); line-height: var(--menu-bar-height);
cursor: pointer; cursor: pointer;
transition: color 0.5s; transition: color 0.5s;
} }
@media only screen and (max-width: 420px) { @media only screen and (max-width: 420px) {
#menu-bar i, #menu-bar .icon-button { #menu-bar i, #menu-bar .icon-button {
padding: 0 5px; padding: 0 5px;
} }
} }
.icon-button { #mdbook .icon-button {
border: none; border: none;
background: none; background: none;
padding: 0; padding: 0;
color: inherit; color: inherit;
} }
.icon-button i { #mdbook .icon-button i {
margin: 0; margin: 0;
} }
.right-buttons { #mdbook .right-buttons {
margin: 0 15px; margin: 0 15px;
} }
.right-buttons a { #mdbook .right-buttons a {
text-decoration: none; text-decoration: none;
} }
.left-buttons { #mdbook .left-buttons {
display: flex; display: flex;
margin: 0 5px; margin: 0 5px;
} }
.no-js .left-buttons { .no-js #mdbook .left-buttons {
display: none; display: none;
} }
.menu-title { #mdbook .menu-title {
display: inline-block; display: inline-block;
font-weight: 200; font-weight: 200;
font-size: 2.4rem; font-size: 1.8rem;
line-height: var(--menu-bar-height); line-height: var(--menu-bar-height);
text-align: center; text-align: center;
margin: 0; margin: 0;
flex: 1; flex: 1;
white-space: nowrap; white-space: nowrap;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
.js .menu-title { .js #mdbook .menu-title {
cursor: pointer; cursor: pointer;
} }
.menu-bar, #mdbook .menu-bar,
.menu-bar:visited, #mdbook .menu-bar:visited,
.nav-chapters, #mdbook .nav-chapters,
.nav-chapters:visited, #mdbook .nav-chapters:visited,
.mobile-nav-chapters, #mdbook .mobile-nav-chapters,
.mobile-nav-chapters:visited, #mdbook .mobile-nav-chapters:visited,
.menu-bar .icon-button, #mdbook .menu-bar .icon-button,
.menu-bar a i { #mdbook .menu-bar a i {
color: var(--icons); color: var(--icons);
} }
.menu-bar i:hover, #mdbook .menu-bar i:hover,
.menu-bar .icon-button:hover, #mdbook .menu-bar .icon-button:hover,
.nav-chapters:hover, #mdbook .nav-chapters:hover,
.mobile-nav-chapters i:hover { #mdbook .mobile-nav-chapters i:hover {
color: var(--icons-hover); color: var(--icons-hover);
} }
/* Nav Icons */ /* Nav Icons */
.nav-chapters { #mdbook .nav-chapters {
font-size: 2.5em; font-size: 2.5em;
text-align: center; text-align: center;
text-decoration: none; text-decoration: none;
position: fixed; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
margin: 0; margin: 0;
max-width: 150px; max-width: 150px;
min-width: 90px; min-width: 90px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-content: center; align-content: center;
flex-direction: column; flex-direction: column;
transition: color 0.5s, background-color 0.5s; transition: color 0.5s, background-color 0.5s;
} }
.nav-chapters:hover { #mdbook .nav-chapters:hover {
text-decoration: none; text-decoration: none;
background-color: var(--theme-hover); background-color: var(--theme-hover);
transition: background-color 0.15s, color 0.15s; transition: background-color 0.15s, color 0.15s;
} }
.nav-wrapper { #mdbook .nav-wrapper {
margin-top: 50px; margin-top: 50px;
display: none; display: none;
} }
.mobile-nav-chapters { #mdbook .mobile-nav-chapters {
font-size: 2.5em; font-size: 2.5em;
text-align: center; text-align: center;
text-decoration: none; text-decoration: none;
width: 90px; width: 90px;
border-radius: 5px; border-radius: 5px;
background-color: var(--sidebar-bg); background-color: var(--sidebar-bg);
} }
.previous { #mdbook .previous {
float: left; float: left;
} }
.next { #mdbook .next {
float: right; float: right;
right: var(--page-padding); right: var(--page-padding);
} }
@media only screen and (max-width: 1080px) { @media only screen and (max-width: 1080px) {
.nav-wide-wrapper { display: none; } #mdbook .nav-wide-wrapper { display: none; }
.nav-wrapper { display: block; } #mdbook .nav-wrapper { display: block; }
} }
@media only screen and (max-width: 1380px) { @media only screen and (max-width: 1380px) {
.sidebar-visible .nav-wide-wrapper { display: none; } .sidebar-visible #mdbook .nav-wide-wrapper { display: none; }
.sidebar-visible .nav-wrapper { display: block; } .sidebar-visible #mdbook .nav-wrapper { display: block; }
} }
/* Inline code */ /* Inline code */
:not(pre) > .hljs { #mdbook :not(pre) > .hljs {
display: inline; display: inline;
padding: 0.1em 0.3em; padding: 0.1em 0.3em;
border-radius: 3px; border-radius: 3px;
} }
:not(pre):not(a) > .hljs { #mdbook :not(pre):not(a) > .hljs {
color: var(--inline-code-color); color: var(--inline-code-color);
overflow-x: initial; overflow-x: initial;
} }
a:hover > .hljs { #mdbook a:hover > .hljs {
text-decoration: underline; text-decoration: underline;
} }
pre { #mdbook pre {
position: relative; position: relative;
} }
pre > .buttons { #mdbook pre > .buttons {
position: absolute; position: absolute;
z-index: 100; z-index: 100;
right: 0px; right: 0px;
top: 2px; top: 2px;
margin: 0px; margin: 0px;
padding: 2px 0px; padding: 2px 0px;
color: var(--sidebar-fg); color: var(--sidebar-fg);
cursor: pointer; cursor: pointer;
visibility: hidden; visibility: hidden;
opacity: 0; opacity: 0;
transition: visibility 0.1s linear, opacity 0.1s linear; transition: visibility 0.1s linear, opacity 0.1s linear;
} }
pre:hover > .buttons { #mdbook pre:hover > .buttons {
visibility: visible; visibility: visible;
opacity: 1 opacity: 1
} }
pre > .buttons :hover { #mdbook pre > .buttons :hover {
color: var(--sidebar-active); color: var(--sidebar-active);
border-color: var(--icons-hover); border-color: var(--icons-hover);
background-color: var(--theme-hover); background-color: var(--theme-hover);
} }
pre > .buttons i { #mdbook pre > .buttons i {
margin-left: 8px; margin-left: 8px;
} }
pre > .buttons button { #mdbook pre > .buttons button {
cursor: inherit; cursor: inherit;
margin: 0px 5px; margin: 0px 5px;
padding: 3px 5px; padding: 3px 5px;
font-size: 14px; font-size: 14px;
border-style: solid; border-style: solid;
border-width: 1px; border-width: 1px;
border-radius: 4px; border-radius: 4px;
border-color: var(--icons); border-color: var(--icons);
background-color: var(--theme-popup-bg); background-color: var(--theme-popup-bg);
transition: 100ms; transition: 100ms;
transition-property: color,border-color,background-color; transition-property: color,border-color,background-color;
color: var(--icons); color: var(--icons);
} }
@media (pointer: coarse) { @media (pointer: coarse) {
pre > .buttons button { #mdbook pre > .buttons button {
/* On mobile, make it easier to tap buttons. */ /* On mobile, make it easier to tap buttons. */
padding: 0.3rem 1rem; padding: 0.3rem 1rem;
} }
} }
pre > code { #mdbook pre > code {
padding: 1rem; padding: 1rem;
} }
/* FIXME: ACE editors overlap their buttons because ACE does absolute /* FIXME: ACE editors overlap their buttons because ACE does absolute
@ -261,274 +267,274 @@ pre > code {
can think of is to move the padding to the outer pre tag (or insert a div can think of is to move the padding to the outer pre tag (or insert a div
wrapper), but that would require fixing a whole bunch of CSS rules. wrapper), but that would require fixing a whole bunch of CSS rules.
*/ */
.hljs.ace_editor { #mdbook .hljs.ace_editor {
padding: 0rem 0rem; padding: 0rem 0rem;
} }
pre > .result { #mdbook pre > .result {
margin-top: 10px; margin-top: 10px;
} }
/* Search */ /* Search */
#searchresults a { #searchresults a {
text-decoration: none; text-decoration: none;
} }
mark { #mdbook mark {
border-radius: 2px; border-radius: 2px;
padding: 0 3px 1px 3px; padding: 0 3px 1px 3px;
margin: 0 -3px -1px -3px; margin: 0 -3px -1px -3px;
background-color: var(--search-mark-bg); background-color: var(--search-mark-bg);
transition: background-color 300ms linear; transition: background-color 300ms linear;
cursor: pointer; cursor: pointer;
} }
mark.fade-out { #mdbook mark.fade-out {
background-color: rgba(0,0,0,0) !important; background-color: rgba(0,0,0,0) !important;
cursor: auto; cursor: auto;
} }
.searchbar-outer { #mdbook .searchbar-outer {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
max-width: var(--content-max-width); max-width: var(--content-max-width);
} }
#searchbar { #searchbar {
width: 100%; width: 100%;
margin: 5px auto 0px auto; margin: 5px auto 0px auto;
padding: 10px 16px; padding: 10px 16px;
transition: box-shadow 300ms ease-in-out; transition: box-shadow 300ms ease-in-out;
border: 1px solid var(--searchbar-border-color); border: 1px solid var(--searchbar-border-color);
border-radius: 3px; border-radius: 3px;
background-color: var(--searchbar-bg); background-color: var(--searchbar-bg);
color: var(--searchbar-fg); color: var(--searchbar-fg);
} }
#searchbar:focus, #searchbar:focus,
#searchbar.active { #searchbar.active {
box-shadow: 0 0 3px var(--searchbar-shadow-color); box-shadow: 0 0 3px var(--searchbar-shadow-color);
} }
.searchresults-header { #mdbook .searchresults-header {
font-weight: bold; font-weight: bold;
font-size: 1em; font-size: 1em;
padding: 18px 0 0 5px; padding: 18px 0 0 5px;
color: var(--searchresults-header-fg); color: var(--searchresults-header-fg);
} }
.searchresults-outer { #mdbook .searchresults-outer {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
max-width: var(--content-max-width); max-width: var(--content-max-width);
border-bottom: 1px dashed var(--searchresults-border-color); border-bottom: 1px dashed var(--searchresults-border-color);
} }
ul#searchresults { #mdbook ul#searchresults {
list-style: none; list-style: none;
padding-left: 20px; padding-left: 20px;
} }
ul#searchresults li { #mdbook ul#searchresults li {
margin: 10px 0px; margin: 10px 0px;
padding: 2px; padding: 2px;
border-radius: 2px; border-radius: 2px;
} }
ul#searchresults li.focus { #mdbook ul#searchresults li.focus {
background-color: var(--searchresults-li-bg); background-color: var(--searchresults-li-bg);
} }
ul#searchresults span.teaser { #mdbook ul#searchresults span.teaser {
display: block; display: block;
clear: both; clear: both;
margin: 5px 0 0 20px; margin: 5px 0 0 20px;
font-size: 0.8em; font-size: 0.8em;
} }
ul#searchresults span.teaser em { #mdbook ul#searchresults span.teaser em {
font-weight: bold; font-weight: bold;
font-style: normal; font-style: normal;
} }
/* Sidebar */ /* Sidebar */
#mdbook .sidebar {
.sidebar { position: absolute;
position: fixed; left: 0;
left: 0; top: 0;
top: 0; bottom: 0;
bottom: 0; width: var(--sidebar-width);
width: var(--sidebar-width); font-size: 0.875em;
font-size: 0.875em; box-sizing: border-box;
box-sizing: border-box; -webkit-overflow-scrolling: touch;
-webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
overscroll-behavior-y: contain; background-color: var(--sidebar-bg);
background-color: var(--sidebar-bg); color: var(--sidebar-fg);
color: var(--sidebar-fg);
} }
.sidebar-resizing { .sidebar-resizing {
-moz-user-select: none; -moz-user-select: none;
-webkit-user-select: none; -webkit-user-select: none;
-ms-user-select: none; -ms-user-select: none;
user-select: none; user-select: none;
} }
.js:not(.sidebar-resizing) .sidebar { .js:not(.sidebar-resizing) #mdbook .sidebar {
transition: transform 0.3s; /* Animation: slide away */ transition: transform 0.3s; /* Animation: slide away */
} }
.sidebar code { #mdbook .sidebar code {
line-height: 2em; line-height: 2em;
} }
.sidebar .sidebar-scrollbox { #mdbook .sidebar .sidebar-scrollbox {
overflow-y: auto; overflow-y: auto;
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
right: 0; right: 0;
padding: 10px 10px; padding: 10px 10px;
} }
.sidebar .sidebar-resize-handle { #mdbook .sidebar .sidebar-resize-handle {
position: absolute; position: absolute;
cursor: col-resize; cursor: col-resize;
width: 0; width: 0;
right: 0; right: 0;
top: 0; top: 0;
bottom: 0; bottom: 0;
} }
.js .sidebar .sidebar-resize-handle { .js #mdbook .sidebar .sidebar-resize-handle {
cursor: col-resize; cursor: col-resize;
width: 5px; width: 5px;
} }
.sidebar-hidden .sidebar { .sidebar-hidden #mdbook .sidebar {
transform: translateX(calc(0px - var(--sidebar-width))); transform: translateX(calc(0px - var(--sidebar-width)));
} }
.sidebar::-webkit-scrollbar { #mdbook .sidebar::-webkit-scrollbar {
background: var(--sidebar-bg); background: var(--sidebar-bg);
} }
.sidebar::-webkit-scrollbar-thumb { #mdbook .sidebar::-webkit-scrollbar-thumb {
background: var(--scrollbar); background: var(--scrollbar);
} }
.sidebar-visible .page-wrapper { .sidebar-visible #mdbook .page-wrapper {
transform: translateX(var(--sidebar-width)); transform: translateX(var(--sidebar-width));
} }
@media only screen and (min-width: 620px) { @media only screen and (min-width: 620px) {
.sidebar-visible .page-wrapper { .sidebar-visible #mdbook .page-wrapper {
transform: none; transform: none;
margin-left: var(--sidebar-width); margin-left: var(--sidebar-width);
} }
} }
.chapter { #mdbook .chapter {
list-style: none outside none; list-style: none outside none;
padding-left: 0; padding-left: 0;
line-height: 2.2em; line-height: 2.2em;
} }
.chapter ol { #mdbook .chapter ol {
width: 100%; width: 100%;
} }
.chapter li { #mdbook .chapter li {
display: flex; display: flex;
color: var(--sidebar-non-existant); color: var(--sidebar-non-existant);
} }
.chapter li a { #mdbook .chapter li a {
display: block; display: block;
padding: 0; padding: 0;
text-decoration: none; text-decoration: none;
color: var(--sidebar-fg); color: var(--sidebar-fg);
} }
.chapter li a:hover { #mdbook .chapter li a:hover {
color: var(--sidebar-active); color: var(--sidebar-active);
} }
.chapter li a.active { #mdbook .chapter li a.active {
color: var(--sidebar-active); color: var(--sidebar-active);
} }
.chapter li > a.toggle { #mdbook .chapter li > a.toggle {
cursor: pointer; cursor: pointer;
display: block; display: block;
margin-left: auto; margin-left: auto;
padding: 0 10px; padding: 0 10px;
user-select: none; user-select: none;
opacity: 0.68; opacity: 0.68;
} }
.chapter li > a.toggle div { #mdbook .chapter li > a.toggle div {
transition: transform 0.5s; transition: transform 0.5s;
} }
/* collapse the section */ /* collapse the section */
.chapter li:not(.expanded) + li > ol { #mdbook .chapter li:not(.expanded) + li > ol {
display: none; display: none;
} }
.chapter li.chapter-item { #mdbook .chapter li.chapter-item {
line-height: 1.5em; line-height: 1.5em;
margin-top: 0.6em; margin-top: 0.6em;
} }
.chapter li.expanded > a.toggle div { #mdbook .chapter li.expanded > a.toggle div {
transform: rotate(90deg); transform: rotate(90deg);
} }
.spacer { #mdbook .spacer {
width: 100%; width: 100%;
height: 3px; height: 3px;
margin: 5px 0px; margin: 5px 0px;
} }
.chapter .spacer { #mdbook .chapter .spacer {
background-color: var(--sidebar-spacer); background-color: var(--sidebar-spacer);
} }
@media (-moz-touch-enabled: 1), (pointer: coarse) { @media (-moz-touch-enabled: 1), (pointer: coarse) {
.chapter li a { padding: 5px 0; } #mdbook .chapter li a { padding: 5px 0; }
.spacer { margin: 10px 0; } #mdbook .spacer { margin: 10px 0; }
} }
.section { #mdbook .section {
list-style: none outside none; list-style: none outside none;
padding-left: 20px; margin: 0;
line-height: 1.9em; padding: 0 0 0 20px;
line-height: 1.9em;
} }
/* Theme Menu Popup */ /* Theme Menu Popup */
.theme-popup { #mdbook .theme-popup {
position: absolute; position: absolute;
left: 10px; left: 10px;
top: var(--menu-bar-height); top: var(--menu-bar-height);
z-index: 1000; z-index: 1000;
border-radius: 4px; border-radius: 4px;
font-size: 0.7em; font-size: 0.7em;
color: var(--fg); color: var(--fg);
background: var(--theme-popup-bg); background: var(--theme-popup-bg);
border: 1px solid var(--theme-popup-border); border: 1px solid var(--theme-popup-border);
margin: 0; margin: 0;
padding: 0; padding: 0;
list-style: none; list-style: none;
display: none; display: none;
} }
.theme-popup .default { #mdbook .theme-popup .default {
color: var(--icons); color: var(--icons);
} }
.theme-popup .theme { #mdbook .theme-popup .theme {
width: 100%; width: 100%;
border: 0; border: 0;
margin: 0; margin: 0;
padding: 2px 10px; padding: 2px 10px;
line-height: 25px; line-height: 25px;
white-space: nowrap; white-space: nowrap;
text-align: left; text-align: left;
cursor: pointer; cursor: pointer;
color: inherit; color: inherit;
background: inherit; background: inherit;
font-size: inherit; font-size: inherit;
} }
.theme-popup .theme:hover { #mdbook .theme-popup .theme:hover {
background-color: var(--theme-hover); background-color: var(--theme-hover);
} }
.theme-popup .theme:hover:first-child, #mdbook .theme-popup .theme:hover:first-child,
.theme-popup .theme:hover:last-child { #mdbook .theme-popup .theme:hover:last-child {
border-top-left-radius: inherit; border-top-left-radius: inherit;
border-top-right-radius: inherit; border-top-right-radius: inherit;
} }

View file

@ -2,70 +2,64 @@
@import 'variables.css'; @import 'variables.css';
:root { #mdbook {
/* Browser default font-size is 16px, this way 1 rem = 10px */ font-family: "Open Sans", sans-serif;
font-size: 62.5%; color: var(--fg);
background-color: var(--bg);
text-size-adjust: none;
-webkit-text-size-adjust: none;
overflow-x: hidden;
} }
html { #mdbook code {
font-family: "Open Sans", sans-serif; font-family: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace !important;
color: var(--fg);
background-color: var(--bg);
text-size-adjust: none;
-webkit-text-size-adjust: none;
}
body {
margin: 0;
font-size: 1.6rem;
overflow-x: hidden;
}
code {
font-family: "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, "DejaVu Sans Mono", monospace, monospace !important;
font-size: 0.875em; /* please adjust the ace font size accordingly in editor.js */
} }
/* make long words/inline code not x overflow */ /* make long words/inline code not x overflow */
main { #mdbook main {
overflow-wrap: break-word; overflow-wrap: break-word;
} }
/* make wide tables scroll if they overflow */ /* make wide tables scroll if they overflow */
.table-wrapper { #mdbook .table-wrapper {
overflow-x: auto; overflow-x: auto;
} }
/* Don't change font size in headers. */ /* Don't change font size in headers. */
h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { #mdbook h1 code,
font-size: unset; #mdbook h2 code,
#mdbook h3 code,
#mdbook h4 code,
#mdbook h5 code,
#mdbook h6 code {
font-size: unset;
} }
.left { float: left; } #mdbook .left { float: left; }
.right { float: right; } #mdbook .right { float: right; }
.boring { opacity: 0.6; } #mdbook .boring { opacity: 0.6; }
.hide-boring .boring { display: none; } #mdbook .hide-boring .boring { display: none; }
.hidden { display: none !important; } #mdbook .hidden { display: none !important; }
h2, h3 { margin-top: 2.5em; } #mdbook h2, #mdbook h3 { margin-top: 2.5em; }
h4, h5 { margin-top: 2em; } #mdbook h4, #mdbook h5 { margin-top: 2em; }
.header + .header h3, #mdbook .header + .header h3,
.header + .header h4, #mdbook .header + .header h4,
.header + .header h5 { #mdbook .header + .header h5 {
margin-top: 1em; margin-top: 1em;
} }
h1:target::before, #mdbook h1:target::before,
h2:target::before, #mdbook h2:target::before,
h3:target::before, #mdbook h3:target::before,
h4:target::before, #mdbook h4:target::before,
h5:target::before, #mdbook h5:target::before,
h6:target::before { #mdbook h6:target::before {
display: inline-block; display: inline-block;
content: "»"; content: "»";
margin-left: -30px; margin-left: -30px;
width: 30px; width: 30px;
} }
/* This is broken on Safari as of version 14, but is fixed /* This is broken on Safari as of version 14, but is fixed
@ -73,119 +67,119 @@ h6:target::before {
https://bugs.webkit.org/show_bug.cgi?id=218076 https://bugs.webkit.org/show_bug.cgi?id=218076
*/ */
:target { :target {
scroll-margin-top: calc(var(--menu-bar-height) + 0.5em); scroll-margin-top: calc(var(--menu-bar-height) + 0.5em);
} }
.page { #mdbook .page {
outline: 0; outline: 0;
padding: 0 var(--page-padding); padding: 0 var(--page-padding);
margin-top: calc(0px - var(--menu-bar-height)); /* Compensate for the #menu-bar-hover-placeholder */ margin-top: calc(0px - var(--menu-bar-height)); /* Compensate for the #menu-bar-hover-placeholder */
} }
.page-wrapper { #mdbook .page-wrapper {
box-sizing: border-box; box-sizing: border-box;
} }
.js:not(.sidebar-resizing) .page-wrapper { .js:not(.sidebar-resizing) #mdbook .page-wrapper {
transition: margin-left 0.3s ease, transform 0.3s ease; /* Animation: slide away */ transition: margin-left 0.3s ease, transform 0.3s ease; /* Animation: slide away */
} }
.content { #mdbook .content {
overflow-y: auto; overflow-y: auto;
padding: 0 5px 50px 5px; padding: 20px 5px 50px 5px;
} }
.content main { #mdbook .content main {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
max-width: var(--content-max-width); max-width: var(--content-max-width);
} }
.content p { line-height: 1.45em; } #mdbook .content p { line-height: 1.45em; }
.content ol { line-height: 1.45em; } #mdbook .content ol { line-height: 1.45em; }
.content ul { line-height: 1.45em; } #mdbook .content ul { line-height: 1.45em; }
.content a { text-decoration: none; } #mdbook .content a { text-decoration: none; }
.content a:hover { text-decoration: underline; } #mdbook .content a:hover { text-decoration: underline; }
.content img, .content video { max-width: 100%; } #mdbook .content img, .content video { max-width: 100%; }
.content .header:link, #mdbook .content .header:link,
.content .header:visited { #mdbook .content .header:visited {
color: var(--fg); color: var(--fg);
} }
.content .header:link, #mdbook .content .header:link,
.content .header:visited:hover { #mdbook .content .header:visited:hover {
text-decoration: none; text-decoration: none;
} }
table { #mdbook table {
margin: 0 auto; margin: 0 auto;
border-collapse: collapse; border-collapse: collapse;
} }
table td { #mdbook table td {
padding: 3px 20px; padding: 3px 20px;
border: 1px var(--table-border-color) solid; border: 1px var(--table-border-color) solid;
} }
table thead { #mdbook table thead {
background: var(--table-header-bg); background: var(--table-header-bg);
} }
table thead td { #mdbook table thead td {
font-weight: 700; font-weight: 700;
border: none; border: none;
} }
table thead th { #mdbook table thead th {
padding: 3px 20px; padding: 3px 20px;
} }
table thead tr { #mdbook table thead tr {
border: 1px var(--table-header-bg) solid; border: 1px var(--table-header-bg) solid;
} }
/* Alternate background colors for rows */ /* Alternate background colors for rows */
table tbody tr:nth-child(2n) { #mdbook table tbody tr:nth-child(2n) {
background: var(--table-alternate-bg); background: var(--table-alternate-bg);
} }
blockquote { #mdbook blockquote {
margin: 20px 0; margin: 20px 0;
padding: 0 20px; padding: 0 20px;
color: var(--fg); color: var(--fg);
background-color: var(--quote-bg); background-color: var(--quote-bg);
border-top: .1em solid var(--quote-border); border-top: .1em solid var(--quote-border);
border-bottom: .1em solid var(--quote-border); border-bottom: .1em solid var(--quote-border);
} }
:not(.footnote-definition) + .footnote-definition, #mdbook :not(.footnote-definition) + .footnote-definition,
.footnote-definition + :not(.footnote-definition) { #mdbook .footnote-definition + :not(.footnote-definition) {
margin-top: 2em; margin-top: 2em;
} }
.footnote-definition { #mdbook .footnote-definition {
font-size: 0.9em; font-size: 0.9em;
margin: 0.5em 0; margin: 0.5em 0;
} }
.footnote-definition p { #mdbook .footnote-definition p {
display: inline; display: inline;
} }
.tooltiptext { #mdbook .tooltiptext {
position: absolute; position: absolute;
visibility: hidden; visibility: hidden;
color: #fff; color: #fff;
background-color: #333; background-color: #333;
transform: translateX(-50%); /* Center by moving tooltip 50% of its width left */ transform: translateX(-50%); /* Center by moving tooltip 50% of its width left */
left: -8px; /* Half of the width of the icon */ left: -8px; /* Half of the width of the icon */
top: -35px; top: -35px;
font-size: 0.8em; font-size: 0.8em;
text-align: center; text-align: center;
border-radius: 6px; border-radius: 6px;
padding: 5px 8px; padding: 5px 8px;
margin: 5px; margin: 5px;
z-index: 1000; z-index: 1000;
} }
.tooltipped .tooltiptext { #mdbook .tooltipped .tooltiptext {
visibility: visible; visibility: visible;
} }
.chapter li.part-title { #mdbook .chapter li.part-title {
color: var(--sidebar-fg); color: var(--sidebar-fg);
margin: 5px 0px; margin: 5px 0px;
font-weight: bold; font-weight: bold;
} }
.result-no-output { #mdbook .result-no-output {
font-style: italic; font-style: italic;
} }

View file

@ -1,54 +1,65 @@
#sidebar, #sidebar,
#menu-bar, #menu-bar,
.nav-chapters, #mdbook .nav-chapters,
.mobile-nav-chapters { #mdbook .mobile-nav-chapters {
display: none; display: none;
} }
#page-wrapper.page-wrapper { #mdbook,
transform: none; #page-wrapper {
margin-left: 0px; margin: 0;
overflow-y: initial; padding: 0;
max-width: none;
transform: none !important;
overflow-y: initial;
} }
#content { #content {
max-width: none; max-width: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
.page { #mdbook .page {
overflow-y: initial; overflow-y: initial;
} }
code { #mdbook code {
background-color: #666666; background-color: #eeeeee;
border-radius: 5px; border-radius: 5px;
/* Force background to be printed in Chrome */ /* Force background to be printed in Chrome */
-webkit-print-color-adjust: exact; -webkit-print-color-adjust: exact;
} }
pre > .buttons { #mdbook pre > .buttons {
z-index: 2; z-index: 2;
} }
a, a:visited, a:active, a:hover { #mdbook a,
color: #4183c4; #mdbook a:visited,
text-decoration: none; #mdbook a:active,
#mdbook a:hover {
color: #4183c4;
text-decoration: none;
} }
h1, h2, h3, h4, h5, h6 { #mdbook h1,
page-break-inside: avoid; #mdbook h2,
page-break-after: avoid; #mdbook h3,
#mdbook h4,
#mdbook h5,
#mdbook h6 {
page-break-inside: avoid;
page-break-after: avoid;
} }
pre, code { #mdbook pre,
page-break-inside: avoid; #mdbook code {
white-space: pre-wrap; page-break-inside: avoid;
white-space: pre-wrap;
} }
.fa { #mdbook .fa {
display: none !important; display: none !important;
} }

View file

@ -2,252 +2,252 @@
/* Globals */ /* Globals */
:root { :root {
--sidebar-width: 300px; --sidebar-width: 300px;
--page-padding: 15px; --page-padding: 15px;
--content-max-width: 750px; --content-max-width: 750px;
--menu-bar-height: 50px; --menu-bar-height: 50px;
} }
/* Themes */ /* Themes */
.ayu { .ayu {
--bg: hsl(210, 25%, 8%); --bg: hsl(210, 25%, 8%);
--fg: #c5c5c5; --fg: #c5c5c5;
--sidebar-bg: #14191f; --sidebar-bg: #14191f;
--sidebar-fg: #c8c9db; --sidebar-fg: #c8c9db;
--sidebar-non-existant: #5c6773; --sidebar-non-existant: #5c6773;
--sidebar-active: #ffb454; --sidebar-active: #ffb454;
--sidebar-spacer: #2d334f; --sidebar-spacer: #2d334f;
--scrollbar: var(--sidebar-fg); --scrollbar: var(--sidebar-fg);
--icons: #737480; --icons: #737480;
--icons-hover: #b7b9cc; --icons-hover: #b7b9cc;
--links: #0096cf; --links: #0096cf;
--inline-code-color: #ffb454; --inline-code-color: #ffb454;
--theme-popup-bg: #14191f; --theme-popup-bg: #14191f;
--theme-popup-border: #5c6773; --theme-popup-border: #5c6773;
--theme-hover: #191f26; --theme-hover: #191f26;
--quote-bg: hsl(226, 15%, 17%); --quote-bg: hsl(226, 15%, 17%);
--quote-border: hsl(226, 15%, 22%); --quote-border: hsl(226, 15%, 22%);
--table-border-color: hsl(210, 25%, 13%); --table-border-color: hsl(210, 25%, 13%);
--table-header-bg: hsl(210, 25%, 28%); --table-header-bg: hsl(210, 25%, 28%);
--table-alternate-bg: hsl(210, 25%, 11%); --table-alternate-bg: hsl(210, 25%, 11%);
--searchbar-border-color: #848484; --searchbar-border-color: #848484;
--searchbar-bg: #424242; --searchbar-bg: #424242;
--searchbar-fg: #fff; --searchbar-fg: #fff;
--searchbar-shadow-color: #d4c89f; --searchbar-shadow-color: #d4c89f;
--searchresults-header-fg: #666; --searchresults-header-fg: #666;
--searchresults-border-color: #888; --searchresults-border-color: #888;
--searchresults-li-bg: #252932; --searchresults-li-bg: #252932;
--search-mark-bg: #e3b171; --search-mark-bg: #e3b171;
} }
.coal { .coal {
--bg: hsl(200, 7%, 8%); --bg: hsl(200, 7%, 8%);
--fg: #98a3ad; --fg: #98a3ad;
--sidebar-bg: #292c2f; --sidebar-bg: #292c2f;
--sidebar-fg: #a1adb8; --sidebar-fg: #a1adb8;
--sidebar-non-existant: #505254; --sidebar-non-existant: #505254;
--sidebar-active: #3473ad; --sidebar-active: #3473ad;
--sidebar-spacer: #393939; --sidebar-spacer: #393939;
--scrollbar: var(--sidebar-fg); --scrollbar: var(--sidebar-fg);
--icons: #43484d; --icons: #43484d;
--icons-hover: #b3c0cc; --icons-hover: #b3c0cc;
--links: #2b79a2; --links: #2b79a2;
--inline-code-color: #c5c8c6; --inline-code-color: #c5c8c6;
--theme-popup-bg: #141617; --theme-popup-bg: #141617;
--theme-popup-border: #43484d; --theme-popup-border: #43484d;
--theme-hover: #1f2124; --theme-hover: #1f2124;
--quote-bg: hsl(234, 21%, 18%); --quote-bg: hsl(234, 21%, 18%);
--quote-border: hsl(234, 21%, 23%); --quote-border: hsl(234, 21%, 23%);
--table-border-color: hsl(200, 7%, 13%); --table-border-color: hsl(200, 7%, 13%);
--table-header-bg: hsl(200, 7%, 28%); --table-header-bg: hsl(200, 7%, 28%);
--table-alternate-bg: hsl(200, 7%, 11%); --table-alternate-bg: hsl(200, 7%, 11%);
--searchbar-border-color: #aaa; --searchbar-border-color: #aaa;
--searchbar-bg: #b7b7b7; --searchbar-bg: #b7b7b7;
--searchbar-fg: #000; --searchbar-fg: #000;
--searchbar-shadow-color: #aaa; --searchbar-shadow-color: #aaa;
--searchresults-header-fg: #666; --searchresults-header-fg: #666;
--searchresults-border-color: #98a3ad; --searchresults-border-color: #98a3ad;
--searchresults-li-bg: #2b2b2f; --searchresults-li-bg: #2b2b2f;
--search-mark-bg: #355c7d; --search-mark-bg: #355c7d;
} }
.light { .light {
--bg: hsl(0, 0%, 100%); --bg: hsl(0, 0%, 100%);
--fg: hsl(0, 0%, 0%); --fg: hsl(0, 0%, 0%);
--sidebar-bg: #fafafa; --sidebar-bg: #fafafa;
--sidebar-fg: hsl(0, 0%, 0%); --sidebar-fg: hsl(0, 0%, 0%);
--sidebar-non-existant: #aaaaaa; --sidebar-non-existant: #aaaaaa;
--sidebar-active: #1f1fff; --sidebar-active: #1f1fff;
--sidebar-spacer: #f4f4f4; --sidebar-spacer: #f4f4f4;
--scrollbar: #8F8F8F; --scrollbar: #8F8F8F;
--icons: #747474; --icons: #747474;
--icons-hover: #000000; --icons-hover: #000000;
--links: #20609f; --links: #20609f;
--inline-code-color: #301900; --inline-code-color: #301900;
--theme-popup-bg: #fafafa; --theme-popup-bg: #fafafa;
--theme-popup-border: #cccccc; --theme-popup-border: #cccccc;
--theme-hover: #e6e6e6; --theme-hover: #e6e6e6;
--quote-bg: hsl(197, 37%, 96%); --quote-bg: hsl(197, 37%, 96%);
--quote-border: hsl(197, 37%, 91%); --quote-border: hsl(197, 37%, 91%);
--table-border-color: hsl(0, 0%, 95%); --table-border-color: hsl(0, 0%, 95%);
--table-header-bg: hsl(0, 0%, 80%); --table-header-bg: hsl(0, 0%, 80%);
--table-alternate-bg: hsl(0, 0%, 97%); --table-alternate-bg: hsl(0, 0%, 97%);
--searchbar-border-color: #aaa; --searchbar-border-color: #aaa;
--searchbar-bg: #fafafa; --searchbar-bg: #fafafa;
--searchbar-fg: #000; --searchbar-fg: #000;
--searchbar-shadow-color: #aaa; --searchbar-shadow-color: #aaa;
--searchresults-header-fg: #666; --searchresults-header-fg: #666;
--searchresults-border-color: #888; --searchresults-border-color: #888;
--searchresults-li-bg: #e4f2fe; --searchresults-li-bg: #e4f2fe;
--search-mark-bg: #a2cff5; --search-mark-bg: #a2cff5;
} }
.navy { .navy {
--bg: hsl(226, 23%, 11%); --bg: hsl(226, 23%, 11%);
--fg: #bcbdd0; --fg: #bcbdd0;
--sidebar-bg: #282d3f; --sidebar-bg: #282d3f;
--sidebar-fg: #c8c9db; --sidebar-fg: #c8c9db;
--sidebar-non-existant: #505274; --sidebar-non-existant: #505274;
--sidebar-active: #2b79a2; --sidebar-active: #2b79a2;
--sidebar-spacer: #2d334f; --sidebar-spacer: #2d334f;
--scrollbar: var(--sidebar-fg); --scrollbar: var(--sidebar-fg);
--icons: #737480; --icons: #737480;
--icons-hover: #b7b9cc; --icons-hover: #b7b9cc;
--links: #2b79a2; --links: #2b79a2;
--inline-code-color: #c5c8c6; --inline-code-color: #c5c8c6;
--theme-popup-bg: #161923; --theme-popup-bg: #161923;
--theme-popup-border: #737480; --theme-popup-border: #737480;
--theme-hover: #282e40; --theme-hover: #282e40;
--quote-bg: hsl(226, 15%, 17%); --quote-bg: hsl(226, 15%, 17%);
--quote-border: hsl(226, 15%, 22%); --quote-border: hsl(226, 15%, 22%);
--table-border-color: hsl(226, 23%, 16%); --table-border-color: hsl(226, 23%, 16%);
--table-header-bg: hsl(226, 23%, 31%); --table-header-bg: hsl(226, 23%, 31%);
--table-alternate-bg: hsl(226, 23%, 14%); --table-alternate-bg: hsl(226, 23%, 14%);
--searchbar-border-color: #aaa; --searchbar-border-color: #aaa;
--searchbar-bg: #aeaec6; --searchbar-bg: #aeaec6;
--searchbar-fg: #000; --searchbar-fg: #000;
--searchbar-shadow-color: #aaa; --searchbar-shadow-color: #aaa;
--searchresults-header-fg: #5f5f71; --searchresults-header-fg: #5f5f71;
--searchresults-border-color: #5c5c68; --searchresults-border-color: #5c5c68;
--searchresults-li-bg: #242430; --searchresults-li-bg: #242430;
--search-mark-bg: #a2cff5; --search-mark-bg: #a2cff5;
} }
.rust { .rust {
--bg: hsl(60, 9%, 87%); --bg: hsl(60, 9%, 87%);
--fg: #262625; --fg: #262625;
--sidebar-bg: #3b2e2a; --sidebar-bg: #3b2e2a;
--sidebar-fg: #c8c9db; --sidebar-fg: #c8c9db;
--sidebar-non-existant: #505254; --sidebar-non-existant: #505254;
--sidebar-active: #e69f67; --sidebar-active: #e69f67;
--sidebar-spacer: #45373a; --sidebar-spacer: #45373a;
--scrollbar: var(--sidebar-fg); --scrollbar: var(--sidebar-fg);
--icons: #737480; --icons: #737480;
--icons-hover: #262625; --icons-hover: #262625;
--links: #2b79a2; --links: #2b79a2;
--inline-code-color: #6e6b5e; --inline-code-color: #6e6b5e;
--theme-popup-bg: #e1e1db; --theme-popup-bg: #e1e1db;
--theme-popup-border: #b38f6b; --theme-popup-border: #b38f6b;
--theme-hover: #99908a; --theme-hover: #99908a;
--quote-bg: hsl(60, 5%, 75%); --quote-bg: hsl(60, 5%, 75%);
--quote-border: hsl(60, 5%, 70%); --quote-border: hsl(60, 5%, 70%);
--table-border-color: hsl(60, 9%, 82%); --table-border-color: hsl(60, 9%, 82%);
--table-header-bg: #b3a497; --table-header-bg: #b3a497;
--table-alternate-bg: hsl(60, 9%, 84%); --table-alternate-bg: hsl(60, 9%, 84%);
--searchbar-border-color: #aaa; --searchbar-border-color: #aaa;
--searchbar-bg: #fafafa; --searchbar-bg: #fafafa;
--searchbar-fg: #000; --searchbar-fg: #000;
--searchbar-shadow-color: #aaa; --searchbar-shadow-color: #aaa;
--searchresults-header-fg: #666; --searchresults-header-fg: #666;
--searchresults-border-color: #888; --searchresults-border-color: #888;
--searchresults-li-bg: #dec2a2; --searchresults-li-bg: #dec2a2;
--search-mark-bg: #e69f67; --search-mark-bg: #e69f67;
} }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
.light.no-js { .light.no-js {
--bg: hsl(200, 7%, 8%); --bg: hsl(200, 7%, 8%);
--fg: #98a3ad; --fg: #98a3ad;
--sidebar-bg: #292c2f; --sidebar-bg: #292c2f;
--sidebar-fg: #a1adb8; --sidebar-fg: #a1adb8;
--sidebar-non-existant: #505254; --sidebar-non-existant: #505254;
--sidebar-active: #3473ad; --sidebar-active: #3473ad;
--sidebar-spacer: #393939; --sidebar-spacer: #393939;
--scrollbar: var(--sidebar-fg); --scrollbar: var(--sidebar-fg);
--icons: #43484d; --icons: #43484d;
--icons-hover: #b3c0cc; --icons-hover: #b3c0cc;
--links: #2b79a2; --links: #2b79a2;
--inline-code-color: #c5c8c6; --inline-code-color: #c5c8c6;
--theme-popup-bg: #141617; --theme-popup-bg: #141617;
--theme-popup-border: #43484d; --theme-popup-border: #43484d;
--theme-hover: #1f2124; --theme-hover: #1f2124;
--quote-bg: hsl(234, 21%, 18%); --quote-bg: hsl(234, 21%, 18%);
--quote-border: hsl(234, 21%, 23%); --quote-border: hsl(234, 21%, 23%);
--table-border-color: hsl(200, 7%, 13%); --table-border-color: hsl(200, 7%, 13%);
--table-header-bg: hsl(200, 7%, 28%); --table-header-bg: hsl(200, 7%, 28%);
--table-alternate-bg: hsl(200, 7%, 11%); --table-alternate-bg: hsl(200, 7%, 11%);
--searchbar-border-color: #aaa; --searchbar-border-color: #aaa;
--searchbar-bg: #b7b7b7; --searchbar-bg: #b7b7b7;
--searchbar-fg: #000; --searchbar-fg: #000;
--searchbar-shadow-color: #aaa; --searchbar-shadow-color: #aaa;
--searchresults-header-fg: #666; --searchresults-header-fg: #666;
--searchresults-border-color: #98a3ad; --searchresults-border-color: #98a3ad;
--searchresults-li-bg: #2b2b2f; --searchresults-li-bg: #2b2b2f;
--search-mark-bg: #355c7d; --search-mark-bg: #355c7d;
} }
} }

View file

@ -67,12 +67,12 @@ async fn mdbook_page(request: app::HttpRequest) -> ResultPage<Markup, FatalError
AssetsOp::<StyleSheet>::Add(StyleSheet::located("/doc/ayu-highlight.css")) AssetsOp::<StyleSheet>::Add(StyleSheet::located("/doc/ayu-highlight.css"))
)); ));
page.add_to( page.add_to(
"region-content", "region-content",
Container::new() Container::new()
.with_id("mdbook") .with_id("mdbook")
.with_component(Html::with(html! { (PreEscaped(html)) })) .with_component(Html::with(html! { (PreEscaped(html)) }))
) )
.render() .render()
} else { } else {
Err(FatalError::NotFound) Err(FatalError::NotFound)
} }