| 1 | /* Ported from DeepSeek Harness c291e7961a, MarkdownText.module.css (MIT). */ |
| 2 | /* Visual baseline: deepsuite `@deepseek/md` markdown.css, adapted to CSS |
| 3 | Modules. Cite pills, header anchors, and thinking-small variants are |
| 4 | intentionally absent (no matching DOM). Token names match that sheet. */ |
| 5 | |
| 6 | .chat-transcript .md { |
| 7 | min-width: 0; |
| 8 | overflow-wrap: anywhere; |
| 9 | font: var(--dsw-font-markdown-base); |
| 10 | color: var(--dsw-alias-label-primary); |
| 11 | } |
| 12 | |
| 13 | .chat-transcript .md strong { |
| 14 | font-weight: 600; |
| 15 | } |
| 16 | |
| 17 | .chat-transcript .md h1 { |
| 18 | font: var(--dsw-font-markdown-h1); |
| 19 | margin: 32px 0 16px; |
| 20 | } |
| 21 | |
| 22 | .chat-transcript .md h2 { |
| 23 | font: var(--dsw-font-markdown-h2); |
| 24 | margin: 32px 0 16px; |
| 25 | } |
| 26 | |
| 27 | .chat-transcript .md h3 { |
| 28 | font: var(--dsw-font-markdown-h3); |
| 29 | margin: 32px 0 16px; |
| 30 | } |
| 31 | |
| 32 | .chat-transcript .md h4 { |
| 33 | font: var(--dsw-font-markdown-h4); |
| 34 | margin: 16px 0; |
| 35 | } |
| 36 | |
| 37 | .chat-transcript .md :where(h5, h6) { |
| 38 | font: var(--dsw-font-markdown-base-strong); |
| 39 | margin: 16px 0; |
| 40 | } |
| 41 | |
| 42 | .chat-transcript .md :where(h1, h2, h3, h4, h5, h6) strong { |
| 43 | font-weight: inherit; |
| 44 | } |
| 45 | |
| 46 | .chat-transcript .md p { |
| 47 | margin: 16px 0; |
| 48 | } |
| 49 | |
| 50 | /* Tighten h4–h6 against a following list (design: 8px gap). */ |
| 51 | .chat-transcript .md :where(h4, h5, h6) + :where(ul, ol) { |
| 52 | margin-top: 8px; |
| 53 | } |
| 54 | |
| 55 | .chat-transcript .md :where(h4, h5, h6):has(+ :where(ul, ol)) { |
| 56 | margin-bottom: 8px; |
| 57 | } |
| 58 | |
| 59 | .chat-transcript .md a { |
| 60 | /* deepsuite markdown.css uses brand-text (blue in newDesign); this sheet |
| 61 | keeps design-platform brand-text as near-black, so links use the |
| 62 | dedicated link alias instead. */ |
| 63 | color: var(--dsw-alias-link); |
| 64 | font-weight: 500; |
| 65 | transition: box-shadow var(--ds-transition-duration) var(--ds-ease-in-out); |
| 66 | position: relative; |
| 67 | text-decoration: none; |
| 68 | /* Transparent hit-area padding; literal zero-alpha only (no painted color). */ |
| 69 | border-left: 3px solid rgb(255 255 255 / 0); |
| 70 | border-right: 3px solid rgb(255 255 255 / 0); |
| 71 | border-top: 2px solid rgb(255 255 255 / 0); |
| 72 | border-bottom: 2px solid rgb(255 255 255 / 0); |
| 73 | margin-left: -3px; |
| 74 | margin-right: -3px; |
| 75 | } |
| 76 | |
| 77 | .chat-transcript .md a:hover, |
| 78 | .chat-transcript .md a:focus { |
| 79 | outline: none; |
| 80 | text-decoration: underline dotted var(--dsw-alias-link); |
| 81 | text-underline-offset: 3px; |
| 82 | } |
| 83 | |
| 84 | .chat-transcript .md a:focus-visible { |
| 85 | box-shadow: 0 0 0 2px var(--dsw-alias-state-business-primary); |
| 86 | } |
| 87 | |
| 88 | /* Leading link-category glyph inside anchors, file mentions, and |
| 89 | URL-promoted inline code: outline glyphs ride the link's currentColor. |
| 90 | 1.1em keeps the glyph proportional to the surrounding text's size (it |
| 91 | shrinks with the code chip's 0.875em); the small negative offset seats |
| 92 | its optical center on the cap height. */ |
| 93 | .chat-transcript .md a svg { |
| 94 | flex: none; |
| 95 | width: 1.1em; |
| 96 | height: 1.1em; |
| 97 | vertical-align: -0.25em; |
| 98 | margin-right: 5px; |
| 99 | } |
| 100 | |
| 101 | .chat-transcript .md :where(ul, ol) { |
| 102 | margin: 16px 0; |
| 103 | padding-left: 18px; |
| 104 | } |
| 105 | |
| 106 | .chat-transcript .md li:not(:first-child) { |
| 107 | margin-top: 6px; |
| 108 | } |
| 109 | |
| 110 | .chat-transcript .md li > :where(ul, ol) { |
| 111 | margin-top: 4px; |
| 112 | } |
| 113 | |
| 114 | .chat-transcript .md li::marker { |
| 115 | line-height: 24px; |
| 116 | color: var(--dsw-alias-label-secondary); |
| 117 | } |
| 118 | |
| 119 | /* Nested ol under ul/ol: markers inside (models sometimes emit this shape). */ |
| 120 | .chat-transcript .md :where(ul, ol) ol { |
| 121 | list-style-position: inside; |
| 122 | padding-left: 0; |
| 123 | } |
| 124 | |
| 125 | .chat-transcript .md :where(ul, ol) ol li p { |
| 126 | display: inline; |
| 127 | } |
| 128 | |
| 129 | .chat-transcript .md li > p { |
| 130 | margin: 8px 0; |
| 131 | } |
| 132 | |
| 133 | .chat-transcript .md li > *:first-child { |
| 134 | margin-top: 0; |
| 135 | } |
| 136 | |
| 137 | /* Keep list-nested code-block vertical margins (design: +4px vs other last children). */ |
| 138 | .chat-transcript .md li > *:last-child:not(.md-code-block) { |
| 139 | margin-bottom: 0; |
| 140 | } |
| 141 | |
| 142 | .chat-transcript .md hr { |
| 143 | display: block; |
| 144 | border: none; |
| 145 | height: 0.5px; |
| 146 | margin: 32px 0; |
| 147 | background: var(--dsw-alias-border-l2); |
| 148 | } |
| 149 | |
| 150 | .chat-transcript .md blockquote { |
| 151 | border-left: 2px solid var(--dsw-alias-label-caption); |
| 152 | margin: 16px 0 0; |
| 153 | padding-left: 14px; |
| 154 | } |
| 155 | |
| 156 | .chat-transcript .md pre { |
| 157 | margin: 16px 0; |
| 158 | font-family: var(--ds-font-family-code); |
| 159 | overflow: auto; |
| 160 | } |
| 161 | |
| 162 | .chat-transcript .md :not(pre) > code { |
| 163 | display: inline-flex; |
| 164 | align-items: center; |
| 165 | box-sizing: border-box; |
| 166 | font: var(--dsw-font-markdown-code); |
| 167 | font-family: var(--ds-font-family-code); |
| 168 | font-size: 0.875em ; |
| 169 | background-color: var(--dsw-alias-markdown-inline-code); |
| 170 | border: 0.5px solid var(--dsw-alias-border-l1); |
| 171 | border-radius: 6px; |
| 172 | padding: 0 5px; |
| 173 | } |
| 174 | |
| 175 | .chat-transcript .md :where(h1, h2, h3, h4, h5, h6) code { |
| 176 | font: inherit; |
| 177 | font-family: var(--ds-font-family-code); |
| 178 | } |
| 179 | |
| 180 | .chat-transcript .md .katex-display { |
| 181 | max-width: 100%; |
| 182 | overflow-x: auto; |
| 183 | overflow-y: hidden; |
| 184 | } |
| 185 | |
| 186 | .chat-transcript .md input[type='checkbox'] { |
| 187 | margin: 0 8px 0 0; |
| 188 | accent-color: var(--dsw-alias-label-secondary); |
| 189 | } |
| 190 | |
| 191 | .chat-transcript .md-table-scroll { |
| 192 | max-width: 100%; |
| 193 | overflow-x: auto; |
| 194 | overscroll-behavior-x: contain; |
| 195 | } |
| 196 | |
| 197 | /* Wide tables reveal their horizontal bar on hover (or keyboard focus) |
| 198 | instead of keeping it painted. Chromium never repaints state-conditioned |
| 199 | scrollbar STYLES (neither hover-conditioned `::-webkit-scrollbar*` rules |
| 200 | nor a :hover `scrollbar-color` change reaches the painted bar), so the |
| 201 | toggle is `overflow-x` itself — a layout change repaints reliably. The |
| 202 | resting padding matches the themed bar's height, so on an overflowing |
| 203 | table the appearing bar exactly replaces it and nothing below shifts. |
| 204 | Wheel and trackpad scrolling need the pointer over the table, which is |
| 205 | already the hover that re-enables `auto`. */ |
| 206 | .chat-transcript .md-table-scroll.md-table-wide { |
| 207 | overflow-x: hidden; |
| 208 | padding-bottom: var(--dsh-scrollbar-width, 8px); |
| 209 | } |
| 210 | |
| 211 | .chat-transcript .md-table-scroll.md-table-wide:hover, |
| 212 | .chat-transcript .md-table-scroll.md-table-wide:focus-visible { |
| 213 | overflow-x: auto; |
| 214 | padding-bottom: 0; |
| 215 | } |
| 216 | |
| 217 | /* Chromium keyboard-focuses scrollable containers by default; the ring uses |
| 218 | the sheet's link focus color. */ |
| 219 | .chat-transcript .md-table-scroll:focus-visible { |
| 220 | outline: none; |
| 221 | box-shadow: 0 0 0 2px var(--dsw-alias-state-business-primary); |
| 222 | } |
| 223 | |
| 224 | /* Many-column tables (the renderer's `md-table-wide` hook) keep their |
| 225 | natural width and scroll inside the wrapper; a hosting layout may widen |
| 226 | the wrapper through the hook (deepsuite chat TableWrapper parity). */ |
| 227 | .chat-transcript .md-table-scroll table { |
| 228 | border-collapse: collapse; |
| 229 | width: max-content; |
| 230 | max-width: max-content; |
| 231 | } |
| 232 | |
| 233 | /* Tables under four columns, and any table inside a blockquote, fill the |
| 234 | column instead: cells wrap down to their minimum readable width, and the |
| 235 | wrapper's scroll only remains for the below-floor case (deepsuite chat |
| 236 | parity: `.wrapper:not(:has(th:nth-child(4), td:nth-child(4)))`). */ |
| 237 | .chat-transcript .md-table-scroll:not(:has(th:nth-child(4), td:nth-child(4))) table { |
| 238 | width: 100%; |
| 239 | max-width: none; |
| 240 | } |
| 241 | |
| 242 | .chat-transcript .md-table-scroll th { |
| 243 | text-align: start; |
| 244 | padding: 10px 16px; |
| 245 | border-bottom: 0.5px solid var(--dsw-alias-border-l3); |
| 246 | border-top: none; |
| 247 | font: var(--dsw-font-markdown-table-head); |
| 248 | max-width: 320px; |
| 249 | max-width: min(30vw, 320px); |
| 250 | min-width: 100px; |
| 251 | } |
| 252 | |
| 253 | .chat-transcript .md-table-scroll td { |
| 254 | padding: 10px 16px; |
| 255 | border-bottom: 0.5px solid var(--dsw-alias-border-l2); |
| 256 | font: var(--dsw-font-markdown-table); |
| 257 | max-width: 320px; |
| 258 | max-width: min(30vw, 320px); |
| 259 | min-width: 100px; |
| 260 | } |
| 261 | |
| 262 | .chat-transcript .md-table-scroll th:first-child, |
| 263 | .chat-transcript .md-table-scroll td:first-child { |
| 264 | padding-left: 0; |
| 265 | } |
| 266 | |
| 267 | .chat-transcript .md-table-scroll td:last-child { |
| 268 | padding-right: 0; |
| 269 | } |
| 270 | |
| 271 | .chat-transcript .md-table-scroll table code { |
| 272 | font-size: 11px; |
| 273 | } |
| 274 | |
| 275 | .chat-transcript .md > *:first-child, |
| 276 | .chat-transcript .md p:first-child { |
| 277 | margin-top: 0 ; |
| 278 | } |
| 279 | |
| 280 | .chat-transcript .md > *:last-child, |
| 281 | .chat-transcript .md p:last-child { |
| 282 | margin-bottom: 0 ; |
| 283 | } |
| 284 |