style.css 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479
  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, #blog-title and ul#nav-list. The
  47. * latter contains li.nav-item which contains an a.nav-link.
  48. */
  49. #blog-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. #blog-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. #blog-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. .toc {
  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. #toc-list {
  179. margin-left: -0.6em;
  180. }
  181. @media (min-width: 600px) and (max-width: 899px) {
  182. #toc-list {
  183. column-count: 2;
  184. }
  185. }
  186. @media (min-width: 900px) {
  187. #toc-list {
  188. column-count: 3;
  189. }
  190. }
  191. #toc-list li {
  192. list-style: none;
  193. /* Keep first-level ToC within one column */
  194. break-inside: avoid;
  195. }
  196. /**
  197. * Category content.
  198. **/
  199. .category-prelude {
  200. padding-top: 4%;
  201. margin-bottom: -20px;
  202. }
  203. .article-list {
  204. padding: 4% 0;
  205. }
  206. .article-list > li {
  207. list-style: square inside;
  208. padding: 3px;
  209. }
  210. .article-list > li:hover {
  211. background-color: #c0c0c0;
  212. }
  213. .article-link, .article-link:visited {
  214. color: black;
  215. display: inline;
  216. line-height: 1.4em;
  217. border-bottom: 1px solid black;
  218. }
  219. .article-timestamp {
  220. float: right;
  221. display: inline-block;
  222. margin-left: 1em;
  223. }
  224. /**
  225. * Layout utilities.
  226. **/
  227. .clear {
  228. clear: both;
  229. }
  230. .no-display {
  231. display: none !important;
  232. }
  233. /**
  234. * Miscellous elements.
  235. **/
  236. hr {
  237. clear: both;
  238. border-color: #aaa;
  239. text-align: center;
  240. }
  241. hr:after {
  242. content: "❧";
  243. text-shadow: 0px 0px 2px #667;
  244. display: inline-block;
  245. position: relative;
  246. top: -0.5em;
  247. padding: 0 0.25em;
  248. font-size: 1.1em;
  249. color: black;
  250. background-color: white;
  251. }
  252. .key {
  253. display: inline-block;
  254. border: 1px solid black;
  255. border-radius: 3px;
  256. padding: 0 2px;
  257. margin: 1px;
  258. font-size: 85%;
  259. font-family: "Lucida Grande", Arial, sans-serif;
  260. }
  261. /** Section numbers generated by pandoc */
  262. .header-section-number:after, .toc-section-number:after {
  263. content: ".";
  264. }
  265. /**
  266. * TTY shots.
  267. */
  268. pre.ttyshot {
  269. font-size: 12pt;
  270. line-height: 1 !important;
  271. border: 1px solid black;
  272. display: inline-block;
  273. margin-bottom: 0 !important;
  274. }
  275. pre.ttyshot, pre.ttyshot code {
  276. background-color: white;
  277. }
  278. @media screen and (max-width: 600px) {
  279. pre.ttyshot {
  280. font-size: 2.6vw;
  281. }
  282. }
  283. /* SGR classes, used in ttyshots. */
  284. .sgr-1 {
  285. font-weight: bold;
  286. }
  287. .sgr-4 {
  288. text-decoration: underline;
  289. }
  290. .sgr-7 {
  291. color: white;
  292. background-color: black;
  293. }
  294. .sgr-31 {
  295. color: darkred; /* red in tty */
  296. }
  297. .sgr-41 {
  298. background-color: darkred; /* red in tty */
  299. }
  300. .sgr-32 {
  301. color: green; /* green in tty */
  302. }
  303. .sgr-42, .sgr-7.sgr-32 {
  304. background-color: green; /* green in tty */
  305. }
  306. .sgr-33 {
  307. color: goldenrod; /* yellow in tty */
  308. }
  309. .sgr-43, .sgr-7.sgr-33 {
  310. background-color: goldenrod; /* yellow in tty */
  311. }
  312. .sgr-34 {
  313. color: blue;
  314. }
  315. .sgr-44, .sgr-7.sgr-34 {
  316. color: white; /* Hacky hacky, just to make the nav ttyshot work */
  317. background-color: blue;
  318. }
  319. .sgr-35 {
  320. color: darkorchid; /* magenta in tty */
  321. }
  322. .sgr-45, .sgr-7.sgr-35 {
  323. background-color: darkorchid; /* magenta in tty */
  324. }
  325. .sgr-36 {
  326. color: darkcyan; /* cyan in tty */
  327. }
  328. .sgr-46, .sgr-7.sgr-36 {
  329. background-color: darkcyan; /* cyan in tty */
  330. }
  331. .sgr-37 {
  332. color: lightgray;
  333. }
  334. .sgr-47, .sgr-7.sgr-37 {
  335. background-color: gray;
  336. }
  337. /** Header anchors. */
  338. .anchor {
  339. opacity: 0;
  340. font-size: 90%;
  341. }
  342. *:hover > .anchor {
  343. opacity: 1;
  344. }
  345. /**
  346. * Dark theme.
  347. */
  348. .dark {
  349. color: #eee;
  350. background: black;
  351. }
  352. .dark a {
  353. color: #6da2fa;
  354. }
  355. .dark a:visited {
  356. color: #7e72ff;
  357. }
  358. .dark .article-link, .dark .article-link:visited {
  359. color: #eee;
  360. border-color: white;
  361. }
  362. .dark .article-list > li:hover {
  363. background-color: #333;
  364. }
  365. .dark .article code, .dark .article pre {
  366. background-color: #181818;
  367. }
  368. .dark .toc {
  369. background-color: #181818;
  370. }
  371. .dark hr {
  372. border-color: #eee;
  373. }
  374. .dark hr:after {
  375. color: #eee;
  376. background-color: black;
  377. }
  378. .dark pre.ttyshot, .dark pre.ttyshot code {
  379. background: black;
  380. }
  381. .dark .sgr-7 {
  382. color: black;
  383. background-color: #eee;
  384. }
  385. table {
  386. border-collapse: collapse;
  387. width: 100%;
  388. margin-bottom: 16px;
  389. }
  390. td, th {
  391. border: 1px solid #aaa;
  392. text-align: left;
  393. padding: 0.4em;
  394. }
  395. .dark td, .dark th {
  396. border-color: #444;
  397. }