styles.css 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624
  1. :root {
  2. --document-margin: 15pt;
  3. }
  4. h1 { font-size: 1.50em; }
  5. h2 { font-size: 1.40em; }
  6. h3 { font-size: 1.20em; }
  7. h4 { font-size: 1.00em; }
  8. h5 { font-size: 0.85em; }
  9. h6 { font-size: 0.75em; }
  10. h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
  11. text-decoration: none;
  12. }
  13. h1, h2, h3, h4, h5, h6 {
  14. margin-top: 1.5em;
  15. }
  16. @media (hover: hover) {
  17. /* For devices which support hover, hide the heading URL fragment
  18. link/icon until the mouse hovers over the heading */
  19. h1:hover .heading-anchor,
  20. h2:hover .heading-anchor,
  21. h3:hover .heading-anchor,
  22. h4:hover .heading-anchor,
  23. h5:hover .heading-anchor,
  24. h6:hover .heading-anchor {
  25. visibility: visible;
  26. }
  27. h1 .heading-anchor,
  28. h2 .heading-anchor,
  29. h3 .heading-anchor,
  30. h4 .heading-anchor,
  31. h5 .heading-anchor,
  32. h6 .heading-anchor {
  33. visibility: hidden;
  34. }
  35. }
  36. .heading-anchor {
  37. /* this is used on an "aside" tag so that it's not shown in the browser's reader mode */
  38. display: inline;
  39. color: grey;
  40. margin-left: 0.5em;
  41. font-size: 0.75em;
  42. }
  43. .heading-anchor a:hover {
  44. text-decoration: none;
  45. }
  46. .heading-anchor img {
  47. height: 1em;
  48. }
  49. a {
  50. text-decoration: none;
  51. }
  52. a:hover {
  53. text-decoration: underline;
  54. }
  55. .dont-show {
  56. display: none;
  57. }
  58. /* Improvements to Hugo Chroma syntax highlighting */
  59. .highlight {
  60. margin-top: 1em;
  61. margin-bottom: 1em;
  62. /* set the tab size for browsers that support it */
  63. tab-size: 4;
  64. -moz-tab-size: 4;
  65. /* needed for the iPhone so that the two columns (line numbers and code) don't have different font sizes */
  66. -webkit-text-size-adjust: 100%;
  67. }
  68. .highlight > * {
  69. padding: 0.5em;
  70. border-width: 2px;
  71. border-style: solid;
  72. }
  73. .highlight pre {
  74. margin: 0px;
  75. overflow-x: auto;
  76. word-wrap: normal;
  77. }
  78. .highlight td.lntd pre {
  79. /* needed to fix an iPhone scrolling bug */
  80. overflow-x: hidden;
  81. }
  82. .highlight td.lntd:last-child {
  83. /* needed until this bug is fixed: https://github.com/alecthomas/chroma/issues/225 */
  84. width: 100%;
  85. }
  86. /* Improvements to inline code blocks */
  87. code {
  88. font-size: 98%;
  89. }
  90. :not(pre) > code {
  91. /* inline code elements */
  92. background-color: rgba(25, 25, 25, 0.05);
  93. border-radius: 5px;
  94. font-size: 80%;
  95. padding-top: 0.2em;
  96. padding-bottom: 0.2em;
  97. padding-left: 0.4em;
  98. padding-right: 0.4em;
  99. }
  100. /* Formatting for "notice" shortcodes */
  101. .notice {
  102. margin: 1.5em 0;
  103. width: 70%;
  104. margin-left: auto;
  105. margin-right: auto;
  106. background-color: #E9E9E9;
  107. }
  108. @media only screen and (max-width: 500pt) {
  109. .notice {
  110. width: 100%;
  111. }
  112. }
  113. .notice > hr {
  114. display: none; /* only want the child hr elements to appear if css is disabled */
  115. }
  116. .notice .notice-title {
  117. margin: 0;
  118. padding: 0.4em;
  119. line-height: 1em;
  120. background-color: #D5D5D5;
  121. }
  122. .notice .notice-title span {
  123. vertical-align: -10%; /* we don't want the font descender space to be centered as well */
  124. }
  125. .notice .notice-title .notice-title-icon {
  126. display: inline-block;
  127. vertical-align: middle;
  128. margin-left: 0.15em;
  129. margin-right: 0.25em;
  130. height: 0.85em;
  131. }
  132. .notice .notice-body {
  133. padding: 0.6em;
  134. }
  135. .notice .notice-body p:first-child {
  136. margin-top: 0;
  137. }
  138. .notice .notice-body p {
  139. margin: 0.8em 0;
  140. }
  141. /* ************************ */
  142. blockquote {
  143. color: #404040;
  144. border-left: 0.25em solid #CCC;
  145. padding-left: 0.5em;
  146. margin-left: 1.5em;
  147. }
  148. .title-header {
  149. margin-top: 1.5em;
  150. margin-bottom: 1.5em;
  151. }
  152. .title-header > h1{
  153. margin-top: 0;
  154. margin-bottom: 0.3em;
  155. }
  156. .title-header-date {
  157. color: rgb(90, 90, 90);
  158. font-size: 80%;
  159. }
  160. .title-list > h2, .title-list > h3, .title-list > h4, .title-list > h5, .title-list > h6{
  161. margin-bottom: 0.1em;
  162. }
  163. .body-list p {
  164. margin-top: 0.5em;
  165. margin-bottom: 0.5em;
  166. }
  167. .title-list-date {
  168. color: rgb(90, 90, 90);
  169. font-size: 80%;
  170. }
  171. .table-of-contents {
  172. border-width: 2px;
  173. border-style: solid;
  174. padding: 1em;
  175. margin-bottom: 2em;
  176. font-size: 0.9em;
  177. }
  178. .table-of-contents nav > ul {
  179. /* only the most-parent ul element */
  180. margin-bottom: 0;
  181. }
  182. .table-of-contents ul {
  183. list-style: none;
  184. padding-left: 0;
  185. }
  186. .table-of-contents li {
  187. margin-top: 0.5em;
  188. }
  189. .table-of-contents ul ul {
  190. list-style: none;
  191. padding-left: 1.0em;
  192. }
  193. .table-of-contents-title {
  194. font-size: 1.2em;
  195. font-weight: bold;
  196. }
  197. .section-list {
  198. padding-left: 0;
  199. }
  200. .section-list li {
  201. display: inline-block;
  202. margin-right: 0.5em;
  203. }
  204. .section-list li:last-child {
  205. margin-right: 0em;
  206. }
  207. .section-list li > * {
  208. background-color: rgba(25, 25, 25, 0.05);
  209. border-radius: 5px;
  210. font-size: 90%;
  211. padding-top: 0.2em;
  212. padding-bottom: 0.2em;
  213. padding-left: 0.4em;
  214. padding-right: 0.4em;
  215. }
  216. .links {
  217. font-size: 120%;
  218. list-style-type: none;
  219. line-height: 1;
  220. padding: 0;
  221. margin: 0;
  222. margin-top: 9pt;
  223. display: flex;
  224. flex-direction: row;
  225. /* Not sure what we can do other than continue the links on the next line.
  226. * It's ugly, but probably better than hiding them altogether. */
  227. flex-wrap: wrap;
  228. row-gap: 0.3em;
  229. }
  230. .links li {
  231. margin-right: 1em;
  232. }
  233. .links li > * {
  234. display:inline-block;
  235. }
  236. .links li:last-child {
  237. margin-right: 0;
  238. }
  239. .links a {
  240. text-decoration: none;
  241. color: inherit;
  242. }
  243. .links a:hover {
  244. color: #505050;
  245. }
  246. .overlay {
  247. position: fixed;
  248. visibility: hidden;
  249. opacity: 0;
  250. width: 100%;
  251. height: 100%;
  252. top: 0;
  253. left: 0;
  254. right: 0;
  255. bottom: 0;
  256. background-color: rgba(0, 0, 0, 0.7);
  257. z-index: 2;
  258. /* for iOS: https://stackoverflow.com/a/11885330 */
  259. -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  260. }
  261. .header-right {
  262. /* want the images to have padding to make them easier to click, but we still want them aligned correctly */
  263. --label-padding: 0.3em;
  264. position: absolute;
  265. top: calc(var(--document-margin) - var(--label-padding));
  266. right: calc(var(--document-margin) - var(--label-padding));
  267. display: flex;
  268. }
  269. .header-right > * {
  270. margin-left: 0.4em;
  271. }
  272. .clickable-header-label {
  273. cursor: pointer;
  274. padding: var(--label-padding);
  275. }
  276. .clickable-header-label img {
  277. height: 1em;
  278. width: auto; /* to override the <img width="__"> attribute when css is supported */
  279. }
  280. #show-hide-menu-label {
  281. display: none;
  282. }
  283. #show-hide-menu-label * {
  284. /* duration for the rotation transition of the hamburger image */
  285. transition-duration: 100ms;
  286. }
  287. body {
  288. font-size: 13pt;
  289. font-family: Lato, Arial, Helvetica, "Liberation Sans", sans-serif;
  290. line-height: 1.45;
  291. margin: 0;
  292. }
  293. .title {
  294. font-weight: bold;
  295. font-size: 140%;
  296. line-height: 1em;
  297. }
  298. .title a {
  299. text-decoration: none;
  300. color: inherit;
  301. }
  302. .header {
  303. background-color: lightgray;
  304. background-size: cover;
  305. background-position: bottom;
  306. width: 100%;
  307. /* header must be above the overlay */
  308. /* this also prevents images with css filters from appearing above the header when in portrait mode */
  309. z-index: 3;
  310. /* z-index doesn't apply to the default 'static' position */
  311. position: relative;
  312. }
  313. .header-content {
  314. padding: var(--document-margin);
  315. position: relative; /* so that "position: absolute" works for the menu label */
  316. }
  317. .body {
  318. display: inline-block;
  319. width: 100%;
  320. }
  321. .body-content {
  322. margin: var(--document-margin);
  323. word-wrap: break-word;
  324. }
  325. /* Image/Figure formatting */
  326. .body-content :not(figure) img {
  327. /* regular image elements should be inline elements */
  328. max-width: 100%;
  329. max-height: 60vw; /* if the image is really tall, we don't want the width to be 100% */
  330. }
  331. .body-content figure {
  332. margin-left: auto;
  333. margin-right: auto;
  334. max-width: 70%;
  335. }
  336. .body-content figure img {
  337. display: block;
  338. margin-left: auto;
  339. margin-right: auto;
  340. margin-bottom: 0.5em;
  341. max-width: 100%;
  342. max-height: 40vw; /* if the image is really tall, we don't want the width to be 70% */
  343. }
  344. .body-content figure:not(.color-adapting-image) img {
  345. /* if the image is designed to adapt to the theme, then don't use a background */
  346. background-color: rgb(255, 255, 255); /* images with transparent backgrounds typically assume a light background */
  347. }
  348. .body-content figure figcaption {
  349. font-size: 90%;
  350. line-height: 1.5em;
  351. padding-bottom: 0.3em;
  352. border-bottom: 2px solid lightgray;
  353. }
  354. .body-content figure figcaption * {
  355. margin: 0;
  356. }
  357. @media only screen and (orientation: portrait) {
  358. .body-content :not(figure) img,
  359. .body-content figure img {
  360. /* need to target both so that they're more specific */
  361. max-height: 100vw;
  362. }
  363. }
  364. @media only screen and (max-width: 400pt) {
  365. .body-content figure {
  366. max-width: 100%;
  367. }
  368. .body-content figure figcaption {
  369. margin-left: 5%;
  370. margin-right: 5%;
  371. }
  372. }
  373. /* ************************ */
  374. .main {
  375. width: 700pt; /* make sure to also change this in the media query */
  376. margin: 0 auto;
  377. margin-top: 10pt;
  378. margin-bottom: 10pt;
  379. box-sizing: border-box;
  380. box-shadow: 0 0 10px rgba(50, 50, 50, .17);
  381. }
  382. .footer {
  383. text-align: center;
  384. font-size: 80%;
  385. }
  386. @media only screen and (orientation: portrait) {
  387. .header {
  388. top: 0;
  389. position: sticky;
  390. position: -webkit-sticky; /* needed for iOS */
  391. box-shadow: 0 0 1em rgba(30, 30, 30, .3);
  392. }
  393. .body-content :target::before {
  394. /* When linking to tags with 'id's (example:
  395. 'website.com/post/#heading'), make them
  396. appear lower down the page so that they
  397. don't appear under the sticky header set
  398. above.
  399. See: https://stackoverflow.com/a/24298427
  400. Note that this causes the cursor text
  401. selection of the target to behave
  402. undesirably.
  403. */
  404. content: '';
  405. display: block;
  406. height: 3em;
  407. margin-top: -3em;
  408. visibility: hidden;
  409. pointer-events: none;
  410. }
  411. }
  412. @media only screen and (max-width: 700pt) {
  413. .main {
  414. width: 100%;
  415. margin-top: 0;
  416. margin-bottom: 0;
  417. }
  418. body {
  419. font-size: 12pt;
  420. background-color: white;
  421. }
  422. }
  423. @media only screen and (max-width: 400pt) {
  424. :root {
  425. --document-margin: 10pt;
  426. }
  427. .header-right {
  428. top: 0;
  429. height: 100%;
  430. align-items: center;
  431. }
  432. .clickable-header-label {
  433. display: inline-flex;
  434. }
  435. .clickable-header-label * {
  436. vertical-align: middle;
  437. }
  438. #show-hide-menu-label {
  439. display: inherit;
  440. }
  441. .show-hide-menu-input:checked ~ .main .links {
  442. display: inherit;
  443. }
  444. .show-hide-menu-input:checked ~ .main #show-hide-menu-label > img {
  445. transform: rotate(90deg);
  446. }
  447. .show-hide-menu-input:checked ~ .overlay {
  448. visibility: visible;
  449. opacity: 1;
  450. }
  451. /* prevent scrolling the main body; must be on html element and not body for iOS */
  452. html:has(.show-hide-menu-input:checked) {
  453. overflow: hidden;
  454. height: 100%;
  455. /* prevent scrolling (of everything) on iOS */
  456. /* any element with 'overflow-y: scroll' will allow the body to scroll for some reason */
  457. /* use 'pan-zoom' to allow users to zoom if they need to, even though it makes scrolling weird */
  458. touch-action: pan-zoom;
  459. }
  460. .links {
  461. /* vertical padding between list items */
  462. --entry-padding: 9pt;
  463. display: none;
  464. position: absolute;
  465. left: 0;
  466. right: 0;
  467. padding-left: var(--document-margin);
  468. padding-right: var(--document-margin);
  469. padding-top: calc(var(--document-margin) - var(--entry-padding));
  470. padding-bottom: calc(var(--document-margin) - var(--entry-padding));
  471. font-size: 100%;
  472. background-color: rgb(247, 247, 247);
  473. border-top: solid 1px;
  474. border-bottom: solid 1px;
  475. }
  476. .links li {
  477. border-bottom: solid 1px;
  478. /* override all previously set margins */
  479. margin: 0;
  480. }
  481. .links li:last-child {
  482. border-bottom: none;
  483. }
  484. .links li > * {
  485. /* make the links easily clickable */
  486. width: 100%;
  487. padding-top: var(--entry-padding);
  488. padding-bottom: var(--entry-padding);
  489. }
  490. }
  491. @media print {
  492. :root {
  493. --document-margin: 0pt;
  494. }
  495. body {
  496. background-color: initial !important;
  497. }
  498. .main {
  499. margin-top: 0;
  500. margin-bottom: 0;
  501. width: 100%;
  502. box-shadow: none !important;
  503. }
  504. .header {
  505. background-color: initial !important;
  506. background-image: none !important;
  507. }
  508. .header-right {
  509. display: none;
  510. }
  511. .links {
  512. display: none;
  513. }
  514. }