Files
deepseek-harness/packages/client/ui-primitives/src/markdown/MarkdownText.module.css
T

227 lines
4.7 KiB
CSS
Raw Normal View History

2026-07-27 12:02:28 +08:00
/* Visual baseline: deepsuite `@deepseek/md` markdown.css, adapted to CSS
Modules. Cite pills, KaTeX, header anchors, and thinking-small variants are
intentionally absent (no matching DOM). Token names match that sheet. */
2026-07-23 00:39:27 +08:00
.markdown {
min-width: 0;
overflow-wrap: anywhere;
font: var(--dsw-font-markdown-base);
2026-07-27 12:02:28 +08:00
color: var(--dsw-alias-label-primary);
2026-07-23 00:39:27 +08:00
}
2026-07-27 12:02:28 +08:00
.markdown strong {
font-weight: 600;
2026-07-23 00:39:27 +08:00
}
.markdown h1 {
font: var(--dsw-font-markdown-h1);
2026-07-27 12:02:28 +08:00
margin: 32px 0 16px;
2026-07-23 00:39:27 +08:00
}
.markdown h2 {
font: var(--dsw-font-markdown-h2);
2026-07-27 12:02:28 +08:00
margin: 32px 0 16px;
2026-07-23 00:39:27 +08:00
}
.markdown h3 {
font: var(--dsw-font-markdown-h3);
2026-07-27 12:02:28 +08:00
margin: 32px 0 16px;
2026-07-23 00:39:27 +08:00
}
2026-07-27 12:02:28 +08:00
.markdown h4 {
2026-07-23 00:39:27 +08:00
font: var(--dsw-font-markdown-h4);
2026-07-27 12:02:28 +08:00
margin: 16px 0;
}
.markdown :where(h5, h6) {
font: var(--dsw-font-markdown-base-strong);
margin: 16px 0;
}
.markdown :where(h1, h2, h3, h4, h5, h6) strong {
font-weight: inherit;
}
.markdown p {
margin: 16px 0;
}
/* Tighten h4h6 against a following list (design: 8px gap). */
.markdown :where(h4, h5, h6) + :where(ul, ol) {
margin-top: 8px;
}
.markdown :where(h4, h5, h6):has(+ :where(ul, ol)) {
margin-bottom: 8px;
}
.markdown a {
/* deepsuite markdown.css uses brand-text (blue in newDesign); this sheet
keeps design-platform brand-text as near-black, so links use the blue
business-primary alias instead. */
color: var(--dsw-alias-state-business-primary);
transition: box-shadow var(--ds-transition-duration) var(--ds-ease-in-out);
position: relative;
text-decoration: none;
/* Transparent hit-area padding; literal zero-alpha only (no painted color). */
border-left: 3px solid rgb(255 255 255 / 0);
border-right: 3px solid rgb(255 255 255 / 0);
border-top: 2px solid rgb(255 255 255 / 0);
border-bottom: 2px solid rgb(255 255 255 / 0);
margin-left: -3px;
margin-right: -3px;
2026-07-23 00:39:27 +08:00
}
2026-07-27 12:02:28 +08:00
.markdown a:hover,
.markdown a:focus {
outline: none;
text-decoration: underline var(--dsw-alias-state-business-primary);
}
.markdown a:focus-visible {
box-shadow: 0 0 0 2px var(--dsw-alias-state-business-primary);
2026-07-23 00:39:27 +08:00
}
.markdown :where(ul, ol) {
2026-07-27 12:02:28 +08:00
margin: 16px 0;
padding-left: 18px;
2026-07-23 00:39:27 +08:00
}
2026-07-27 12:02:28 +08:00
.markdown li:not(:first-child) {
margin-top: 6px;
2026-07-23 00:39:27 +08:00
}
.markdown li > :where(ul, ol) {
2026-07-27 12:02:28 +08:00
margin-top: 4px;
2026-07-23 00:39:27 +08:00
}
2026-07-27 12:02:28 +08:00
.markdown li::marker {
line-height: 28px;
2026-07-23 00:39:27 +08:00
color: var(--dsw-alias-label-secondary);
}
2026-07-27 12:02:28 +08:00
/* Nested ol under ul/ol: markers inside (models sometimes emit this shape). */
.markdown :where(ul, ol) ol {
list-style-position: inside;
padding-left: 0;
2026-07-23 00:39:27 +08:00
}
2026-07-27 12:02:28 +08:00
.markdown :where(ul, ol) ol li p {
display: inline;
2026-07-23 00:39:27 +08:00
}
2026-07-27 12:02:28 +08:00
.markdown li > p {
margin: 8px 0;
2026-07-23 00:39:27 +08:00
}
2026-07-27 12:02:28 +08:00
.markdown li > *:first-child {
margin-top: 0;
}
/* Keep list-nested code-block vertical margins (design: +4px vs other last children). */
.markdown li > *:last-child:not(:global(.md-code-block)) {
margin-bottom: 0;
2026-07-23 00:39:27 +08:00
}
.markdown hr {
2026-07-27 12:02:28 +08:00
display: block;
border: none;
height: 1px;
margin: 32px 0;
background: var(--dsw-alias-border-l2);
}
.markdown blockquote {
border-left: 2px solid var(--dsw-alias-label-caption);
margin: 16px 0 0;
padding-left: 14px;
}
.markdown pre {
margin: 16px 0;
font-family: var(--ds-font-family-code);
overflow: auto;
}
.markdown :not(pre) > code {
display: inline-flex;
align-items: center;
box-sizing: border-box;
font: var(--dsw-font-markdown-code);
font-family: var(--ds-font-family-code);
font-size: 0.875em !important;
background-color: var(--dsw-alias-markdown-inline-code);
border-radius: 6px;
padding: 0 5px;
}
.markdown :where(h1, h2, h3, h4, h5, h6) code {
font: inherit;
font-family: var(--ds-font-family-code);
2026-07-23 00:39:27 +08:00
}
.markdown input[type='checkbox'] {
margin: 0 8px 0 0;
2026-07-27 12:02:28 +08:00
accent-color: var(--dsw-alias-label-secondary);
2026-07-23 00:39:27 +08:00
}
.tableScroll {
max-width: 100%;
overflow-x: auto;
overscroll-behavior-x: contain;
}
.tableScroll table {
border-collapse: collapse;
2026-07-27 12:02:28 +08:00
width: max-content;
max-width: max-content;
2026-07-23 00:39:27 +08:00
}
2026-07-27 12:02:28 +08:00
.tableScroll th {
2026-07-23 00:39:27 +08:00
text-align: start;
2026-07-27 12:02:28 +08:00
padding: 10px 16px;
border-bottom: 1px solid var(--dsw-alias-border-l3);
border-top: none;
font: var(--dsw-font-markdown-table-head);
max-width: 320px;
max-width: min(30vw, 320px);
min-width: 100px;
2026-07-23 00:39:27 +08:00
}
2026-07-27 12:02:28 +08:00
.tableScroll td {
padding: 10px 16px;
border-bottom: 1px solid var(--dsw-alias-border-l2);
font: var(--dsw-font-markdown-table);
max-width: 320px;
max-width: min(30vw, 320px);
min-width: 100px;
}
.tableScroll th:first-child,
.tableScroll td:first-child {
padding-left: 0;
}
.tableScroll td:last-child {
padding-right: 0;
}
.tableScroll table code {
font-size: 13px;
}
.markdown > *:first-child,
.markdown p:first-child {
margin-top: 0 !important;
}
.markdown > *:last-child,
.markdown p:last-child {
margin-bottom: 0 !important;
2026-07-23 00:39:27 +08:00
}
.imageAlt {
color: var(--dsw-alias-label-tertiary);
font-style: italic;
}