style.css 6.9 KB

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