style.css 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499
  1. /**
  2. * Global styling.
  3. **/
  4. html {
  5. /* Prevent font scaling in landscape while allowing user zoom */
  6. -webkit-text-size-adjust: 100%;
  7. }
  8. body {
  9. font-family: "Source Serif", Georgia, serif;
  10. font-size: 17px;
  11. line-height: 1.4em;
  12. }
  13. body.has-js .no-js, body.no-js .has-js {
  14. display: none !important;
  15. }
  16. img {
  17. max-width: 100%;
  18. }
  19. a {
  20. text-decoration: none;
  21. color: #0645ad;
  22. }
  23. /**
  24. * Top-level elements.
  25. *
  26. * There are two main elements: #navbar and #content. Both have a maximum
  27. * width, and is centered when the viewport is wider than that.
  28. *
  29. * #navbar is wrapped by #navbar-container, a black stripe that always span
  30. * the entire viewport.
  31. **/
  32. #navbar-container {
  33. width: 100%;
  34. color: white;
  35. background-color: #1a1a1a;
  36. padding: 12px 0;
  37. }
  38. #content, #navbar {
  39. max-width: 1024px;
  40. margin: 0 auto;
  41. padding: 0 4%;
  42. }
  43. /**
  44. * Elements in the navbar.
  45. *
  46. * The navbar is made up of two elements, #site-title and ul#nav-list. The
  47. * latter contains li.nav-item which contains an a.nav-link.
  48. */
  49. #site-title, #nav-list {
  50. display: inline-block;
  51. /* Add spacing between lines when the navbar cannot fit in one line. */
  52. line-height: 1.4em;
  53. }
  54. #site-title {
  55. font-size: 1.2em;
  56. margin-right: 0.6em;
  57. /* Move the title upward 1px so that it looks more aligned with the
  58. * category list. */
  59. position: relative;
  60. top: 1px;
  61. }
  62. #site-title a {
  63. color: #5b5;
  64. }
  65. .nav-item {
  66. list-style: none;
  67. display: inline-block;
  68. }
  69. .nav-link {
  70. color: white;
  71. }
  72. .nav-link > code {
  73. padding: 0px 0.5em;
  74. }
  75. .nav-link:hover {
  76. background-color: #444;
  77. }
  78. .nav-link.current {
  79. color: black;
  80. background-color: white;
  81. }
  82. .nav-item + .nav-item::before {
  83. content: "|";
  84. }
  85. /**
  86. * Article header.
  87. **/
  88. .timestamp {
  89. margin-bottom: 0.6em;
  90. }
  91. .article-title {
  92. padding: 16px 0;
  93. border-bottom: solid 1px #667;
  94. }
  95. /* Extra level needed to be more specific than .article h1 */
  96. .article .article-title h1 {
  97. font-size: 1.5em;
  98. margin: 0;
  99. padding: 0;
  100. border: none;
  101. }
  102. /**
  103. * Article content.
  104. **/
  105. .article-content {
  106. padding-top: 32px;
  107. }
  108. .article p, .article ul, .article pre {
  109. margin-bottom: 16px;
  110. }
  111. .article li {
  112. margin: 0.5em 0;
  113. }
  114. .article li > p {
  115. margin: 1em 0;
  116. }
  117. /* Block code. */
  118. .article pre {
  119. padding: 1em;
  120. overflow: auto;
  121. }
  122. /* Inline code. */
  123. .article p code {
  124. padding: 0.1em 0;
  125. }
  126. .article p code::before, .article p code::after {
  127. letter-spacing: -0.2em;
  128. content: "\00a0";
  129. }
  130. code, pre {
  131. font-family: "Fira Mono", Menlo, "Roboto Mono", Consolas, monospace;
  132. }
  133. .article code, .article pre {
  134. background-color: #f0f0f0;
  135. border-radius: 3px;
  136. }
  137. /* This doesn't have p, so that it also applies to ttyshots. */
  138. .article code {
  139. font-size: 85%;
  140. }
  141. /* We only use h1 to h3. */
  142. .article h1, .article h2, .article h3 {
  143. line-height: 1.25;
  144. }
  145. .article h1, .article h2, .article h3 {
  146. margin-top: 24px;
  147. margin-bottom: 20px;
  148. font-weight: bold;
  149. }
  150. .article h1 {
  151. font-size: 1.3em;
  152. padding-bottom: 0.4em;
  153. border-bottom: 1px solid #aaa;
  154. }
  155. .article h2 {
  156. font-size: 1.2em;
  157. }
  158. .article h3 {
  159. font-style: italic;
  160. }
  161. .article ul, .article ol {
  162. margin-left: 1em;
  163. }
  164. /**
  165. * Table of content.
  166. */
  167. #pandoc-toc-wrapper {
  168. background-color: #f0f0f0;
  169. padding: 1em;
  170. margin: 0 16px 16px 0;
  171. border-radius: 6px;
  172. line-height: 1;
  173. }
  174. /* The first <h1> clears the TOC */
  175. .article-content h1 {
  176. clear: both;
  177. }
  178. #pandoc-toc {
  179. margin-left: -0.6em;
  180. }
  181. @media (min-width: 600px) and (max-width: 899px) {
  182. #pandoc-toc {
  183. column-count: 2;
  184. }
  185. }
  186. @media (min-width: 900px) {
  187. #pandoc-toc {
  188. column-count: 3;
  189. }
  190. }
  191. #pandoc-toc li {
  192. list-style: none;
  193. /* Keep first-level ToC within one column */
  194. break-inside: avoid;
  195. }
  196. /**
  197. * Category content.
  198. **/
  199. #content.category {
  200. padding-top: 16px;
  201. }
  202. .category-prelude, .group-intro, .article-list {
  203. margin-top: 16px;
  204. }
  205. .article-list > li {
  206. list-style: square inside;
  207. padding: 3px;
  208. }
  209. .article-list > li:hover {
  210. background-color: #c0c0c0;
  211. }
  212. .article-link, .article-link:visited {
  213. color: black;
  214. display: inline;
  215. line-height: 1.4em;
  216. border-bottom: 1px solid black;
  217. }
  218. .article-timestamp {
  219. float: right;
  220. display: inline-block;
  221. margin-left: 1em;
  222. }
  223. /**
  224. * Layout utilities.
  225. **/
  226. .clear {
  227. clear: both;
  228. }
  229. .no-display {
  230. display: none !important;
  231. }
  232. /**
  233. * Miscellous elements.
  234. **/
  235. hr {
  236. clear: both;
  237. border-color: #aaa;
  238. text-align: center;
  239. }
  240. hr:after {
  241. content: "❧";
  242. text-shadow: 0px 0px 2px #667;
  243. display: inline-block;
  244. position: relative;
  245. top: -0.5em;
  246. padding: 0 0.25em;
  247. font-size: 1.1em;
  248. color: black;
  249. background-color: white;
  250. }
  251. kbd {
  252. display: inline-block;
  253. border: 1px solid black;
  254. border-radius: 3px;
  255. padding: 0 3px;
  256. margin: 1px;
  257. font-size: 85%;
  258. font-family: "Lucida Grande", Arial, sans-serif;
  259. }
  260. /** Section numbers generated by pandoc */
  261. .header-section-number:after, .toc-section-number:after {
  262. content: ".";
  263. }
  264. /**
  265. * TTY shots.
  266. */
  267. pre.ttyshot {
  268. font-size: 12pt;
  269. line-height: 1 !important;
  270. border: 1px solid black;
  271. display: inline-block;
  272. margin-bottom: 0 !important;
  273. }
  274. pre.ttyshot, pre.ttyshot code {
  275. background-color: white;
  276. }
  277. @media screen and (max-width: 600px) {
  278. pre.ttyshot {
  279. font-size: 2.6vw;
  280. }
  281. }
  282. /* SGR classes used in ttyshots. */
  283. .sgr-1 {
  284. /*
  285. * Bold text is wider than regular text in most fonts, and can break
  286. * vertical alignment in ttyshots. Emulate bold font with text-shadow.
  287. */
  288. text-shadow: 0.05em 0 0;
  289. }
  290. .sgr-4 {
  291. text-decoration: underline;
  292. }
  293. /*
  294. * SGR 7 (inverse) has some special handling by the ttyshot program; see
  295. * comments there.
  296. */
  297. .sgr-7fg {
  298. color: white;
  299. }
  300. .sgr-7bg {
  301. background-color: black;
  302. }
  303. /* black */
  304. .sgr-30 { color: black; }
  305. .sgr-40 { background-color: black; }
  306. /* red */
  307. .sgr-31 { color: maroon; }
  308. .sgr-41 { background-color: maroon; }
  309. /* green */
  310. .sgr-32 { color: green; }
  311. .sgr-42 { background-color: green; }
  312. /* yellow */
  313. .sgr-33 { color: goldenrod; }
  314. .sgr-43 { background-color: goldrenrod; }
  315. /* blue */
  316. .sgr-34 { color: navy; }
  317. .sgr-44 { background-color: navy; }
  318. /* magenta */
  319. .sgr-35 { color: darkorchid; }
  320. .sgr-45 { background-color: darkorchid; }
  321. /* cyan */
  322. .sgr-36 { color: darkcyan; }
  323. .sgr-46 { background-color: darkcyan; }
  324. /* white */
  325. .sgr-37 { color: lightgrey; }
  326. .sgr-47 { background-color: lightgrey; }
  327. /* bright black */
  328. .sgr-90 { color: grey; }
  329. .sgr-100 { background-color: grey; }
  330. /* bright red */
  331. .sgr-91 { color: red; }
  332. .sgr-101 { background-color: red; }
  333. /* bright green */
  334. .sgr-92 { color: lime; }
  335. .sgr-102 { background-color: lime; }
  336. /* light yellow */
  337. .sgr-93 { color: yellow; }
  338. .sgr-103 { background-color: yellow; }
  339. /* light blue */
  340. .sgr-94 { color: blue; }
  341. .sgr-104 { background-color: blue; }
  342. /* bright magenta */
  343. .sgr-95 { color: fuchsia; }
  344. .sgr-105 { background-color: fuchsia; }
  345. /* bright cyan */
  346. .sgr-96 { color: aqua; }
  347. .sgr-106 { background-color: aqua; }
  348. /* bright white */
  349. .sgr-97 { color: white; }
  350. .sgr-107 { background-color: white; }
  351. /** Header anchors. */
  352. .anchor {
  353. opacity: 0;
  354. font-size: 90%;
  355. color: inherit;
  356. padding-left: 0.15em;
  357. }
  358. *:hover > .anchor {
  359. opacity: 1;
  360. }
  361. /**
  362. * Dark theme.
  363. */
  364. .dark {
  365. color: #eee;
  366. background: black;
  367. }
  368. .dark a {
  369. color: #6da2fa;
  370. }
  371. .dark a:visited {
  372. color: #7e72ff;
  373. }
  374. .dark .article-link, .dark .article-link:visited {
  375. color: #eee;
  376. border-color: white;
  377. }
  378. .dark .article-list > li:hover {
  379. background-color: #333;
  380. }
  381. .dark .article code, .dark .article pre {
  382. background-color: #181818;
  383. }
  384. .dark #pandoc-toc-wrapper {
  385. background-color: #181818;
  386. }
  387. .dark hr {
  388. border-color: #eee;
  389. }
  390. .dark hr:after {
  391. color: #eee;
  392. background-color: black;
  393. }
  394. .dark pre.ttyshot, .dark pre.ttyshot code {
  395. background: black;
  396. }
  397. .dark .sgr-7fg {
  398. color: black;
  399. }
  400. .dark .sgr-7bg {
  401. background-color: #eee;
  402. }
  403. table {
  404. border-collapse: collapse;
  405. width: 100%;
  406. margin-bottom: 16px;
  407. }
  408. td, th {
  409. border: 1px solid #aaa;
  410. text-align: left;
  411. padding: 0.4em;
  412. }
  413. .dark td, .dark th {
  414. border-color: #444;
  415. }