STYLE

tcmts.site.STYLE · #tswbm6to · term · runs anywhere

export const STYLE = `/* tcm-ts docs: a text file with a menu */
:root { --bg: #fff; --fg: #111; --dim: #777; --rule: #999; --link: #00e; --visited: #551a8b; --here: #111; --code: #f4f4f1; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #0c0c0c; --fg: #d6d6d6; --dim: #7a7a7a; --rule: #555; --link: #8ab4ff; --visited: #c4a3ff; --here: #fff; --code: #151515; }
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--fg); }
body { margin: 0; font: 15px/1.55 "Courier New", Courier, ui-monospace, monospace; }
.site { display: grid; grid-template-columns: 30ch minmax(0, 76ch); gap: 0 5ch; padding: 32px 24px 64px; justify-content: center; }
a { color: var(--link); } a:visited { color: var(--visited); }
.rule { height: 1.55em; overflow: hidden; color: var(--rule); }
.rule::before { content: "------------------------------------------------------------------------------------------------------------------------"; }
h1 + .rule::before, .side .rule::before { content: "========================================================================================================================"; }

/* the menu */
.side { position: sticky; top: 32px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto; }
.side .home { color: var(--fg); text-decoration: none; font-weight: bold; }
.side ol { list-style: none; margin: 0; padding: 0; }
.side .filter { display: block; width: 100%; margin: 0 0 8px; padding: 1px 1ch; font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--rule); border-radius: 0; }
.side li { margin: 0 0 1px; }
.side li.section { margin: 14px 0 3px; color: var(--dim); }
.side li.section::before { content: "-- "; }
.side li > a, .side li > span { display: block; padding-left: 2ch; }
.side li.here > span { font-weight: bold; color: var(--here); }
.side li.here > span::before { content: "> "; margin-left: -2ch; }
.side ul { list-style: none; margin: 2px 0 6px 6ch; padding: 0; font-size: 13.5px; }
.side ul li { padding-left: 5ch; text-indent: -5ch; }
.side ul a { display: inline; padding: 0; color: var(--dim); text-decoration: none; } .side ul a:hover { text-decoration: underline; }

/* the page */
main { min-width: 0; }
h1, h2, h3 { font: inherit; font-weight: bold; margin: 26px 0 8px; }
h1 { text-transform: uppercase; margin: 0; }
h2 { text-transform: uppercase; }
p, ul, ol, .table { margin: 0 0 14px; }
ul, ol { padding-left: 4ch; } li { margin: 2px 0; }
code { font: inherit; }
pre { margin: 0 0 14px; padding: 8px 2ch; background: var(--code); overflow-x: auto; font: inherit; }
pre.shiki { background: var(--code) !important; }
pre.shiki code { font: inherit; }
.shiki span { color: var(--shiki-light); }
@media (prefers-color-scheme: dark) { .shiki span { color: var(--shiki-dark); } }
.table { overflow-x: auto; }
table { border-collapse: collapse; }
th { font-weight: normal; text-decoration: underline; text-align: left; }
th, td { padding: 1px 3ch 1px 0; vertical-align: top; }
dl { margin: 0 0 14px; }
dt { margin-top: 10px; font-weight: bold; } dt:first-child { margin-top: 0; }
dd { margin: 0 0 0 4ch; }
blockquote { margin: 0 0 14px; padding-left: 2ch; border-left: 1px solid var(--rule); }
.path { color: var(--dim); }
footer { display: flex; justify-content: space-between; }
.build { color: var(--dim); margin-top: 6px; }
:target { background: color-mix(in srgb, var(--link) 15%, transparent); }

/* the code browser: VS Code's default colours (Light+, Dark+), following the system */
:root { --k: #0000ff; --x: #af00db; --s: #a31515; --n: #098658; --c: #008000; --f: #795e26; --t: #267f99; --g: #800000; --a: #e50000; }
@media (prefers-color-scheme: dark) {
  :root { --k: #569cd6; --x: #c586c0; --s: #ce9178; --n: #b5cea8; --c: #6a9955; --f: #dcdcaa; --t: #4ec9b0; --g: #569cd6; --a: #9cdcfe; }
}
.code { white-space: pre; }
.code .k { color: var(--k); } .code .x { color: var(--x); } .code .s { color: var(--s); } .code .n { color: var(--n); }
.code .c { color: var(--c); font-style: italic; } .code .f { color: var(--f); } .code .t { color: var(--t); }
.code .g { color: var(--g); } .code .a { color: var(--a); }
.code a.ref { color: inherit; text-decoration: none; } .code a.ref[href]:hover { text-decoration: underline; }
.code a.ref.s { color: var(--s); } .code a.ref.f { color: var(--f); } .code a.ref.t { color: var(--t); }
.meta, .why, .sig { color: var(--dim); }
.side .crumbs { margin: 0 0 8px; overflow-wrap: anywhere; }
.side .code-list li.ns > a { font-weight: bold; }
.side .code-list li.group { color: var(--dim); text-transform: uppercase; margin-top: 8px; list-style: none; }
ul.refs { columns: 2; list-style: none; padding-left: 0; }
.file-image { max-width: 100%; }

/* an image in a page: the page's width, and full size over the page when pressed (the page's target) */
a.image { display: block; cursor: zoom-in; }
a.image img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); }
a.image:target { position: fixed; inset: 0; z-index: 10; overflow: auto; padding: 40px 16px 16px; background: var(--bg); cursor: default; }
a.image:target img { width: auto; max-width: none; margin: 0 auto; }
.image-close { display: none; }
a.image:target + .image-close { display: block; position: fixed; top: 10px; right: 16px; z-index: 11; }

/* narrow screens: the menu goes on top */
@media (max-width: 900px) {
  .site { display: block; padding: 20px 16px 48px; }
  .side { position: static; max-height: none; margin-bottom: 20px; }
  .side ol { columns: 2; } .side ul { display: none; }
}
`

used by