/* Matches the composer's session mention (packages/app/src/composer/editor/editor.css). */ .markdown-session-link { display: inline; padding: 0; border: 0; border-radius: 2px; background: none; color: var(--v2-text-text-muted); font: inherit; font-weight: var(--font-weight-medium); text-align: start; cursor: pointer; } .markdown-session-link:hover { text-decoration: underline; text-underline-offset: 2px; } .markdown-session-link:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; } .markdown-session-id { font-family: var(--font-family-mono); } /* Pele colors a diagram from these, in a message and maximized. */ :is([data-component="markdown-mermaid"], [data-component="diagram-preview"]) { --pele-bg: var(--v2-background-bg-layer-02); --pele-fg: var(--v2-text-text-base); --pele-muted: var(--v2-text-text-muted); --pele-line: var(--v2-icon-icon-muted); --pele-surface: var(--v2-background-bg-base); --pele-surface-alt: var(--v2-background-bg-layer-03); --pele-border: var(--v2-border-border-strong); --pele-accent: var(--v2-text-text-accent); --pele-critical: var(--v2-state-fg-danger); --pele-error: var(--v2-state-fg-danger); --pele-font: var(--font-family-sans); --pele-font-mono: var(--font-family-mono); --pele-radius: 6px; } [data-component="markdown"] { --markdown-inline-code-path-color: var(--v2-text-text-code-path); --markdown-inline-code-bg-mix: 8%; --markdown-shell-code-background: var(--v2-background-bg-layer-02); --markdown-shell-code-border: var(--v2-border-border-muted); --markdown-shell-code-color: var(--v2-text-text-base); --markdown-shell-code-token-color: currentColor; /* Reset & Base Typography */ min-width: 0; max-width: 100%; overflow-wrap: break-word; color: var(--v2-text-text-base); font-family: var(--font-family-sans); font-size: var(--font-size-base); /* 14px */ line-height: 160%; /* Shells such as the app's turn off selection for chrome; Markdown is content, so it stays selectable. */ -webkit-user-select: text; user-select: text; [data-markdown-word] { display: inline; } :is([data-markdown-word], code)[data-markdown-enter] { animation: markdown-word-enter 180ms ease-out both; } /* Spacing for flow */ > *:first-child { margin-top: 0; } > *:last-child { margin-bottom: 0; } > [data-markdown-block]:first-child > *:first-child { margin-top: 0; } > [data-markdown-block]:last-child > *:last-child { margin-bottom: 0; } /* Pretty wrapping would move settled words as each token arrives, so the growing block stays greedy until it completes. */ &[data-streaming] > [data-markdown-block]:last-child { text-wrap-style: auto; } /* Headings: Sized by level, distinguished by color and spacing */ h1 { font-size: 17px; color: var(--v2-text-text-base); font-weight: 600; margin-top: 28px; margin-bottom: 12px; line-height: var(--line-height-large); } h2 { font-size: 15px; color: var(--v2-text-text-base); font-weight: 600; margin-top: 24px; margin-bottom: 10px; line-height: var(--line-height-large); } h3 { font-size: 14px; color: var(--v2-text-text-base); font-weight: var(--font-weight-bold); margin-top: 20px; margin-bottom: 8px; line-height: var(--line-height-large); } h4, h5, h6 { font-size: 14px; color: var(--v2-text-text-muted); font-weight: var(--font-weight-medium); margin-top: 20px; margin-bottom: 8px; line-height: var(--line-height-large); } /* A heading's own bottom margin sets the gap to its section, so a block's larger top margin can't push the heading away from it. */ :is(h1, h2, h3, h4, h5, h6) + :is(p, ul, ol, blockquote, [data-component]), :is(h1, h2, h3, h4, h5, h6) + [data-component="markdown-code"] > :is(pre, [data-slot="markdown-code-content"]) { margin-top: 0; } /* Emphasis & Strong: Neutral strong color */ strong, b { color: var(--v2-text-text-base); font-weight: var(--font-weight-bold); } /* Paragraphs */ p { margin-bottom: 12px; } /* Links */ a { color: var(--v2-text-text-accent); text-decoration: none; font-weight: inherit; } a:hover { color: var(--v2-text-text-accent-hover); text-decoration: underline; text-underline-offset: 2px; } /* An atomic inline such as inline-block leaves a line break opportunity before the label, so the icon stays an empty inline box with out-of-flow artwork, which keeps it on the line of the label's first word. The artwork is a pseudo-element because an out-of-flow element is a block, and Chromium ends a triple-click paragraph selection at a block. The hidden img only reports when the favicon has loaded. */ .markdown-link-favicon { position: relative; padding-inline-start: 14px; margin-inline-end: 4px; } .markdown-link-favicon::before { content: ""; position: absolute; inset: 0; height: 14px; margin: auto 0; background: currentColor; mask: url("./markdown-globe.svg") center / contain no-repeat; } .markdown-link-favicon[data-github]::before { mask-image: url("./markdown-github.svg"); } .markdown-link-favicon[data-loaded]::before { border-radius: 2px; background: var(--markdown-link-favicon) center / contain no-repeat; mask: none; } .markdown-link-favicon img { display: none; } a[data-local-link] { cursor: pointer; } &[data-local-links] :not(pre) > code[data-inline-code-kind="path"]:not(a > code) { cursor: pointer; } &[data-local-links] :not(pre) > code[data-inline-code-kind="path"]:not(a > code):hover { text-decoration: underline; text-decoration-color: color-mix(in oklch, var(--markdown-inline-code-path-color) 40%, transparent); text-underline-offset: 2px; } /* Lists */ ul, ol { margin-top: 8px; margin-bottom: 12px; margin-inline-start: 0; padding-inline-start: 32px; list-style-position: outside; } ul { list-style-type: disc; } ol { list-style-type: decimal; } li { margin-bottom: 8px; } li > p:first-child { display: inline; margin: 0; } li:has(> input[type="checkbox"]), li:has(> p > input[type="checkbox"]) { position: relative; list-style-type: none; } li > input[type="checkbox"], li > p > input[type="checkbox"] { position: absolute; top: 4px; inset-inline-start: -20px; margin: 0; } li > p + p { display: block; margin-top: 0.5rem; } li::marker { color: var(--v2-text-text-muted); } /* Nested lists spacing */ li > ul, li > ol { margin-top: 0.25rem; margin-bottom: 0.25rem; padding-inline-start: 1rem; /* Minimal indent for nesting only */ } li > ol { padding-inline-start: 1.75rem; } /* Blockquotes */ blockquote { border-inline-start: 0.5px solid var(--v2-border-border-base); margin: 1rem 0; padding-inline-start: 0.5rem; color: var(--v2-text-text-muted); font-style: normal; } /* Horizontal Rule - Invisible spacing only */ hr { border: none; height: 0; margin: 32px 0; } .highlights { background: var(--color-background-stronger); color: var(--v2-text-text-muted); font-size: 13px; line-height: 20px; padding: 12px; border-radius: 6px; border: 0.5px solid var(--v2-border-border-base); } [data-component="markdown-code"] { position: relative; direction: ltr; unicode-bidi: isolate; } [data-component="markdown-mermaid"] { min-height: 96px; margin: 12px 0 24px; padding: 16px; overflow: auto; border: 0.5px solid var(--v2-border-border-base); border-radius: 6px; background: var(--v2-background-bg-layer-02); direction: ltr; unicode-bidi: isolate; } [data-component="markdown-mermaid"] > svg { display: block; max-width: 100%; height: auto; margin: 0 auto; } [data-slot="markdown-mermaid-maximize"] { display: none; position: absolute; top: 4px; inset-inline-end: 4px; transition: opacity 0.15s ease; z-index: 1; @media (hover: hover) { opacity: 0; } } [data-component="markdown-code"][data-mermaid-ready="true"] > [data-slot="markdown-mermaid-maximize"] { display: block; } [data-component="markdown-code"]:hover > [data-slot="markdown-mermaid-maximize"], [data-slot="markdown-mermaid-maximize"]:focus-within { opacity: 1; } [data-component="markdown-code"][data-mermaid-pending="true"] > pre, [data-component="markdown-code"][data-mermaid-pending="true"] > [data-slot="markdown-code-toolbar"], [data-component="markdown-code"][data-mermaid-ready="true"] > pre, [data-component="markdown-code"][data-mermaid-ready="true"] > [data-slot="markdown-code-toolbar"], [data-component="markdown-code"][data-code-content] > pre { display: none; } /* Plugin content in place of the code keeps the code block's spacing. */ [data-slot="markdown-code-content"] { margin-top: 12px; margin-bottom: 24px; } [data-component="markdown-code"][data-code-kind="shell"] .highlights { background: var(--markdown-shell-code-background); border-color: var(--markdown-shell-code-border); color: var(--markdown-shell-code-color); } [data-component="markdown-code"][data-code-kind="shell"] code { color: var(--markdown-shell-code-color); } [data-component="markdown-code"][data-code-kind="shell"] code span { color: var(--markdown-shell-code-token-color) !important; } [data-component="markdown-code"] { --markdown-code-background: var(--color-background-stronger); } /* A completed block's highlighter paints its own background inline, which the shell colours don't override. */ [data-component="markdown-code"][data-code-kind="shell"]:has(> pre:not([style*="background"])) { --markdown-code-background: var(--markdown-shell-code-background); } /* A block's actions sit in its top end corner, revealed on hover. */ [data-slot="markdown-code-toolbar"] { position: absolute; top: 4px; inset-inline-end: 4px; z-index: 1; display: flex; align-items: center; gap: 2px; transition: opacity 0.15s ease; @media (hover: hover) { opacity: 0; pointer-events: none; } [data-component="tooltip-v2-trigger"] { display: inline-flex; } /* Like the shell output's Copy, the ghost buttons get the block's background behind them, so code under them doesn't show through. It fades out toward the start and the bottom, so a line it reaches softens instead of being cut. It stops a pixel inside the block's 0.5px border and rounded corner: ending flush against the hairline paints over it once the block sits at a fractional position. */ &::before { content: ""; position: absolute; z-index: -1; inset: -3px -3px -8px -24px; border-start-end-radius: 6px; background: var(--markdown-code-background); mask-image: linear-gradient(to right, transparent, #000 24px), linear-gradient(#000 calc(100% - 8px), transparent); mask-composite: intersect; pointer-events: none; } } /* Plugin content in place of the code has a background of its own. */ [data-component="markdown-code"][data-code-content] > [data-slot="markdown-code-toolbar"]::before { display: none; } /* A clicked button keeps focus without a ring, so only keyboard focus keeps the actions shown. */ [data-component="markdown-code"]:hover > [data-slot="markdown-code-toolbar"], [data-slot="markdown-code-toolbar"]:has(:focus-visible, [data-expanded]) { opacity: 1; pointer-events: auto; } [data-slot="markdown-code-actions"] { display: flex; gap: 2px; } /* Wrap shows only while a line is wider than the block. */ [data-slot="markdown-wrap-button"] { display: none; } [data-component="markdown-code"][data-code-overflow] [data-slot="markdown-wrap-button"] { display: flex; } /* The setting wraps every block on the root; a block's own choice overrides it either way. */ &[data-code-wrap] [data-component="markdown-code"]:not([data-wrap="false"]) > pre, [data-component="markdown-code"][data-wrap="true"] > pre { white-space: pre-wrap; overflow-wrap: anywhere; } /* Set only for one synchronous measurement of the unwrapped width. */ [data-component="markdown-code"][data-code-measure] > pre { white-space: pre !important; overflow-wrap: normal !important; } [data-slot="markdown-copy-button"] [data-check-icon] { display: none; } [data-slot="markdown-copy-button"][data-copied="true"] [data-copy-icon] { display: none; } [data-slot="markdown-copy-button"][data-copied="true"] [data-check-icon] { display: inline-flex; } pre { margin-top: 12px; margin-bottom: 24px; overflow: auto; scrollbar-width: none; &::-webkit-scrollbar { display: none; } } :not(pre) > code { direction: ltr; unicode-bidi: isolate; font-family: var(--font-family-mono); font-feature-settings: var(--font-family-mono--font-feature-settings); color: var(--v2-text-text-base); font-weight: var(--font-weight-medium); padding: 0 4px; border-radius: 4px; background: color-mix(in oklch, var(--v2-text-text-base) var(--markdown-inline-code-bg-mix), transparent); } /* A path turns into a link after an async existence check, so it keeps the plain code box and only fades its colours. */ :not(pre) > code[data-inline-code-kind="path"] { color: var(--markdown-inline-code-path-color); background-color: transparent; transition: color 200ms ease-out, background-color 200ms ease-out; } /* Code inside a link reads as part of its label, so it takes the link's colour and hover. */ a code { color: inherit; padding: 0; border-radius: 0; background: none; } a.external-link > code[data-inline-code-kind="url"] { text-decoration: underline; text-decoration-color: color-mix(in oklch, currentColor 25%, transparent); text-underline-offset: 2px; } /* Tables: the Console's data table, a raised body inside a muted frame that also holds the header */ [data-component="markdown-table"] { margin: 16px 0; overflow-x: auto; padding: 2px; border-radius: 6px; background: var(--v2-background-bg-layer-01); box-shadow: inset 0 0 0 0.5px var(--v2-border-border-muted); } table { width: 100%; border-collapse: separate; border-spacing: 0; color: var(--v2-text-text-base); font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 440; line-height: var(--line-height-compact); letter-spacing: -0.04px; } tbody { border-radius: 4px; background: var(--v2-background-bg-base); box-shadow: var(--v2-elevation-raised); } th, td { text-align: start; vertical-align: top; } th { padding: 8px 12px; color: var(--v2-text-text-muted); font-weight: 530; } td { padding: 10px 12px; } tbody tr:not(:last-child) td { border-bottom: 0.5px solid var(--v2-border-border-muted); } tbody tr:first-child td:first-child { border-start-start-radius: 4px; } tbody tr:first-child td:last-child { border-start-end-radius: 4px; } tbody tr:last-child td:first-child { border-end-start-radius: 4px; } tbody tr:last-child td:last-child { border-end-end-radius: 4px; } /* Images */ img { cursor: zoom-in; max-width: 100%; height: auto; border-radius: 4px; margin: 1.5rem 0; display: block; } } @keyframes markdown-word-enter { from { opacity: 0; } to { opacity: 1; } } :root[data-motion="reduce"] { [data-component="markdown"] :is([data-markdown-word], code)[data-markdown-enter] { animation: none; } [data-component="markdown"] :not(pre) > code[data-inline-code-kind="path"] { transition: none; } } [data-component="markdown"] > * { unicode-bidi: plaintext; } :root body [data-component="markdown"] { [data-slot="markdown-copy-button"]::after { box-sizing: border-box; display: inline-flex; flex-direction: row; align-items: center; gap: 6px; padding: 5px 6px; border: 0; border-radius: 4px; background: var(--v2-background-bg-layer-01); box-shadow: var(--v2-elevation-floating); color: var(--v2-text-text-base); user-select: none; font-size: 11px; font-weight: 530; line-height: 12px; letter-spacing: 0.05px; font-variant-numeric: tabular-nums; font-variation-settings: "slnt" 0; } } [data-component="markdown"] a.external-link:hover > code { text-decoration: underline; text-underline-offset: 2px; }