/* * Code typography and lowlight highlighting. * * The literal-code rules intentionally disable font ligatures for both inline * code and code blocks. Command flags such as `--extra` must render as the * exact characters the user can copy. */ /* Inline code */ .rich-text-editor code { font-family: var(--font-mono, ui-monospace, monospace); font-variant-ligatures: none; font-feature-settings: "liga" 0; font-size: var(--text-body); background: color-mix(in srgb, var(--foreground) 3%, transparent); border: 1px solid color-mix(in srgb, var(--foreground) 5%, transparent); color: color-mix(in srgb, var(--foreground) 75%, transparent); padding: 0.125rem 0.375rem; border-radius: var(--radius-sm); box-decoration-break: clone; -webkit-box-decoration-break: clone; line-height: 2; } /* Code blocks */ .rich-text-editor pre, pre.rich-text-editor { font-family: var(--font-mono, ui-monospace, monospace); font-variant-ligatures: none; font-feature-settings: "liga" 0; background: var(--muted); border-radius: var(--radius); padding: 0.75rem 1rem; margin: 0.75rem 0; /* Long lines wrap, matching the editable code block (its NodeViewContent sets an inline pre-wrap). Without this, readonly blocks scroll while editable blocks wrap and the same document changes shape between the two renderers. overflow-x stays as a fallback for unbreakable tokens. */ white-space: pre-wrap; overflow-x: auto; } .rich-text-editor pre code, pre.rich-text-editor code { font-variant-ligatures: none; font-feature-settings: "liga" 0; background: none; border: none; color: var(--foreground); padding: 0; font-size: var(--text-label); line-height: 1.6; } /* Syntax highlighting — lowlight (hljs). Scoped to the editor surface and to the task transcript, which highlights file bodies with the same engine so a file reads identically in a comment and in an execution trace. */ :is(.rich-text-editor, .transcript-code) .hljs-keyword, :is(.rich-text-editor, .transcript-code) .hljs-selector-tag, :is(.rich-text-editor, .transcript-code) .hljs-built_in { color: oklch(0.55 0.16 255); } :is(.rich-text-editor, .transcript-code) .hljs-string, :is(.rich-text-editor, .transcript-code) .hljs-addition { color: oklch(0.55 0.14 155); } :is(.rich-text-editor, .transcript-code) .hljs-comment, :is(.rich-text-editor, .transcript-code) .hljs-quote { color: var(--muted-foreground); font-style: italic; } :is(.rich-text-editor, .transcript-code) .hljs-number, :is(.rich-text-editor, .transcript-code) .hljs-literal { color: oklch(0.58 0.16 30); } :is(.rich-text-editor, .transcript-code) .hljs-title, :is(.rich-text-editor, .transcript-code) .hljs-section, :is(.rich-text-editor, .transcript-code) .hljs-title\.function_ { color: oklch(0.55 0.14 280); } :is(.rich-text-editor, .transcript-code) .hljs-attr, :is(.rich-text-editor, .transcript-code) .hljs-attribute { color: oklch(0.58 0.12 60); } :is(.rich-text-editor, .transcript-code) .hljs-variable, :is(.rich-text-editor, .transcript-code) .hljs-template-variable { color: oklch(0.58 0.14 20); } :is(.rich-text-editor, .transcript-code) .hljs-type, :is(.rich-text-editor, .transcript-code) .hljs-title\.class_ { color: oklch(0.55 0.14 200); } :is(.rich-text-editor, .transcript-code) .hljs-deletion { color: oklch(0.55 0.2 25); } :is(.rich-text-editor, .transcript-code) .hljs-meta { color: var(--muted-foreground); } /* XML / HTML — lowlight emits .hljs-tag for `<` `>` brackets and .hljs-name for the element name. Without these rules, HTML source renders mostly in the default text color and looks unhighlighted. */ :is(.rich-text-editor, .transcript-code) .hljs-tag { color: var(--muted-foreground); } :is(.rich-text-editor, .transcript-code) .hljs-name { color: oklch(0.55 0.16 255); } /* Dark mode overrides */ .dark :is(.rich-text-editor, .transcript-code) .hljs-keyword, .dark :is(.rich-text-editor, .transcript-code) .hljs-selector-tag, .dark :is(.rich-text-editor, .transcript-code) .hljs-built_in { color: oklch(0.7 0.14 255); } .dark :is(.rich-text-editor, .transcript-code) .hljs-string, .dark :is(.rich-text-editor, .transcript-code) .hljs-addition { color: oklch(0.7 0.14 155); } .dark :is(.rich-text-editor, .transcript-code) .hljs-number, .dark :is(.rich-text-editor, .transcript-code) .hljs-literal { color: oklch(0.72 0.14 30); } .dark :is(.rich-text-editor, .transcript-code) .hljs-title, .dark :is(.rich-text-editor, .transcript-code) .hljs-section, .dark :is(.rich-text-editor, .transcript-code) .hljs-title\.function_ { color: oklch(0.72 0.12 280); } .dark :is(.rich-text-editor, .transcript-code) .hljs-attr, .dark :is(.rich-text-editor, .transcript-code) .hljs-attribute { color: oklch(0.72 0.1 60); } .dark :is(.rich-text-editor, .transcript-code) .hljs-variable, .dark :is(.rich-text-editor, .transcript-code) .hljs-template-variable { color: oklch(0.72 0.12 20); } .dark :is(.rich-text-editor, .transcript-code) .hljs-type, .dark :is(.rich-text-editor, .transcript-code) .hljs-title\.class_ { color: oklch(0.72 0.12 200); } .dark :is(.rich-text-editor, .transcript-code) .hljs-deletion { color: oklch(0.7 0.18 25); } .dark :is(.rich-text-editor, .transcript-code) .hljs-name { color: oklch(0.72 0.14 255); }