Expand table of contents and show background colors while printing

This commit is contained in:
BBaoVanC 2021-11-18 17:47:31 -06:00
parent d0c216165e
commit 217e54c1b5
Signed by: bbaovanc
GPG Key ID: 18089E4E3CCF1D3A
3 changed files with 36 additions and 5 deletions

View File

@ -149,16 +149,22 @@
margin: 15px 0; margin: 15px 0;
} }
#table-of-contents { .table-of-contents {
background-color: #222; background-color: #222;
padding: 8px 20px; padding: 8px 20px;
border-radius: 8px; border-radius: 8px;
margin: 10px 0;
} }
#table-of-contents summary { .table-of-contents summary {
cursor: pointer; cursor: pointer;
} }
.table-of-contents.print {
display: none;
padding: 8px 15px;
}
.content, .content,
footer { footer {
margin: 20px; margin: 20px;
@ -497,7 +503,7 @@ li.disabled > .page-link:hover {
.series-taxonomy li, .series-taxonomy li,
.series-box, .series-box,
.prevnext > *, .prevnext > *,
#table-of-contents { .table-of-contents {
background-color: #ddd; background-color: #ddd;
} }
@ -559,7 +565,19 @@ li.disabled > .page-link:hover {
display: none; display: none;
} }
* {
color-adjust: exact;
}
body { body {
background-color: white; background-color: white;
} }
.table-of-contents {
display: none;
}
.table-of-contents.print {
display: block;
}
} }

View File

@ -2,7 +2,6 @@
.chroma { .chroma {
color: black; color: black;
} }
/* Background */ .chroma { background-color: #f8f8f8 }
/* Other */ .chroma .x { color: #000000 } /* Other */ .chroma .x { color: #000000 }
/* Error */ .chroma .err { color: #a40000 } /* Error */ .chroma .err { color: #a40000 }
/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; } /* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
@ -85,3 +84,13 @@
/* GenericUnderline */ .chroma .gl { color: #000000; text-decoration: underline } /* GenericUnderline */ .chroma .gl { color: #000000; text-decoration: underline }
/* TextWhitespace */ .chroma .w { color: #f8f8f8; text-decoration: underline } /* TextWhitespace */ .chroma .w { color: #f8f8f8; text-decoration: underline }
} }
@media (prefers-color-scheme: light) {
/* Background */ .chroma { background-color: #f8f8f8 }
}
@media print {
.chroma {
background-color: white;
}
}

View File

@ -31,12 +31,16 @@
{{ if .Params.Toc }} {{ if .Params.Toc }}
<div id="table-of-contents"> <div class="table-of-contents">
<details> <details>
<summary>{{ i18n "table_of_contents" }}</summary> <summary>{{ i18n "table_of_contents" }}</summary>
{{ .TableOfContents }} {{ .TableOfContents }}
</details> </details>
</div> </div>
<div class="table-of-contents print">
{{ i18n "table_of_contents" }}
{{ .TableOfContents }}
</div>
{{ end }} {{ end }}
{{ with .Resources.GetMatch "feature" }} {{ with .Resources.GetMatch "feature" }}