Something went wrong. Try again.
Local-first knowledge base made for Typst and the Atmosphere. typbase.at
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492/* * Styles for the DOM @typbase/codemirror emits: rendered frames, Typst token * classes, and notebook cells. * * Import once, before the host's own stylesheet: * * import "@typbase/codemirror/theme.css"; * * Editor chrome (cursor, selection, gutters, panels, tooltips) comes from the * `typstTheme` extension instead. CodeMirror mounts its base theme at runtime, * after a static stylesheet, so only a theme module replaces those rules * reliably. * * Rules read `--typst-*` properties from the block below. Override the block to * restyle; the selectors stay as they are. */
:root { --typst-font-text: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --typst-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; --typst-font-size: 1rem; --typst-font-features: normal; /* Material Symbols Rounded ligatures, used by notebook rails. */ --typst-icon-font: "Material Symbols Rounded";
--typst-color-text: #293133; --typst-color-text-secondary: #66716f; --typst-color-surface: #f9f9f8; --typst-color-surface-2: #f1f3f2; --typst-color-surface-3: #e7eae8; --typst-color-border: #dbe0dd; --typst-color-border-strong: #c6ccc8; --typst-color-accent: #1f6f6b; --typst-color-accent-soft: color-mix( in srgb, var(--typst-color-accent) 12%, var(--typst-color-surface) ); --typst-color-danger: #b3443e; --typst-color-warning: #85600e; --typst-color-ok: #3f704e; --typst-color-focus-ring: color-mix(in srgb, var(--typst-color-accent) 55%, transparent); --typst-color-red: #b3443e; --typst-color-yellow: #85600e; --typst-color-green: #3f704e; --typst-color-cyan: #2d7582; --typst-color-violet: #6b538f;
--typst-space-0-5: 0.125rem; --typst-space-1: 0.25rem; --typst-space-1-5: 0.375rem; --typst-space-2: 0.5rem; --typst-space-2-5: 0.625rem; --typst-space-3: 0.75rem; --typst-space-4: 1rem; --typst-space-8: 2rem;
--typst-text-xs: 0.75rem; --typst-text-sm: 0.8125rem; --typst-text-md: 0.875rem; --typst-text-lg: 1rem;
--typst-leading-none: 1; --typst-leading-tight: 1.3;
--typst-radius-xs: 0.25rem; --typst-radius-sm: 0.375rem; --typst-radius-md: 0.5rem; --typst-radius-full: 999px;
--typst-motion-fast: 120ms cubic-bezier(0.22, 1, 0.36, 1);
--typst-z-menu: 90; --typst-z-tooltip: 100;}
/* A compiled frame. The engine sets --render-w and --render-h from the SVG viewBox, and the container stays max-width: 100% so CodeMirror's flex layout does not widen with the render. */.typst-render { position: relative; display: inline-block; max-width: 100%; overflow: visible; vertical-align: top; user-select: none; -webkit-user-drag: none;}
/* A block-level SVG anchors at the container's top. Inline, it sits on the container's text baseline, so a frame shorter than the line box is pushed down and overflows the bottom. The pinned size also keeps the render from scaling down while the pane is narrower than what it was compiled for. */.typst-render svg { display: block; width: var(--render-w) !important; height: var(--render-h) !important; max-width: none !important;}
.cm-content[contenteditable="true"] .typst-render { border-radius: var(--typst-radius-xs); transition: background-color var(--typst-motion-fast);}
.cm-content[contenteditable="true"] .typst-render:hover { background-color: color-mix(in srgb, var(--typst-color-accent) 8%, transparent);}
.cm-content[contenteditable="true"] .typst-render svg { cursor: text;}
/* Equation popup rendered above the caret. The inner div is positioned by the tooltip code and translated by the equation's x offset. */.typst-popup-render { padding: var(--typst-space-4); max-height: min(70vh, 32rem); overflow: auto; overscroll-behavior: contain;}
.typst-popup-render div { position: relative;}
.typst-popup-render svg { width: 100% !important; height: 100% !important;}
/* Hints under a diagnostic message. */.typst-hints { color: var(--typst-color-text-secondary); font-size: var(--typst-text-md);}
/* Typst tokens from the engine highlighter and the static fallback. */.typ-comment { color: var(--typst-color-text-secondary);}
.typ-punct,.typ-escape { color: var(--typst-color-text-secondary);}
.typ-strong { font-weight: bold;}
.typ-emph { font-style: italic;}
.typ-link { color: var(--typst-color-accent); text-decoration: underline;}
.typ-raw { color: var(--typst-color-warning);}
/* Source in code, math, and raw blocks gets the code face even though the editor's prose uses the text font. The `typ-code` and `typ-equation` marks cover the whole span, so text without a token class follows too. */.typ-raw,.typ-code,.typ-equation,.typ-math-delim,.typ-math-op,.typ-math-group { font-family: var(--typst-font-mono);}
.typ-label,.typ-ref { color: color-mix(in srgb, var(--typst-color-accent) 70%, var(--typst-color-text));}
.typ-heading { color: var(--typst-color-text);}
/* Sizes match the engine's heading ratios, so a heading does not change size when it switches between source and render. */.typ-heading-level-1 { color: var(--typst-color-accent); font-size: 2em; font-weight: 400;}
.typ-heading-level-2 { color: var(--typst-color-violet); font-size: 1.75em; font-weight: 400;}
.typ-heading-level-3 { color: var(--typst-color-cyan); font-size: 1.5em; font-weight: 400;}
.typ-heading-level-4 { color: var(--typst-color-green); font-size: 1.375em; font-weight: 400;}
.typ-heading-level-5 { color: var(--typst-color-yellow); font-size: 1em; font-weight: 500;}
.typ-heading-level-6 { color: var(--typst-color-red); font-size: 0.875em; font-weight: 500;}
.typ-marker { color: var(--typst-color-text-secondary); font-weight: bold;}
.typ-term { font-weight: bold;}
.typ-equation { font-style: italic;}
.typ-equation > * { font-style: normal;}
.typ-math-delim { color: var(--typst-color-text-secondary);}
.typ-math-op,.typ-op { color: var(--typst-color-danger);}
.typ-key { color: var(--typst-color-accent);}
.typ-num,.typ-str { color: var(--typst-color-warning);}
.typ-func { color: color-mix(in srgb, var(--typst-color-accent) 70%, var(--typst-color-text));}
.typ-pol { color: var(--typst-color-text);}
.typ-error { color: var(--typst-color-danger);}
/* Notebook cells. A cell marker rides the attribute line when the cell has one and otherwise takes a line of its own. */.tb-cell-rail { display: flex; align-items: center; gap: var(--typst-space-1); min-height: 1.6rem; padding: 0 var(--typst-space-1); margin-right: var(--typst-space-2); color: var(--typst-color-text-secondary); font-size: var(--typst-text-xs); line-height: 1; user-select: none; vertical-align: middle; opacity: 0.55; transition: opacity var(--typst-motion-fast);}
.tb-cell-rail:hover,.tb-cell-rail:focus-within { opacity: 1;}
.tb-cell-chip { display: inline-flex; align-items: center; gap: var(--typst-space-1);}
.tb-cell-held { color: var(--typst-color-warning);}
.tb-cell-btn { display: inline-flex; align-items: center; justify-content: center; width: 1.5rem; height: 1.5rem; padding: 0; border: none; border-radius: var(--typst-radius-sm); background: transparent; color: inherit; font-size: var(--typst-text-xs); cursor: pointer; transition: color var(--typst-motion-fast), background-color var(--typst-motion-fast);}
.tb-cell-btn:hover { color: var(--typst-color-text); background: var(--typst-color-surface-2);}
.tb-cell-btn:focus-visible { outline: 2px solid var(--typst-color-accent); outline-offset: 1px;}
.tb-cell-active { border-left: 2px solid var(--typst-color-accent) !important; margin-left: calc(-1 * var(--typst-space-2) - 2px); padding-left: var(--typst-space-2) !important;}
.tb-cell-attribute { color: var(--typst-color-text-secondary); font-size: var(--typst-text-xs);}
.tb-cell-attribute.cm-line { margin-left: calc(-1 * var(--typst-space-2) - 2px); padding-left: var(--typst-space-2); border-left: 2px solid var(--typst-color-border-strong);}
.tb-cell-output { margin: var(--typst-space-1) 0 var(--typst-space-3); padding-left: var(--typst-space-3); border-left: 2px solid var(--typst-color-border);}
.tb-cell-output--cleared,.tb-cell-output--empty { display: none;}
.tb-cell-output--offscreen { height: 0; margin: 0; padding: 0; border: none;}
.tb-cell-output-body { display: flex; flex-direction: column; gap: var(--typst-space-1);}
.tb-cell-frame { overflow: hidden;}
.tb-cell-frame .typst-render { cursor: text;}
.tb-cell-empty { font-size: var(--typst-text-xs); font-style: italic; color: var(--typst-color-text-secondary);}
.tb-cell-stale { display: flex; align-items: center; gap: var(--typst-space-1); margin-top: var(--typst-space-1); font-size: var(--typst-text-xs); color: var(--typst-color-text-secondary);}
.tb-cell-diagnostics { display: flex; flex-direction: column; gap: var(--typst-space-1); margin: var(--typst-space-1) 0 var(--typst-space-2); padding-left: var(--typst-space-3); border-left: 2px solid var(--typst-color-border);}
.tb-cell-diagnostic { padding: var(--typst-space-1-5) var(--typst-space-2); font-size: var(--typst-text-sm); color: var(--typst-color-danger); background: color-mix(in srgb, var(--typst-color-danger) 8%, transparent); border-radius: var(--typst-radius-sm); white-space: pre-wrap;}
.tb-cell-diagnostic--warning { color: var(--typst-color-warning); background: color-mix(in srgb, var(--typst-color-warning) 8%, transparent);}
.tb-cell-diagnostic--info { color: var(--typst-color-accent); background: color-mix(in srgb, var(--typst-color-accent) 8%, transparent);}
.tb-cell-diagnostic--hint { color: var(--typst-color-text-secondary); background: var(--typst-color-surface-2);}
.tb-cell-diagnostic ul { margin: var(--typst-space-1) 0 0; padding-left: var(--typst-space-4); color: var(--typst-color-text-secondary);}
/* The rail's overflow menu is portaled to the body. A host that already styles `.menu` wins these defaults; a host without one still gets a usable menu. */.tb-cell-menu { display: flex; flex-direction: column; gap: var(--typst-space-0-5); min-width: 10rem; padding: var(--typst-space-1); color: var(--typst-color-text); font-family: var(--typst-font-text); font-size: var(--typst-text-md); background: var(--typst-color-surface); border: 1px solid var(--typst-color-border); border-radius: var(--typst-radius-md); box-shadow: 0 8px 24px rgb(0 0 0 / 0.12); z-index: var(--typst-z-menu);}
.tb-cell-menu :where(.menu__item) { display: flex; align-items: center; gap: var(--typst-space-2); width: 100%; padding: var(--typst-space-2); font: inherit; text-align: left; color: inherit; background: transparent; border: none; border-radius: var(--typst-radius-sm); cursor: pointer;}
.tb-cell-menu :where(.menu__item):hover,.tb-cell-menu :where(.menu__item):focus-visible { background: var(--typst-color-surface-2); outline: none;}
/* Icons are Material Symbols ligatures. Scaling to the rail's inline size keeps the glyph on the text baseline. */.tb-cell-rail .material-symbols-rounded,.tb-cell-menu .material-symbols-rounded { display: inline-block; font-family: var(--typst-icon-font); font-weight: normal; font-style: normal; line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap; word-wrap: normal; direction: ltr; font-feature-settings: "liga"; -webkit-font-feature-settings: "liga"; -webkit-font-smoothing: antialiased;}