style.css 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747
  1. :root {
  2. /*
  3. * according to https://www.color-blindness.com/color-name-hue/
  4. *
  5. * amber
  6. * chartreuse
  7. * free-speech-green (lime)
  8. * aqua
  9. * blue
  10. * electric-indigo
  11. * hot-magenta
  12. */
  13. --red: var(--base08);
  14. --orange: var(--base09);
  15. --yellow: var(--base0A);
  16. --green: var(--base0B);
  17. --cyan: var(--base0C);
  18. --blue: var(--base0D);
  19. --violet: var(--base0E);
  20. --magenta: var(--base0F);
  21. /* convenience */
  22. --bg: var(--base00);
  23. --bg-status: var(--base01);
  24. --bg-selection: var(--base02);
  25. --fg-alt: var(--base03);
  26. --fg-status: var(--base04);
  27. --fg: var(--base05);
  28. --fg-light: var(--base06);
  29. --bg-light: var(--base07);
  30. /* size (2^n) */
  31. --size-3: 8rem;
  32. --size-2: 4rem;
  33. --size-1: 2rem;
  34. --size-0: 1rem;
  35. --size--1: 0.5rem;
  36. --size--2: 0.25rem;
  37. --size--3: 0.125rem;
  38. --size--4: 0.0625rem;
  39. /* size */
  40. --common-radius: var(--size--2);
  41. --measure: 36rem;
  42. --line: 1.5rem;
  43. --code-size: 85%;
  44. }
  45. * {
  46. scrollbar-color: var(--fg-status) var(--bg);
  47. }
  48. ::selection {
  49. background-color: var(--bg-selection);
  50. color: var(--fg-light);
  51. }
  52. html {
  53. display: flex;
  54. font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
  55. "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans",
  56. "Helvetica Neue", sans-serif;
  57. justify-content: center;
  58. font-size: 12pt;
  59. line-height: 1.5;
  60. margin: 0;
  61. padding: 0;
  62. overflow-y: scroll;
  63. }
  64. main {
  65. margin: 0;
  66. margin-bottom: var(--size-0);
  67. }
  68. /* https://www.desmos.com/calculator/3elcf5cwhn */
  69. h1 {
  70. font-size: 133%;
  71. } /* 4 / 3 */
  72. h2 {
  73. font-size: 115%;
  74. } /* 8 / 7 */
  75. h3 {
  76. font-size: 105%;
  77. } /* 16 / 15 */
  78. h4 {
  79. font-size: 103%;
  80. } /* 32 / 31 */
  81. h5 {
  82. font-size: 101%;
  83. } /* 64 / 63 */
  84. h6 {
  85. font-size: 100%;
  86. } /* 128 / 127 */
  87. h1,
  88. h2,
  89. h3,
  90. h4,
  91. h5,
  92. h6 {
  93. color: var(--bg-light);
  94. margin: var(--size-0) 0;
  95. }
  96. ul,
  97. ol {
  98. padding-left: var(--size-0);
  99. margin-left: var(--size--3);
  100. }
  101. a {
  102. color: var(--fg-light);
  103. }
  104. button,
  105. .file-button {
  106. cursor: pointer;
  107. background: var(--fg);
  108. color: var(--bg);
  109. border: var(--size--4) solid var(--fg);
  110. padding: var(--size--1) var(--size-0);
  111. border-radius: var(--common-radius);
  112. font-size: 8pt;
  113. }
  114. .file-button {
  115. float: right;
  116. margin: 0;
  117. background: transparent;
  118. color: var(--fg);
  119. }
  120. #blob {
  121. visibility: hidden;
  122. height: 0;
  123. padding: 0;
  124. margin: 0;
  125. }
  126. section header a {
  127. display: flex;
  128. color: var(--fg-status);
  129. text-decoration: none;
  130. margin-right: var(--size--2);
  131. margin-left: var(--size--2);
  132. font-weight: bold;
  133. }
  134. /* For use with elements specific for
  135. * rendering in a text browser and intended
  136. * to be hidden in a graphical browser. */
  137. .text-browser {
  138. display: none;
  139. }
  140. section > footer > div > a,
  141. section > footer > div > form > button {
  142. color: var(--fg-status);
  143. font-weight: bold;
  144. }
  145. section > footer > div > form > button {
  146. display: inline-block;
  147. border: 0;
  148. background: transparent;
  149. cursor: pointer;
  150. padding: 0;
  151. }
  152. select,
  153. input {
  154. background: var(--bg);
  155. color: var(--fg);
  156. border: var(--size--4) solid var(--bg-selection);
  157. padding: var(--size--1);
  158. margin: var(--size-0) 0;
  159. -moz-appearance: none;
  160. appearance: none;
  161. border-radius: var(--common-radius);
  162. display: block;
  163. }
  164. .contentWarning {
  165. background-color: var(--bg);
  166. box-sizing: border-box;
  167. display: block;
  168. font-size: var(--size-0);
  169. padding: var(--size-0);
  170. width: 100%;
  171. margin: var(--size-0) 0;
  172. border: var(--size--4) solid var(--bg-selection);
  173. border-radius: var(--common-radius);
  174. color: var(--fg);
  175. }
  176. textarea {
  177. background-color: var(--bg);
  178. box-sizing: border-box;
  179. display: block;
  180. font-size: var(--size-0);
  181. padding: var(--size-0);
  182. resize: vertical;
  183. width: 100%;
  184. margin: var(--size-0) 0;
  185. height: 12rem;
  186. border: var(--size--4) solid var(--bg-selection);
  187. border-radius: var(--common-radius);
  188. color: var(--fg);
  189. }
  190. button:focus,
  191. input:focus,
  192. select:focus,
  193. textarea:focus {
  194. border-color: var(--blue);
  195. }
  196. /* Prevent button styles being applied to heart button */
  197. button:focus,
  198. button:hover {
  199. background-color: var(--fg-light);
  200. }
  201. section > footer > div > form > button:hover,
  202. section > footer > div > form > button:focus {
  203. background-color: transparent;
  204. }
  205. pre {
  206. overflow-x: auto;
  207. background-color: var(--bg);
  208. padding: var(--size--1);
  209. font-size: 92%;
  210. border-radius: var(--common-radius);
  211. border: var(--size--4) solid var(--bg-status);
  212. }
  213. section code {
  214. max-width: 100%;
  215. overflow-wrap: break-word;
  216. padding: 0.125em 0.25em;
  217. margin: 0;
  218. font-size: var(--code-size);
  219. background-color: var(--bg);
  220. border-radius: var(--common-radius);
  221. border: var(--size--4) solid var(--bg-status);
  222. }
  223. section pre code {
  224. color: inherit;
  225. padding: 0;
  226. margin: 0;
  227. font-size: 100%;
  228. background-color: initial;
  229. border: initial;
  230. border-radius: initial;
  231. }
  232. section blockquote {
  233. margin-left: 0;
  234. border-left: var(--size--1) solid var(--bg-status);
  235. padding-left: var(--size-0);
  236. }
  237. section img,
  238. section video {
  239. max-width: 100%;
  240. max-height: 100vh;
  241. border-radius: var(--common-radius);
  242. box-sizing: border-box;
  243. }
  244. section > h1 {
  245. margin-top: 0;
  246. padding-top: 0;
  247. }
  248. .profile > img,
  249. .profile > h1 {
  250. display: inline-block;
  251. }
  252. section > header.profile {
  253. height: auto;
  254. justify-content: left;
  255. }
  256. .profile > img {
  257. width: 4rem;
  258. height: 4rem;
  259. margin-right: var(--size-0);
  260. border-radius: var(--common-radius);
  261. }
  262. .private {
  263. border-left: var(--size--1) solid var(--violet);
  264. border-color: var(--violet);
  265. }
  266. section.thread-target {
  267. border: var(--size--4) solid var(--blue);
  268. box-shadow: 0 0 var(--size--2) var(--blue);
  269. }
  270. section.thread-target.private {
  271. border: var(--size--4) solid var(--violet);
  272. border-left: var(--size--1) solid var(--violet);
  273. border-color: var(--violet);
  274. box-shadow: 0 0 var(--size--2) var(--violet);
  275. }
  276. section audio {
  277. width: 100%;
  278. }
  279. @media screen {
  280. html {
  281. min-height: 100%;
  282. color: var(--fg);
  283. background-color: var(--bg-status);
  284. }
  285. body {
  286. width: 100%;
  287. max-width: var(--measure);
  288. margin: 0;
  289. }
  290. }
  291. nav {
  292. margin: var(--size-0) 0;
  293. margin-left: 20px;
  294. }
  295. nav > ul > li > a {
  296. margin-left: 10px;
  297. margin-right: 0px;
  298. color: var(--fg);
  299. text-decoration: none;
  300. font-weight: bold;
  301. }
  302. .author-action > a {
  303. text-decoration: underline;
  304. }
  305. section header a:hover {
  306. text-decoration: underline;
  307. }
  308. nav > ul > li > a:hover {
  309. text-decoration: underline;
  310. }
  311. nav > ul > li > a.current {
  312. font-weight: bold;
  313. }
  314. section {
  315. padding: var(--size-0);
  316. border-radius: var(--common-radius);
  317. margin: var(--size-0) 0;
  318. word-wrap: break-word;
  319. background: var(--bg);
  320. width: 100%;
  321. box-sizing: border-box;
  322. }
  323. .indent section,
  324. .thread-container section {
  325. margin: unset;
  326. border-radius: unset;
  327. border-bottom: var(--fg-alt) solid 1px;
  328. }
  329. .indent details[open] {
  330. border-bottom: var(--fg-alt) solid 1px;
  331. }
  332. .indent section:last-of-type,
  333. .thread-container section:last-of-type {
  334. border-bottom: unset;
  335. }
  336. .mentions-container {
  337. display: grid;
  338. grid-template-columns: 4rem auto;
  339. grid-column-gap: 1rem;
  340. margin-bottom: var(--size-0);
  341. }
  342. section > header {
  343. background: var(--bg);
  344. color: var(--fg-status);
  345. margin-bottom: calc(-1 * var(--size--1));
  346. margin-top: calc(-1 * var(--size--1));
  347. padding-bottom: var(--size--1);
  348. padding-top: var(--size--1);
  349. position: sticky;
  350. top: 0;
  351. z-index: 1;
  352. }
  353. section > header > div {
  354. display: flex;
  355. justify-content: space-between;
  356. flex-wrap: wrap;
  357. }
  358. section header a > .avatar {
  359. width: var(--line);
  360. height: var(--line);
  361. border-radius: var(--common-radius);
  362. margin-right: var(--size--2);
  363. }
  364. section header span {
  365. display: inline-flex;
  366. }
  367. /*
  368. * HACK: centered-footer
  369. *
  370. * When someone likes a message we want to submit the form and then redirect
  371. * them back to the original page. Unfortunately when you link to anchor tags
  372. * that scrolls the browser so that they're at the *top* of the page, not the
  373. * center of the page. In our view we have an empty div with an appropriate
  374. * anchor tag, so here we use CSS to center it on the screen.
  375. *
  376. * The code below creates padding-top that takes up 50% of the height of the
  377. * viewport and then gets rid of it with negative margin. This has no effect
  378. * on the display of the item, but means that when we link to the anchor tag
  379. * it centers this empty element vertically on the screen.
  380. *
  381. * We also use `pointer-events: none` to ensure that this invisible div doesn't
  382. * capture cursor events (clicks, drags, etc) on surrounding elements, because
  383. * otherwise we could have a problem where someone clicks above the invisible
  384. * div but the browser picogs they're clicking the gigantic amount of padding.
  385. */
  386. section > .centered-footer {
  387. padding-top: 50vh;
  388. margin-top: -50vh;
  389. pointer-events: none;
  390. }
  391. section > footer {
  392. color: var(--fg-status);
  393. }
  394. section > footer br {
  395. display: none;
  396. }
  397. section > footer > div {
  398. display: flex;
  399. justify-content: space-between;
  400. }
  401. section > footer > div > * {
  402. text-decoration: none;
  403. }
  404. section > footer > div > form > button:first-of-type {
  405. font-size: 100%;
  406. }
  407. section > footer > div > form > button.liked {
  408. color: var(--red);
  409. }
  410. label {
  411. display: block;
  412. margin: 0;
  413. }
  414. nav > ul {
  415. display: flex;
  416. flex-wrap: wrap;
  417. justify-content: space-between;
  418. margin: 0;
  419. padding: 0;
  420. }
  421. nav > ul > li {
  422. list-style: none;
  423. margin-right: var(--size--1);
  424. }
  425. .profile {
  426. display: flex;
  427. margin-bottom: var(--size-0);
  428. }
  429. progress {
  430. display: block;
  431. width: 100%;
  432. }
  433. progress::-moz-progress-bar,
  434. progress::-webkit-progress-value,
  435. progress {
  436. background: var(--blue);
  437. border-color: var(--blue);
  438. }
  439. summary {
  440. padding: var(--size--1);
  441. margin: var(--size-0) 0;
  442. cursor: pointer;
  443. background: var(--bg);
  444. border-radius: var(--common-radius);
  445. list-style-type: "+ ";
  446. border: var(--size--4) dashed var(--fg-status);
  447. }
  448. details[open] > summary {
  449. list-style-type: "− ";
  450. }
  451. .indent > details > summary {
  452. border: none;
  453. }
  454. .md-mention {
  455. -moz-user-select: all;
  456. -ms-user-select: all;
  457. -webkit-user-select: all;
  458. user-select: all;
  459. background: none;
  460. overflow: hidden;
  461. }
  462. table {
  463. width: 100%;
  464. table-layout: fixed;
  465. }
  466. td,
  467. th {
  468. padding: var(--size--1);
  469. outline: var(--size--4) solid var(--bg-status);
  470. }
  471. th {
  472. text-align: left;
  473. background-color: var(--bg-status);
  474. }
  475. input[type="search"] {
  476. width: 100%;
  477. margin: var(--size-0) 0;
  478. }
  479. .image-search-grid {
  480. display: grid;
  481. grid-template-columns: 1fr 1fr;
  482. grid-gap: var(--size-0);
  483. }
  484. .image-search-grid .image-result {
  485. display: flex;
  486. flex-direction: column;
  487. align-items: center;
  488. padding: var(--size--1) 0;
  489. background: var(--bg);
  490. border-radius: var(--common-radius);
  491. }
  492. .image-search-grid .image-result .result-text {
  493. hyphens: auto;
  494. text-align: center;
  495. }
  496. hr {
  497. border: var(--size--4) solid var(--fg-alt);
  498. }
  499. .form-button-group {
  500. display: flex;
  501. justify-content: space-between;
  502. margin: var(--size-0) 0;
  503. }
  504. /* sidebar only appears on big screens */
  505. @media (min-width: calc(45rem)) {
  506. body > nav > ul {
  507. justify-content: right;
  508. flex-direction: column;
  509. margin-right: var(--size-1);
  510. position: sticky;
  511. top: var(--size-0);
  512. }
  513. body > nav > ul > li {
  514. margin-bottom: var(--size-0);
  515. }
  516. main {
  517. width: 100%;
  518. max-width: var(--measure);
  519. }
  520. body {
  521. display: flex;
  522. justify-content: center;
  523. max-width: none;
  524. }
  525. }
  526. /* Use the browser's default font rendering instead of using our fancy
  527. * font-family above. This resolves a problem where some emoji were being
  528. * rendered in the system-ui font, which is rarely what we want.
  529. */
  530. .emoji {
  531. font-family: initial;
  532. }
  533. /* This indent is used on the summaries page to create an indent of 1. It might
  534. * be wise to nest these recursively on the thread view, which would make it so
  535. * that we don't need any inline CSS anymore.
  536. */
  537. .indent {
  538. padding-left: 1rem;
  539. border-left: var(--size--2) solid var(--bg-selection);
  540. }
  541. .mentions-image {
  542. grid-row: 1 / span 2;
  543. }
  544. .mentions-image > img {
  545. border: var(--fg) solid 1px;
  546. }
  547. .mentions-container .emoji {
  548. font-size: 1.5rem;
  549. }
  550. .mentions-name {
  551. font-size: 1.25rem;
  552. text-decoration: unset;
  553. }
  554. .mentions-name:hover {
  555. text-decoration: underline;
  556. }
  557. .emo-rel {
  558. display: inline-grid;
  559. align-items: center;
  560. grid-template-columns: 2rem auto;
  561. grid-column-gap: 0.25rem;
  562. }
  563. .mentions-listing {
  564. display: inline;
  565. background-color: var(--bg);
  566. padding: var(--size--1);
  567. border-radius: var(--common-radius);
  568. border: var(--size--4) solid var(--bg-status);
  569. user-select: all;
  570. font-size: var(--size--1);
  571. overflow-x: auto;
  572. width: 24rem;
  573. }
  574. section.post-preview {
  575. padding-top: 0;
  576. background: var(--bg-selection);
  577. border: var(--fg-alt) solid 1px;
  578. }
  579. section.post-preview > section > footer {
  580. display: none;
  581. }
  582. section.post.blocked {
  583. font-style: italic;
  584. }
  585. section > footer > div > a:hover,
  586. section > footer > div > form > button:hover {
  587. text-decoration: underline;
  588. }
  589. .author-action {
  590. flex-grow: 1;
  591. }
  592. section header .author > a:first-child {
  593. margin-left: 0;
  594. color: var(--fg-light);
  595. font-weight: bold;
  596. }
  597. .theme-preview {
  598. width: calc(100% / 15);
  599. height: var(--size-0);
  600. margin-top: var(--size-0);
  601. display: inline-block;
  602. }
  603. .theme-preview-00 {
  604. background-color: var(--base00);
  605. }
  606. .theme-preview-01 {
  607. background-color: var(--base01);
  608. }
  609. .theme-preview-02 {
  610. background-color: var(--base02);
  611. }
  612. .theme-preview-03 {
  613. background-color: var(--base03);
  614. }
  615. .theme-preview-04 {
  616. background-color: var(--base04);
  617. }
  618. .theme-preview-05 {
  619. background-color: var(--base05);
  620. }
  621. .theme-preview-06 {
  622. background-color: var(--base06);
  623. }
  624. .theme-preview-07 {
  625. background-color: var(--base07);
  626. }
  627. .theme-preview-08 {
  628. background-color: var(--base08);
  629. }
  630. .theme-preview-09 {
  631. background-color: var(--base09);
  632. }
  633. .theme-preview-0A {
  634. background-color: var(--base0A);
  635. }
  636. .theme-preview-0B {
  637. background-color: var(--base0B);
  638. }
  639. .theme-preview-0C {
  640. background-color: var(--base0C);
  641. }
  642. .theme-preview-0D {
  643. background-color: var(--base0D);
  644. }
  645. .theme-preview-0E {
  646. background-color: var(--base0E);
  647. }
  648. .theme-preview-0F {
  649. background-color: var(--base0F);
  650. }