style.css 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749
  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: 40px;
  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: 108%;
  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. margin-right: 30px;
  420. #padding: 0;
  421. }
  422. nav > ul > li {
  423. list-style: none;
  424. margin-right: var(--size--1);
  425. }
  426. .profile {
  427. display: flex;
  428. margin-bottom: var(--size-0);
  429. }
  430. progress {
  431. display: block;
  432. width: 100%;
  433. }
  434. progress::-moz-progress-bar,
  435. progress::-webkit-progress-value,
  436. progress {
  437. background: var(--blue);
  438. border-color: var(--blue);
  439. }
  440. summary {
  441. padding: var(--size--1);
  442. margin: var(--size-0) 0;
  443. cursor: pointer;
  444. background: var(--bg);
  445. border-radius: var(--common-radius);
  446. list-style-type: "+ ";
  447. border: var(--size--4) dashed var(--fg-status);
  448. }
  449. details[open] > summary {
  450. list-style-type: "− ";
  451. }
  452. .indent > details > summary {
  453. border: none;
  454. }
  455. .md-mention {
  456. -moz-user-select: all;
  457. -ms-user-select: all;
  458. -webkit-user-select: all;
  459. user-select: all;
  460. background: none;
  461. overflow: hidden;
  462. }
  463. table {
  464. width: 100%;
  465. table-layout: fixed;
  466. }
  467. td,
  468. th {
  469. padding: var(--size--1);
  470. outline: var(--size--4) solid var(--bg-status);
  471. }
  472. th {
  473. text-align: left;
  474. background-color: var(--bg-status);
  475. }
  476. input[type="search"] {
  477. width: 100%;
  478. margin: var(--size-0) 0;
  479. }
  480. .image-search-grid {
  481. display: grid;
  482. grid-template-columns: 1fr 1fr;
  483. grid-gap: var(--size-0);
  484. }
  485. .image-search-grid .image-result {
  486. display: flex;
  487. flex-direction: column;
  488. align-items: center;
  489. padding: var(--size--1) 0;
  490. background: var(--bg);
  491. border-radius: var(--common-radius);
  492. }
  493. .image-search-grid .image-result .result-text {
  494. hyphens: auto;
  495. text-align: center;
  496. }
  497. hr {
  498. border: var(--size--4) solid var(--fg-alt);
  499. }
  500. .form-button-group {
  501. display: flex;
  502. justify-content: space-between;
  503. margin: var(--size-0) 0;
  504. }
  505. /* sidebar only appears on big screens */
  506. @media (min-width: calc(45rem)) {
  507. body > nav > ul {
  508. justify-content: right;
  509. flex-direction: column;
  510. margin-right: var(--size-1);
  511. position: sticky;
  512. top: var(--size-0);
  513. }
  514. body > nav > ul > li {
  515. margin-bottom: var(--size-0);
  516. }
  517. main {
  518. width: 100%;
  519. max-width: var(--measure);
  520. }
  521. body {
  522. display: flex;
  523. justify-content: center;
  524. max-width: none;
  525. }
  526. }
  527. /* Use the browser's default font rendering instead of using our fancy
  528. * font-family above. This resolves a problem where some emoji were being
  529. * rendered in the system-ui font, which is rarely what we want.
  530. */
  531. .emoji {
  532. font-family: initial;
  533. }
  534. /* This indent is used on the summaries page to create an indent of 1. It might
  535. * be wise to nest these recursively on the thread view, which would make it so
  536. * that we don't need any inline CSS anymore.
  537. */
  538. .indent {
  539. padding-left: 1rem;
  540. border-left: var(--size--2) solid var(--bg-selection);
  541. }
  542. .mentions-image {
  543. grid-row: 1 / span 2;
  544. }
  545. .mentions-image > img {
  546. border: var(--fg) solid 1px;
  547. }
  548. .mentions-container .emoji {
  549. font-size: 1.5rem;
  550. }
  551. .mentions-name {
  552. font-size: 1.25rem;
  553. text-decoration: unset;
  554. }
  555. .mentions-name:hover {
  556. text-decoration: underline;
  557. }
  558. .emo-rel {
  559. display: inline-grid;
  560. align-items: center;
  561. grid-template-columns: 2rem auto;
  562. grid-column-gap: 0.25rem;
  563. }
  564. .mentions-listing {
  565. display: inline;
  566. background-color: var(--bg);
  567. padding: var(--size--1);
  568. border-radius: var(--common-radius);
  569. border: var(--size--4) solid var(--bg-status);
  570. user-select: all;
  571. font-size: var(--size--1);
  572. overflow-x: auto;
  573. width: 24rem;
  574. }
  575. section.post-preview {
  576. padding-top: 0;
  577. background: var(--bg-selection);
  578. border: var(--fg-alt) solid 1px;
  579. padding-right: 50px;
  580. }
  581. section.post-preview > section > footer {
  582. display: none;
  583. }
  584. section.post.blocked {
  585. font-style: italic;
  586. }
  587. section > footer > div > a:hover,
  588. section > footer > div > form > button:hover {
  589. text-decoration: underline;
  590. }
  591. .author-action {
  592. flex-grow: 1;
  593. }
  594. section header .author > a:first-child {
  595. margin-left: 0;
  596. color: var(--fg-light);
  597. font-weight: bold;
  598. }
  599. .theme-preview {
  600. width: calc(100% / 15);
  601. height: var(--size-0);
  602. margin-top: var(--size-0);
  603. display: inline-block;
  604. }
  605. .theme-preview-00 {
  606. background-color: var(--base00);
  607. }
  608. .theme-preview-01 {
  609. background-color: var(--base01);
  610. }
  611. .theme-preview-02 {
  612. background-color: var(--base02);
  613. }
  614. .theme-preview-03 {
  615. background-color: var(--base03);
  616. }
  617. .theme-preview-04 {
  618. background-color: var(--base04);
  619. }
  620. .theme-preview-05 {
  621. background-color: var(--base05);
  622. }
  623. .theme-preview-06 {
  624. background-color: var(--base06);
  625. }
  626. .theme-preview-07 {
  627. background-color: var(--base07);
  628. }
  629. .theme-preview-08 {
  630. background-color: var(--base08);
  631. }
  632. .theme-preview-09 {
  633. background-color: var(--base09);
  634. }
  635. .theme-preview-0A {
  636. background-color: var(--base0A);
  637. }
  638. .theme-preview-0B {
  639. background-color: var(--base0B);
  640. }
  641. .theme-preview-0C {
  642. background-color: var(--base0C);
  643. }
  644. .theme-preview-0D {
  645. background-color: var(--base0D);
  646. }
  647. .theme-preview-0E {
  648. background-color: var(--base0E);
  649. }
  650. .theme-preview-0F {
  651. background-color: var(--base0F);
  652. }