tuftig.css 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568
  1. /* CSS3_ style sheet for the output of Docutils HTML writers. */
  2. /* Rules inspired by Edward Tufte's layout design. */
  3. /* */
  4. /* :Author: Günter Milde */
  5. /* based on tufte.css_ by Dave Liepmann */
  6. /* and the tufte-latex_ package. */
  7. /* */
  8. /* :Id: $Id: tuftig.css 9081 2022-06-19 20:23:12Z milde $ */
  9. /* :Copyright: © 2020 Günter Milde. */
  10. /* :License: Released under the terms of the `2-Clause BSD license`_, */
  11. /* in short: */
  12. /* */
  13. /* Copying and distribution of this file, with or without modification, */
  14. /* are permitted in any medium without royalty provided the copyright */
  15. /* notice and this notice are preserved. */
  16. /* */
  17. /* This file is offered as-is, without any warranty. */
  18. /* */
  19. /* .. _2-Clause BSD license: http://www.spdx.org/licenses/BSD-2-Clause */
  20. /* .. _CSS3: https://www.w3.org/Style/CSS/ */
  21. /* .. _tufte.css: https://edwardtufte.github.io/tufte-css/ */
  22. /* .. _tufte-latex_: https://www.ctan.org/pkg/tufte-latex */
  23. /* General Settings */
  24. /* ================ */
  25. body {
  26. font-family: et-book, Palatino, Georgia, serif;
  27. background-color: #fafaf6;
  28. font-size: 1.2em;
  29. line-height: 1.4;
  30. margin: auto;
  31. }
  32. main {
  33. counter-reset: figure table;
  34. }
  35. main, header, footer {
  36. padding: 0.5em 5%;
  37. background-color: #fefef8;
  38. max-width: 100rem;
  39. }
  40. /* Spacing */
  41. /* vertical space (parskip) */
  42. p, ol, ul, dl, li,
  43. h1, h2, h3, h4, h5, h6,
  44. div.line-block,
  45. .topic,
  46. .footnote, .citation,
  47. table {
  48. margin-top: 0.5em;
  49. margin-bottom: 0.5em;
  50. }
  51. dl > dd {
  52. margin-bottom: 0.5em;
  53. }
  54. /* exceptions */
  55. p:first-child {
  56. margin-top: 0;
  57. }
  58. p:last-child {
  59. margin-bottom: 0;
  60. }
  61. /* Indented Blocks */
  62. blockquote,
  63. .topic {
  64. /* background-color: Honeydew; */
  65. margin: 0.5em 2%;
  66. padding-left: 1em;
  67. }
  68. div.line-block div.line-block,
  69. dl.option-list,
  70. figure > img,
  71. pre.literal-block, pre.math,
  72. pre.doctest-block, pre.code {
  73. /* background-color: LightCyan; */
  74. margin-left: calc(2% + 1em);
  75. }
  76. /* Object styling */
  77. /* ============== */
  78. footer, header {
  79. font-size: smaller;
  80. }
  81. /* Titles and Headings */
  82. h2, h3, h4, p.subtitle, p.section-subtitle,
  83. p.topic-title, p.sidebar-title, p.sidebar-subtitle {
  84. font-weight: normal;
  85. font-style: italic;
  86. text-align: left;
  87. }
  88. .sectnum {
  89. font-style: normal;
  90. }
  91. h1.title {
  92. text-align: left;
  93. margin-top: 2.4em;
  94. margin-bottom: 2em;
  95. font-size: 2.4em;
  96. }
  97. h1 + p.subtitle {
  98. margin-top: -2em;
  99. margin-bottom: 2em;
  100. font-size: 2.0em;
  101. }
  102. section {
  103. margin-top: 2em;
  104. }
  105. h2, .contents > p.topic-title {
  106. font-size: 2.2em;
  107. }
  108. h2 + p.section-subtitle {
  109. font-size: 1.6em;
  110. }
  111. h3 {
  112. font-size: 1.2em;
  113. }
  114. h3 + p.section-subtitle {
  115. font-size: 1.1em;
  116. }
  117. h4 {
  118. font-size: 1em;
  119. }
  120. p.section-subtitle {
  121. font-size: 1em;
  122. }
  123. /* Dedication and Abstract */
  124. div.dedication {
  125. padding: 0;
  126. margin-left: 0;
  127. font-style: italic;
  128. font-size: 1.2em;
  129. }
  130. /* div.abstract p.topic-title, */
  131. div.dedication p.topic-title {
  132. display: none;
  133. }
  134. /* Attribution */
  135. blockquote p.attribution,
  136. .topic p.attribution {
  137. text-align: right;
  138. }
  139. /* Table of Contents */
  140. nav.contents {
  141. padding: 0;
  142. font-style: italic;
  143. }
  144. ul.auto-toc > li > p {
  145. padding-left: 1em;
  146. text-indent: -1em;
  147. }
  148. nav.contents ul {
  149. padding-left: 1em;
  150. }
  151. /* Transitions */
  152. hr {
  153. border: 0;
  154. border-top: 1px solid #ccc;
  155. margin: 1em 10%;
  156. }
  157. /* Lists */
  158. /* Less indent per level */
  159. ul, ol {
  160. padding-left: 1.1em;
  161. }
  162. dd {
  163. margin-left: 1.5em;
  164. }
  165. dd > dl:first-child,
  166. dd > ul:first-child,
  167. dd > ol:first-child {
  168. /* lists nested in definition/description/field lists */
  169. clear: left;
  170. }
  171. dl.field-list > dd,
  172. dl.docinfo > dd,
  173. dl.option-list > dd {
  174. margin-left: 4em;
  175. }
  176. /* example for custom field-name width */
  177. dl.field-list.narrow > dd {
  178. margin-left: 3em;
  179. }
  180. /* run-in: start field-body on same line after long field names */
  181. dl.field-list.run-in > dd p {
  182. display: block;
  183. }
  184. /* italic field name */
  185. dl.description > dt,
  186. dl.field-list > dt,
  187. dl.docinfo > dt {
  188. font-weight: normal;
  189. font-style: italic;
  190. }
  191. /* "description style" like in most dictionaries, encyclopedias etc. */
  192. dl.description > dt {
  193. clear: left;
  194. float: left;
  195. margin: 0;
  196. padding: 0;
  197. padding-right: 0.5em;
  198. }
  199. dl.description > dd:after {
  200. display: block;
  201. content: "";
  202. clear: both;
  203. }
  204. /* Citation list (style as description list) */
  205. .citation-list,
  206. .footnote-list {
  207. display: contents;
  208. }
  209. .citation {
  210. padding-left: 1.5em;
  211. }
  212. .citation .label {
  213. margin-left: -1.5em;
  214. }
  215. /* Images and Figures */
  216. img {
  217. display: block;
  218. }
  219. p > img, p > a > img,
  220. figure > img, figure > a > img {
  221. display: inline;
  222. }
  223. /* Caption to the left (if there is space) or below: */
  224. figure {
  225. display: flex;
  226. flex-wrap: wrap;
  227. align-items: flex-start;
  228. margin: 0.5em 2%;
  229. padding-left: 1em;
  230. }
  231. figure > img,
  232. figure.fullwidth > img {
  233. margin: 0 0.5em 0.5em 0;
  234. padding: 0;
  235. }
  236. figcaption {
  237. font-size: 0.8em;
  238. }
  239. .fullwidth > figcaption {
  240. font-size: inherit;
  241. }
  242. figure.numbered > figcaption > p:before {
  243. counter-increment: figure;
  244. content: "Figure " counter(figure) ": ";
  245. }
  246. /* Tables */
  247. table tr {
  248. text-align: left;
  249. }
  250. /* th { vertical-align: bottom; } */
  251. /* "booktabs" style (no vertical lines) */
  252. table.booktabs {
  253. border-top: 2px solid;
  254. border-bottom: 2px solid;
  255. }
  256. table.booktabs * {
  257. border: 0;
  258. }
  259. table.booktabs th {
  260. border-bottom: thin solid;
  261. }
  262. table.numbered > caption:before {
  263. counter-increment: table;
  264. content: "Table " counter(table) ": ";
  265. }
  266. /* Admonitions and System Messages */
  267. .admonition, .system-message {
  268. border-style: solid;
  269. border-color: silver;
  270. border-width: thin;
  271. margin: 1em 0;
  272. padding: 0.5em;
  273. }
  274. .caution p.admonition-title,
  275. .attention p.admonition-title,
  276. .danger p.admonition-title,
  277. .warning p.admonition-title,
  278. div.error {
  279. color: maroon;
  280. }
  281. /* Literal and Code */
  282. pre.literal-block, pre.doctest-block,
  283. pre.math, pre.code {
  284. /* font-family: Consolas, "Liberation Mono", Menlo, monospace; */
  285. /* font-size: 0.9em; */
  286. overflow: auto;
  287. }
  288. /* basic highlighting: for a complete scheme, see */
  289. /* https://docutils.sourceforge.io/sandbox/stylesheets/ */
  290. pre.code .comment, code .comment { color: #5C6576 }
  291. pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
  292. pre.code .literal.string, code .literal.string { color: #0C5404 }
  293. pre.code .name.builtin, code .name.builtin { color: #352B84 }
  294. pre.code .deleted, code .deleted { background-color: #DEB0A1}
  295. pre.code .inserted, code .inserted { background-color: #A3D289}
  296. .sans {
  297. font-family: "Gill Sans", "Gill Sans MT", Calibri, "Lucida Sans", "Noto Sans", sans-serif;
  298. letter-spacing: .02em;
  299. }
  300. /* Hyperlink References */
  301. /* underline that clears descenders */
  302. a {
  303. color: inherit;
  304. }
  305. a:link {
  306. text-decoration: underline;
  307. /* text-decoration-skip-ink: auto; nonstandard selector */
  308. }
  309. /* undecorated links */
  310. .contents a:link, a.toc-backref:link, a.image-reference:link,
  311. a[role="doc-noteref"]:link, a[role="doc-backlink"]:link, .backrefs a:link,
  312. a.citation-reference:link,
  313. a[href^="#system-message"] {
  314. text-decoration: none;
  315. }
  316. a:link:hover {
  317. text-decoration: underline;
  318. }
  319. /* Block Alignment */
  320. /* Let content flow to the side of aligned images and figures */
  321. /* (does not work if the image/figure is a grid element). */
  322. /* no floats around this elements */
  323. footer, header,
  324. hr.docutils,
  325. h1, h2, h3, .contents > p.topic-title,
  326. .fullwidth {
  327. clear: both;
  328. }
  329. img.align-left,
  330. figure.align-left,
  331. table.align-left {
  332. margin-left: 0;
  333. padding-left: 0;
  334. padding-right: 0.5em;
  335. clear: left;
  336. float: left;
  337. }
  338. figure.align-left > img {
  339. margin-left: 0;
  340. padding-left: 0;
  341. }
  342. img.align-right {
  343. padding-left: 0.5em;
  344. clear: right;
  345. float: right;
  346. }
  347. figure.align-right {
  348. clear: right;
  349. float: right;
  350. }
  351. figure.align-right > img {
  352. justify-self: right;
  353. padding: 0;
  354. }
  355. table.align-right {
  356. margin-right: 2.5%;
  357. }
  358. figure.align-center {
  359. align-content: center;
  360. justify-content: center;
  361. }
  362. figure.align-center > img {
  363. padding-left: 0;
  364. justify-self: center;
  365. }
  366. /* Margin Elements */
  367. /* see below for screen size dependent rules */
  368. aside.sidebar,
  369. .marginal,
  370. .admonition.marginal,
  371. .topic.marginal {
  372. background-color: #efefea;
  373. box-sizing: border-box;
  374. margin-left: 2%;
  375. margin-right: 0;
  376. padding: 0.5em;
  377. font-size: 0.8em;
  378. }
  379. aside.sidebar {
  380. background-color: inherit;
  381. }
  382. figure.marginal > figcaption {
  383. font-size: 1em;
  384. }
  385. .footnote {
  386. font-size: smaller;
  387. overflow: auto;
  388. }
  389. /* Adaptive page layout */
  390. /* no floating for very small Screens */
  391. /* (main text up to ca. 40 characters/line) */
  392. @media (min-width: 35em) {
  393. main, header, footer {
  394. padding: 0.5em calc(15% - 3rem);
  395. line-height: 1.6
  396. }
  397. aside.sidebar,
  398. .marginal,
  399. .admonition.marginal,
  400. .topic.marginal {
  401. max-width: 45%;
  402. float: right;
  403. clear: right;
  404. }
  405. dl.field-list > dd,
  406. dl.docinfo > dd {
  407. margin-left: 6em;
  408. }
  409. dl.option-list > dd {
  410. margin-left: 6em;
  411. }
  412. }
  413. /* 2 column layout with wide margin */
  414. @media (min-width: 65em) {
  415. /* use the same grid for main, all sections, and figures */
  416. main, section {
  417. display: grid;
  418. grid-template-columns: [content] minmax(0, 6fr)
  419. [margin] 3fr [end];
  420. grid-column-gap: calc(3em + 1%);
  421. }
  422. main > section, section > section {
  423. grid-column: 1 / end;
  424. }
  425. main, header, footer {
  426. padding-right: 5%; /* less padding right of margin-column */
  427. }
  428. section > figure {
  429. display: contents; /* to place caption in the margin */
  430. }
  431. /* Main text elements */
  432. main > *, section > *,
  433. figure > img,
  434. .footnote.align-left, /* override the placement in the margin */
  435. .citation.align-left {
  436. grid-column: content;
  437. }
  438. .citation.align-left {
  439. font-size: 1em;
  440. padding-left: 1.5em;
  441. }
  442. .citation.align-left .label {
  443. margin-left: -1.5em;
  444. }
  445. figure > img { /* indent */
  446. margin: 0.5em 2%;
  447. padding-left: 1em;
  448. }
  449. /* Margin Elements */
  450. /* Sidebar, Footnotes, Citations, Captions */
  451. aside.sidebar,
  452. .citation,
  453. .footnote,
  454. figcaption,
  455. /* table > caption, does not work :(*/
  456. .marginal,
  457. .admonition.marginal,
  458. .topic.marginal {
  459. /* color: red; */
  460. grid-column: margin;
  461. width: auto;
  462. max-width: 55em;
  463. margin: 0.5em 0;
  464. border: none;
  465. padding: 0;
  466. font-size: 0.8em;
  467. text-align: initial; /* overwrite align-* */
  468. background-color: inherit;
  469. }
  470. .admonition.marginal {
  471. padding: 0.5em;
  472. }
  473. figure.marginal {
  474. display: block;
  475. margin: 0.5em 0;
  476. }
  477. .citation,
  478. .footnote {
  479. padding-left: 0;
  480. }
  481. .citation .label,
  482. .footnote .label {
  483. margin-left: 0;
  484. }
  485. /* Fullwidth Elements */
  486. h1.title, p.subtitle,
  487. dl.docinfo,
  488. div.abstract,
  489. div.dedication,
  490. nav.contents,
  491. aside.system-message,
  492. pre,
  493. .fullwidth,
  494. .fullwidth img,
  495. .fullwidth figcaption {
  496. /* background-color: Linen; */
  497. grid-column: content / end;
  498. margin-right: calc(10% - 3rem);
  499. max-width: 55em;
  500. }
  501. }
  502. /* 3 column layout */
  503. @media (min-width: 100em) {
  504. main, header, footer {
  505. padding-left: 30%;
  506. }
  507. main > nav.contents {
  508. position: fixed;
  509. top: 0;
  510. left: 0;
  511. box-sizing: border-box;
  512. width: 25%;
  513. height: 100vh;
  514. margin: 0;
  515. background-color: #fafaf6;
  516. padding: 5.5em 2%;
  517. overflow: auto;
  518. }
  519. main > nav.contents > * {
  520. padding-left: 0;
  521. }
  522. }
  523. /* wrap URLs */
  524. /* a:link { */
  525. /* white-space: normal; */
  526. /* hyphens: none; */
  527. /* } */