Debian Codegraph @

docutils/writers/html5_polyglot/responsive.css

raw symbols SCIP
1 /* CSS3_ style sheet for the output of Docutils HTML5 writer. */
2 /* Generic responsive design for all screen sizes. */
3 /* */
4 /* :Author: Günter Milde */
5 /* */
6 /* :Id: $Id: responsive.css 10264 2025-11-28 13:51:41Z milde $ */
7 /* :Copyright: © 2021 Günter Milde. */
8 /* :License: Released under the terms of the `2-Clause BSD license`_, */
9 /* in short: */
10 /* */
11 /* Copying and distribution of this file, with or without modification, */
12 /* are permitted in any medium without royalty provided the copyright */
13 /* notice and this notice are preserved. */
14 /* */
15 /* This file is offered as-is, without any warranty. */
16 /* */
17 /* .. _2-Clause BSD license: http://www.spdx.org/licenses/BSD-2-Clause */
18 /* .. _CSS3: https://www.w3.org/Style/CSS/ */
19
20 /* Note: */
21 /* This style sheet is provisional: */
22 /* the API is not settled and may change with any minor Docutils version. */
23
24
25
26 /* General Settings */
27 /* ================ */
28
29
30 * { box-sizing: border-box; }
31
32 body {
33 background-color: #fafaf6;
34 margin: auto;
35 --field-indent: 6.6em; /* indent of fields in field lists */
36 --sidebar-margin-right: 0; /* adapted in media queries below */
37 }
38 main {
39 counter-reset: figure table;
40 }
41 body > * {
42 background-color: white;
43 line-height: 1.6;
44 padding: 0.5rem calc(29% - 7.2rem); /* go from 5% to 15% (8.15em/54em) */
45 margin: auto;
46 max-width: 100rem;
47 }
48 sup, sub { /* avoid additional inter-line space for lines with sup/sub */
49 line-height: 1;
50 }
51
52 /* Vertical Space (Parskip) */
53 p, ol, ul, dl, li,
54 .topic,
55 .footnote, .citation,
56 div > math,
57 table {
58 margin-top: 0.5em;
59 margin-bottom: 0.5em;
60 }
61 h1, h2, h3, h4, h5, h6,
62 dl > dd, details > p:last-child {
63 margin-bottom: 0.5em;
64 }
65
66 /* Indented Blocks */
67 blockquote, figure, .topic {
68 margin: 1em 2%;
69 padding-left: 1em;
70 }
71 div.line-block div.line-block,
72 pre, dd, dl.option-list {
73 margin-left: calc(2% + 1em);
74 }
75 /* but not in a table cell */
76 td pre, td dl.option-list {
77 margin-left: 0;
78 }
79
80
81 /* Object styling */
82 /* ============== */
83
84 footer, header {
85 font-size: small;
86 }
87
88 /* Frontmatter */
89 div.dedication {
90 padding: 0;
91 margin: 1.4em 0;
92 font-style: italic;
93 font-size: large;
94 }
95 .dedication p.topic-title {
96 display: none;
97 }
98
99 blockquote p.attribution {
100 text-align: right;
101 }
102
103 /* Table of Contents */
104 nav.contents ul {
105 padding-left: 1em;
106 }
107 ul.auto-toc > li > p { /* hanging indent */
108 padding-left: 1em;
109 text-indent: -1em;
110 }
111 main > nav.contents ul:not(.auto-toc) {
112 list-style-type: square;
113 }
114 main > nav.contents ul ul:not(.auto-toc) {
115 list-style-type: disc;
116 }
117 main > nav.contents ul ul ul:not(.auto-toc) {
118 list-style-type: '\2B29\ ';
119 }
120 main > nav.contents ul ul ul ul:not(.auto-toc) {
121 list-style-type: '\2B1D\ ';
122 }
123 main > nav.contents ul ul ul ul ul:not(.auto-toc) {
124 list-style-type: '\2B2A\ ';
125 }
126 nav.contents ul > li::marker {
127 color: grey;
128 }
129
130 /* Transitions */
131 hr {
132 margin: 1em 10%;
133 }
134
135 /* Lists */
136
137 ul, ol {
138 padding-left: 2em; /* allow for 2-digit numbers */
139 }
140 dl.field-list.narrow {
141 --field-indent: 2.4em;
142 }
143 dl.field-list > dd,
144 dl.docinfo > dd {
145 margin-left: var(--field-indent); /* adapted in media queries or HTML */
146 }
147 dl.option-list > dd {
148 margin-left: 20%;
149 }
150 /* run-in: start field-body on same line after long field names */
151 dl.field-list.run-in > dd p {
152 display: block;
153 }
154 /* "description style" like in most dictionaries, encyclopedias etc. */
155 dl.description {
156 display: flow-root;
157 }
158 dl.description > dt {
159 clear: left;
160 float: left;
161 margin: 0;
162 padding: 0;
163 padding-right: 0.3em;
164 font-weight: bold;
165 }
166 dl.description > dd:after {
167 display: table;
168 content: "";
169 clear: left; /* clearfix for empty descriptions */
170 }
171 /* start lists nested in description/field lists on new line */
172 dd > dl:first-child,
173 dd > ul:first-child,
174 dd > ol:first-child {
175 clear: left;
176 }
177
178 /* disclosures */
179 details { padding-left: 1em; }
180 summary { margin-left: -1em; }
181
182 /* Footnotes and Citations */
183 .footnote {
184 font-size: small;
185 }
186
187 /* Images, Figures, and Tables */
188 figcaption,
189 table > caption {
190 /* font-size: small; */
191 font-style: italic;
192 }
193 figcaption > .legend {
194 font-size: small;
195 font-style: initial;
196 }
197 figure.numbered > figcaption > p:before {
198 counter-increment: figure;
199 content: "Figure " counter(figure) ": ";
200 font-weight: bold;
201 font-style: initial;
202 }
203
204 table tr {
205 text-align: left;
206 vertical-align: top;
207 }
208 td *:first-child { margin-top: 0; }
209 td *:last-child { margin-bottom: 0; }
210 table.booktabs { /* "booktabs" style (no vertical lines) */
211 border-top: 2px solid;
212 border-bottom: 2px solid;
213 }
214 table.booktabs * {
215 border: 0;
216 }
217 table.booktabs th {
218 border-bottom: thin solid;
219 }
220 table.numbered > caption:before {
221 counter-increment: table;
222 content: "Table " counter(table) ": ";
223 font-weight: bold;
224 font-style: initial;
225 }
226
227 /* Admonitions and System Messages */
228 .admonition,
229 div.system-message {
230 border: thin solid silver;
231 margin: 1em 2%;
232 padding: 0.5em 1em;
233 }
234 .caution p.admonition-title,
235 .attention p.admonition-title,
236 .danger p.admonition-title,
237 .warning p.admonition-title,
238 div.error {
239 color: maroon;
240 }
241 div.system-message > p > span.literal {
242 overflow-wrap: break-word;
243 }
244
245 /* Literal and Code */
246 pre.literal-block, pre.doctest{
247 padding: 0.2em;
248 overflow-x: auto;
249 }
250 .literal-block, .doctest, span.literal {
251 background-color: #f0f5f3;
252 }
253 .system-message span.literal {
254 background-color: inherit;
255 }
256
257 /* basic highlighting: for a complete scheme, see */
258 /* https://docutils.sourceforge.io/sandbox/stylesheets/ */
259 pre.code .comment, code .comment { color: #5C6576 }
260 pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
261 pre.code .literal.string, code .literal.string { color: #0C5404 }
262 pre.code .name.builtin, code .name.builtin { color: #352B84 }
263 pre.code .deleted, code .deleted { background-color: #DEB0A1}
264 pre.code .inserted, code .inserted { background-color: #A3D289}
265
266 /* Hyperlink References */
267 a {
268 text-decoration: none; /* for chromium */
269 /* Wrap links at any place, if this is the only way to prevent overflow */
270 overflow-wrap: break-word;
271 }
272 .contents a, a.toc-backref, a.citation-reference {
273 overflow-wrap: inherit;
274 }
275 /* Undecorated Links (see also minimal.css) */
276 /* a.citation-reference, */
277 .citation a.fn-backref {
278 color: inherit;
279 }
280 a:hover {
281 text-decoration: underline;
282 }
283 *:hover > a.toc-backref:after,
284 .topic-title:hover > a:after {
285 content: " \2191"; /* ↑ UPWARDS ARROW */
286 color: grey;
287 }
288 *:hover > a.self-link:after {
289 content: "\1F517"; /* LINK SYMBOL */
290 color: grey;
291 font-size: smaller;
292 margin-left: 0.2em;
293 }
294 /* highlight specific targets of the current URL */
295 section:target > h2, section:target > h3, section:target > h4,
296 section:target > h5, section:target > h6,
297 span:target + h2, span:target + h3, span:target + h4,
298 span:target + h5, span:target + h6,
299 dt:target, span:target, p:target,
300 .contents :target,
301 .contents:target > .topic-title,
302 aside.system-message:target,
303 [role="doc-biblioentry"]:target,
304 [role="doc-biblioref"]:target,
305 [role="note"]:target, /* Docutils 0.18 and 0.19 */
306 [role="doc-footnote"]:target, /* Docutils >= 0.20 */
307 [role="doc-noteref"]:target {
308 background-color: #d2e6ec;
309 }
310
311 /* Block Alignment */
312 /* Let content flow to the side of aligned images and figures */
313
314 /* no floats around this elements */
315 footer, header, hr,
316 h1, h2, h3 {
317 clear: both;
318 }
319
320 img.align-left,
321 svg.align-left,
322 video.align-left,
323 figure.align-left,
324 div.align-left,
325 table.align-left {
326 margin-left: 0;
327 padding-left: 0;
328 margin-right: 0.5em;
329 clear: left;
330 float: left;
331 }
332 img.align-right,
333 svg.align-right,
334 video.align-right,
335 figure.align-right,
336 div.align-right,
337 table.align-right {
338 margin-left: 0.5em;
339 margin-right: 0;
340 clear: right;
341 float: right;
342 }
343
344 /* Margin Elements */
345 /* see below for screen size dependent rules */
346 .sidebar,
347 .marginal,
348 .admonition.marginal {
349 max-width: 40%;
350 border: none;
351 background-color: #efefea;
352 margin: 0.5em var(--sidebar-margin-right) 0.5em 1em;
353 padding: 0.5em;
354 padding-left: 0.7em;
355 clear: right;
356 float: right;
357 font-size: small;
358 }
359 .sidebar {
360 width: 40%;
361 }
362
363 /* Adaptive page layout */
364 /* ==================== */
365
366 @media (max-width: 30em) {
367 /* Smaller margins and no floating elements for small screens */
368 /* (main text less than 40 characters/line) */
369 body > * {
370 padding: 0.5rem 5%;
371 line-height: 1.4
372 }
373 .sidebar,
374 .marginal,
375 .admonition.marginal {
376 width: auto;
377 max-width: 100%;
378 float: none;
379 }
380 dl.option-list,
381 pre {
382 margin-left: 0;
383 }
384 body {
385 --field-indent: 4em;
386 }
387 dl.docinfo {
388 --field-indent: 5%;
389 }
390 pre, pre * {
391 font-size: 0.9em;
392 /* overflow: auto; */
393 }
394 }
395
396 @media (min-width: 54em) {
397 /* Move ToC to the left */
398 /* Main text width before: 70% ≙ 35em ≙ 75…95 chrs (Dejavu/Times) */
399 /* after: ≳ 30em ≙ 54…70 chrs (Dejavu/Times) */
400 body.with-toc {
401 padding-left: 8%;
402 }
403 body.with-toc > * {
404 margin-left: 0;
405 padding-left: 22rem; /* fallback for webkit */
406 padding-left: min(22%, 22rem);
407 padding-right: 7%;
408 }
409 main > nav.contents { /* global ToC */
410 position: fixed;
411 top: 0;
412 left: 0;
413 width: min(25%, 25em);
414 height: 100vh;
415 margin: 0;
416 background-color: #fafaf6;
417 padding: 1em 2% 0 2%;
418 overflow: auto;
419 }
420 main > nav.contents > * {
421 padding-left: 0;
422 line-height: 1.4;
423 }
424 main > nav.contents a {
425 color: inherit;
426 }
427 }
428
429 @media (min-width: 70em) {
430 body {
431 --field-indent: 9em;
432 }
433 }
434
435 @media (min-width: 77em) {
436 /* Move marginalia to 6rem from right border */
437 /* .sidebar, */
438 /* .marginal, */
439 /* .admonition.marginal { */
440 /* margin-right: calc(6rem - 15%); */
441 /* } */
442 /* BUG: margin is calculated for break point width */
443 /* workaround: variable + many breakpoints */
444 body > * {
445 padding-left: 18%;
446 padding-right: 28%; /* fallback for webkit */
447 padding-right: min(28%, 28rem);
448 --sidebar-margin-right: -20rem;
449 }
450 /* limit main text to ~ 50em ≙ 85…100 characters DejaVu rsp. …120 Times */
451 body.with-toc > * {
452 padding-left: min(22%, 22rem);
453 padding-right: calc(78% - 50rem); /* fallback for webkit */
454 padding-right: min(78% - 50rem, 28rem);
455 --sidebar-margin-right: 0;
456 }
457 }
458
459 @media (min-width: 85em) {
460 body.with-toc > * {
461 --sidebar-margin-right: -9rem;
462 }
463 }
464
465 @media (min-width: 90em) {
466 /* move marginalia into the margin */
467 body > * {
468 padding-left: min(22%, 22rem);
469 --sidebar-margin-right: -23rem;
470 }
471 body.with-toc > * {
472 --sidebar-margin-right: -14rem;
473 }
474 }
475
476 @media (min-width: 99em) {
477 /* move marginalia out of main text area */
478 body.with-toc > * {
479 --sidebar-margin-right: -20rem;
480 }
481 body > *, body.with-toc > * { /* for webkit */
482 padding-left: 22rem;
483 padding-right: 28rem;
484 }
485 .admonition.marginal,
486 .marginal {
487 width: 40%; /* make marginal figures, ... "full width" */
488 }
489 }
490
491 @media (min-width: 104em) {
492 body.with-toc > * {
493 --sidebar-margin-right: -23rem;
494 }
495 }