8356
Wx
www-xonecas-io / files
www-xonecas-io / internal / site / assets / site.css
8.5 KB
1@import "tailwindcss"; 2@plugin "@tailwindcss/typography"; 3@source "../templates"; 4@source inline("bg-{fe,be,both,none,h0,h1,h2,h3,h4,h5,h6,paper,card,ink,soft,edge,line,empty,accent,det,pre,add,del} text-{t0,t1,t2,t3,t4,t5,t6}"); 5 6/* Every colour is light-dark(): the page follows the system, and data-theme forces one. */ 7@theme { 8 --color-paper: light-dark(#f4efe3, #15140f); 9 --color-card: light-dark(#fffaf0, #1d1b15); 10 --color-ink: light-dark(#1a1a1a, #f1ead8); 11 --color-soft: light-dark(#1a1a1ab3, #f1ead899); 12 /* edge: structural lines. ink in light; in dark a quiet warm grey (3:1 on paper), so borders do not outshine text. */ 13 --color-edge: light-dark(#1a1a1a, #6b6453); 14 --color-line: light-dark(#1a1a1a22, #f1ead81f); 15 --color-empty: light-dark(#e7dfcd, #25231c); 16 --color-accent: light-dark(#9e411c, #ffc94d); 17 --color-det: light-dark(#1a1a1a, #ffd166); 18 --color-det-fg: light-dark(#ffd166, #15140f); 19 --color-pre: light-dark(#1a1a1a, #0b0a07); 20 --color-pre-fg: light-dark(#f4efe3, #f1ead8); 21 --color-add: light-dark(#dcefcc, #22321b); 22 --color-del: light-dark(#f6d9cb, #3b2219); 23 24 /* groups: the element tile colours */ 25 --color-fe: light-dark(#ffd166, #f2c45a); 26 --color-be: light-dark(#9bd1ff, #86bde8); 27 --color-both: light-dark(#c7ecb0, #b2d99a); 28 --color-none: light-dark(#ddd3bd, #bfb49c); 29 --color-tile-ink: #111; 30 31 /* heat: h0 is empty, h6 the busiest; tN is the text on hN */ 32 --color-h0: var(--color-empty); 33 --color-h1: light-dark(#f8e6ae, #4d3f22); 34 --color-h2: light-dark(#ffd166, #6e5626); 35 --color-h3: light-dark(#f5a64f, #8f6a28); 36 --color-h4: light-dark(#dd7034, #c48f2e); 37 --color-h5: light-dark(#a8461f, #efb63e); 38 --color-h6: light-dark(#1a1a1a, #ffe7a0); 39 --color-t0: var(--color-soft); 40 --color-t1: light-dark(#1a1a1a99, #f1ead8); 41 --color-t2: light-dark(#1a1a1a, #f1ead8); 42 --color-t3: light-dark(#1a1a1a, #f1ead8); 43 --color-t4: light-dark(#1a1a1a, #15140f); 44 --color-t5: light-dark(#fffaf0, #15140f); 45 --color-t6: light-dark(#ffd166, #15140f); 46 47 --font-sans: "IBM Plex Sans Condensed", "Arial Narrow", sans-serif; 48 --font-mono: "IBM Plex Mono", ui-monospace, monospace; 49 --font-serif: "IBM Plex Serif", Georgia, serif; 50} 51 52@layer base { 53 :root { color-scheme: light dark; } 54 [data-theme=light] { color-scheme: light; } 55 [data-theme=dark] { color-scheme: dark; } 56 body { -webkit-text-size-adjust: 100%; } 57} 58 59/* READMEs: the typography plugin in the site's colours, so both themes follow. */ 60.prose { 61 --tw-prose-body: var(--color-ink); 62 --tw-prose-headings: var(--color-ink); 63 --tw-prose-lead: var(--color-soft); 64 --tw-prose-links: var(--color-accent); 65 --tw-prose-bold: var(--color-ink); 66 --tw-prose-counters: var(--color-soft); 67 --tw-prose-bullets: var(--color-soft); 68 --tw-prose-hr: var(--color-line); 69 --tw-prose-quotes: var(--color-soft); 70 --tw-prose-quote-borders: var(--color-line); 71 --tw-prose-captions: var(--color-soft); 72 --tw-prose-code: var(--color-accent); 73 --tw-prose-pre-code: var(--color-pre-fg); 74 --tw-prose-pre-bg: var(--color-pre); 75 --tw-prose-th-borders: var(--color-edge); 76 --tw-prose-td-borders: var(--color-line); 77 font-size: 15.5px; 78} 79.prose :where(pre) { border-radius: 2px; font-size: 12.5px; } 80.prose :where(img) { display: inline; margin: 0; } 81.prose :where(code)::before, .prose :where(code)::after, .prose :where(blockquote p)::before, .prose :where(blockquote p)::after { content: none; } 82 83/* One diff line. Commit pages hold thousands, so the markup stays short. */ 84@layer components { 85 .dl { display: grid; grid-template-columns: 2.5rem 2.5rem 1rem 1fr; width: max-content; min-width: 100%; } 86 .dl.add { background: var(--color-add); } 87 .dl.del { background: var(--color-del); } 88 .dl > i { font-style: normal; text-align: right; padding-right: .5rem; color: var(--color-soft); user-select: none; } 89 .dl > b { user-select: none; } 90 .dl > span { white-space: pre; padding-right: 1rem; } 91} 92 93/* Highlighted files. The code block is dark in both themes, so one palette fits. */ 94@layer components { 95 .code { margin: 0; padding-right: 1rem; tab-size: 4; } 96 .code > span { display: block; } 97 .code > span:target { background: #ffd16626; } 98 .code > span > a { display: inline-block; min-width: 3.5rem; padding-right: 1rem; text-align: right; color: #f1ead88c; text-decoration: none; user-select: none; } 99 .code b { font-weight: inherit; } 100 .code .c, .code .cp { color: #f1ead880; font-style: italic; } 101 .code .k { color: #ffc94d; } 102 .code .s { color: #c7ecb0; } 103 .code .m, .code .na, .code .nb { color: #9bd1ff; } 104 .code .nf, .code .nc { color: #f5a64f; } 105 .code .nt { color: #ffd166; } 106} 107 108/* Two-thumb range: two range inputs stacked on a track under a bar per month, and only their thumbs take the pointer. 109 The bars are inset by half a thumb so each lines up with the thumb position of its month. */ 110.range { position: relative; height: 4rem; } 111.range::before { content: ""; position: absolute; inset: auto 0 calc(.75rem - 1.5px); height: 3px; background: var(--color-edge); } 112#bars { position: absolute; inset: 0 .625rem 1.75rem; display: flex; align-items: flex-end; } 113#bars i { flex: 1; min-height: 2px; background: var(--color-line); } 114#bars i.on { background: var(--color-accent); } 115@media (width >= 40rem) { #bars { gap: 1px; } } 116.range input { position: absolute; inset: auto 0 0; height: 1.5rem; width: 100%; margin: 0; appearance: none; background: none; pointer-events: none; } 117.range input::-webkit-slider-thumb { appearance: none; pointer-events: auto; width: 1.25rem; height: 1.25rem; border: 1.5px solid var(--color-edge); border-radius: 2px; background: var(--color-accent); cursor: grab; } 118.range input::-moz-range-thumb { pointer-events: auto; width: 1.25rem; height: 1.25rem; box-sizing: border-box; border: 1.5px solid var(--color-edge); border-radius: 2px; background: var(--color-accent); cursor: grab; } 119.range input:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--color-ink); outline-offset: 2px; } 120.range input:focus-visible::-moz-range-thumb { outline: 2px solid var(--color-ink); outline-offset: 2px; } 121 122/* Pager (the "pager" component): small and soft, with the current page in ink and a dead arrow faded. */ 123.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem; margin-top: 2rem; font: .8rem var(--font-mono); color: var(--color-soft); } 124.pager > * { min-width: 1.75rem; padding: .25rem .375rem; text-align: center; border-radius: 2px; color: inherit; text-decoration: none; } 125.pager a:hover { color: var(--color-ink); background: var(--color-line); } 126.pager [aria-current] { color: var(--color-paper); background: var(--color-ink); } 127.pager [aria-label] { font: 1rem/1 var(--font-sans); } 128.pager span[aria-label] { opacity: .35; } 129 130/* Tag pools: linked chips pop in one after another (--i is their place), then lift and fill on hover. */ 131.pool > a { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1) backwards; animation-delay: calc(var(--i, 0) * 18ms); transition: transform .12s, box-shadow .12s; } 132.pool > a > span { transition: background-color .12s, color .12s; } 133.pool > a:hover, .pool > a:focus-visible { transform: translate(-2px, -2px); box-shadow: 2px 2px 0 var(--color-edge); } 134.pool > a:hover > span, .pool > a:focus-visible > span { background: var(--color-accent); color: var(--color-paper); } 135.pool > a:active { transform: none; box-shadow: none; } 136@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.85); } } 137@media (prefers-reduced-motion: reduce) { .pool > a { animation: none; transition: none; } .pool > a:hover, .pool > a:focus-visible { transform: none; } } 138 139/* Search suggestions, from /suggest: a card under the header search, the row under the pointer or focus in accent. */ 140#suggest { position: absolute; z-index: 20; top: calc(100% + 4px); right: 0; width: 100%; min-width: min(24rem, calc(100vw - 2rem)); background: var(--color-card); border: 1.5px solid var(--color-edge); border-radius: 2px; box-shadow: 3px 3px 0 var(--color-edge); font-size: .875rem; } 141#suggest a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .75rem; align-items: baseline; padding: .375rem .75rem; color: inherit; text-decoration: none; } 142#suggest a + a { border-top: 1px solid var(--color-line); } 143#suggest span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-soft); font-size: .8rem; } 144#suggest a:is(:hover, :focus-visible) { background: var(--color-accent); color: var(--color-paper); outline: none; } 145#suggest a:is(:hover, :focus-visible) span { color: inherit; opacity: .85; } 146/* Suggestions show while the search has focus or the pointer, so a click lands on one. */ 147#suggest:empty, .search:not(:focus-within, :hover) #suggest { display: none; }