markdown.css 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. [data-component="markdown"] {
  2. --markdown-inline-code-path-color: var(--v2-text-text-code-accent);
  3. --markdown-inline-code-color: var(--v2-text-text-code-accent);
  4. --markdown-inline-code-bg-mix: 8%;
  5. --markdown-shell-code-background: var(--v2-background-bg-layer-02);
  6. --markdown-shell-code-border: var(--v2-border-border-muted);
  7. --markdown-shell-code-color: var(--v2-text-text-base);
  8. --markdown-shell-code-token-color: currentColor;
  9. /* Reset & Base Typography */
  10. min-width: 0;
  11. max-width: 100%;
  12. overflow-wrap: break-word;
  13. color: var(--v2-text-text-base);
  14. font-family: var(--font-family-sans);
  15. font-size: var(--font-size-base); /* 14px */
  16. line-height: 160%;
  17. /* Spacing for flow */
  18. > *:first-child {
  19. margin-top: 0;
  20. }
  21. > *:last-child {
  22. margin-bottom: 0;
  23. }
  24. > [data-markdown-block]:first-child > *:first-child {
  25. margin-top: 0;
  26. }
  27. > [data-markdown-block]:last-child > *:last-child {
  28. margin-bottom: 0;
  29. }
  30. /* Headings: Sized by level, distinguished by color and spacing */
  31. h1 {
  32. font-size: 17px;
  33. color: var(--v2-text-text-base);
  34. font-weight: 600;
  35. margin-top: 28px;
  36. margin-bottom: 12px;
  37. line-height: var(--line-height-large);
  38. }
  39. h2 {
  40. font-size: 15px;
  41. color: var(--v2-text-text-base);
  42. font-weight: 600;
  43. margin-top: 24px;
  44. margin-bottom: 10px;
  45. line-height: var(--line-height-large);
  46. }
  47. h3 {
  48. font-size: 13px;
  49. color: var(--v2-text-text-base);
  50. font-weight: var(--font-weight-medium);
  51. margin-top: 20px;
  52. margin-bottom: 8px;
  53. line-height: var(--line-height-large);
  54. }
  55. h4,
  56. h5,
  57. h6 {
  58. font-size: 13px;
  59. color: var(--v2-text-text-muted);
  60. font-weight: var(--font-weight-medium);
  61. margin-top: 20px;
  62. margin-bottom: 8px;
  63. line-height: var(--line-height-large);
  64. }
  65. /* Emphasis & Strong: Neutral strong color */
  66. strong,
  67. b {
  68. color: var(--v2-text-text-base);
  69. font-weight: var(--font-weight-medium);
  70. }
  71. /* Paragraphs */
  72. p {
  73. margin-bottom: 12px;
  74. }
  75. /* Links */
  76. a {
  77. color: var(--text-interactive-base);
  78. text-decoration: none;
  79. font-weight: inherit;
  80. }
  81. a:hover {
  82. text-decoration: underline;
  83. text-underline-offset: 2px;
  84. }
  85. /* Lists */
  86. ul,
  87. ol {
  88. margin-top: 8px;
  89. margin-bottom: 12px;
  90. margin-left: 0;
  91. padding-left: 32px;
  92. list-style-position: outside;
  93. }
  94. ul {
  95. list-style-type: disc;
  96. }
  97. ol {
  98. list-style-type: decimal;
  99. padding-left: 2.25rem;
  100. }
  101. li {
  102. margin-bottom: 8px;
  103. }
  104. li > p:first-child {
  105. display: inline;
  106. margin: 0;
  107. }
  108. li:has(> input[type="checkbox"]),
  109. li:has(> p > input[type="checkbox"]) {
  110. position: relative;
  111. list-style-type: none;
  112. }
  113. li > input[type="checkbox"],
  114. li > p > input[type="checkbox"] {
  115. position: absolute;
  116. top: 4px;
  117. left: -20px;
  118. margin: 0;
  119. }
  120. li > p + p {
  121. display: block;
  122. margin-top: 0.5rem;
  123. }
  124. li::marker {
  125. color: var(--v2-text-text-muted);
  126. }
  127. /* Nested lists spacing */
  128. li > ul,
  129. li > ol {
  130. margin-top: 0.25rem;
  131. margin-bottom: 0.25rem;
  132. padding-left: 1rem; /* Minimal indent for nesting only */
  133. }
  134. li > ol {
  135. padding-left: 1.75rem;
  136. }
  137. /* Blockquotes */
  138. blockquote {
  139. border-left: 0.5px solid var(--v2-border-border-base);
  140. margin: 1rem 0;
  141. padding-left: 0.5rem;
  142. color: var(--v2-text-text-muted);
  143. font-style: normal;
  144. }
  145. /* Horizontal Rule - Invisible spacing only */
  146. hr {
  147. border: none;
  148. height: 0;
  149. margin: 32px 0;
  150. }
  151. .shiki {
  152. background: var(--color-background-stronger);
  153. color: var(--text-base);
  154. font-size: 13px;
  155. padding: 12px;
  156. border-radius: 6px;
  157. border: 0.5px solid var(--v2-border-border-base);
  158. }
  159. [data-component="markdown-code"] {
  160. position: relative;
  161. }
  162. [data-component="markdown-code"][data-code-kind="shell"] .shiki {
  163. background: var(--markdown-shell-code-background);
  164. border-color: var(--markdown-shell-code-border);
  165. color: var(--markdown-shell-code-color);
  166. }
  167. [data-component="markdown-code"][data-code-kind="shell"] code {
  168. color: var(--markdown-shell-code-color);
  169. }
  170. [data-component="markdown-code"][data-code-kind="shell"] code span {
  171. color: var(--markdown-shell-code-token-color) !important;
  172. }
  173. [data-slot="markdown-copy-button"] {
  174. position: absolute;
  175. top: 4px;
  176. right: 4px;
  177. opacity: 0;
  178. transition: opacity 0.15s ease;
  179. z-index: 1;
  180. }
  181. [data-component="markdown-code"]:hover [data-slot="markdown-copy-button"],
  182. [data-slot="markdown-copy-button"]:focus-within {
  183. opacity: 1;
  184. }
  185. [data-slot="markdown-copy-button"] [data-check-icon] {
  186. display: none;
  187. }
  188. [data-slot="markdown-copy-button"][data-copied="true"] [data-copy-icon] {
  189. display: none;
  190. }
  191. [data-slot="markdown-copy-button"][data-copied="true"] [data-check-icon] {
  192. display: inline-flex;
  193. }
  194. pre {
  195. margin-top: 12px;
  196. margin-bottom: 24px;
  197. overflow: auto;
  198. scrollbar-width: none;
  199. &::-webkit-scrollbar {
  200. display: none;
  201. }
  202. }
  203. :not(pre) > code {
  204. font-family: var(--font-family-mono);
  205. font-feature-settings: var(--font-family-mono--font-feature-settings);
  206. color: var(--v2-text-text-base);
  207. font-weight: var(--font-weight-medium);
  208. padding: 2px 4px;
  209. border-radius: 4px;
  210. background: color-mix(in oklch, var(--v2-text-text-base) var(--markdown-inline-code-bg-mix), transparent);
  211. }
  212. :not(pre) > code[data-inline-code-kind="path"] {
  213. color: var(--markdown-inline-code-path-color);
  214. background: color-mix(
  215. in oklch,
  216. var(--markdown-inline-code-path-color) var(--markdown-inline-code-bg-mix),
  217. transparent
  218. );
  219. }
  220. a.external-link > code[data-inline-code-kind="url"] {
  221. color: var(--markdown-inline-code-color);
  222. background: none;
  223. text-decoration: underline;
  224. text-decoration-color: color-mix(in oklch, var(--markdown-inline-code-color) 25%, transparent);
  225. text-underline-offset: 2px;
  226. }
  227. /* Tables */
  228. table {
  229. width: 100%;
  230. border-collapse: collapse;
  231. margin: 16px 0;
  232. font-size: var(--font-size-base);
  233. display: block;
  234. overflow-x: auto;
  235. }
  236. th,
  237. td {
  238. /* Minimal borders for structure, matching TUI "lines" roughly but keeping it web-clean */
  239. border-bottom: 0.5px solid var(--v2-border-border-muted);
  240. padding: 12px;
  241. text-align: left;
  242. vertical-align: top;
  243. }
  244. th {
  245. color: var(--v2-text-text-base);
  246. font-weight: var(--font-weight-medium);
  247. border-bottom: 0.5px solid var(--v2-border-border-base);
  248. }
  249. /* Images */
  250. img {
  251. max-width: 100%;
  252. height: auto;
  253. border-radius: 4px;
  254. margin: 1.5rem 0;
  255. display: block;
  256. }
  257. }
  258. body[data-new-layout] [data-component="markdown"] {
  259. [data-slot="markdown-copy-button"]::after {
  260. box-sizing: border-box;
  261. display: inline-flex;
  262. flex-direction: row;
  263. align-items: center;
  264. gap: 6px;
  265. padding: 5px 6px;
  266. border: 0;
  267. border-radius: 4px;
  268. background: var(--v2-background-bg-layer-01);
  269. box-shadow: var(--v2-elevation-floating);
  270. color: var(--v2-text-text-base);
  271. user-select: none;
  272. font-size: 11px;
  273. font-weight: 530;
  274. line-height: 12px;
  275. letter-spacing: 0.05px;
  276. font-variant-numeric: tabular-nums;
  277. font-variation-settings: "slnt" 0;
  278. }
  279. }
  280. body:not([data-new-layout]) [data-component="markdown"] {
  281. color: var(--text-strong);
  282. h1,
  283. h2,
  284. h3,
  285. h4,
  286. h5,
  287. h6 {
  288. font-size: 14px;
  289. color: var(--text-strong);
  290. font-weight: var(--font-weight-medium);
  291. }
  292. strong,
  293. b {
  294. color: var(--text-strong);
  295. }
  296. li::marker {
  297. color: var(--text-weak);
  298. }
  299. blockquote {
  300. border-left: 2px solid var(--border-weak-base);
  301. color: var(--text-weak);
  302. }
  303. .shiki {
  304. border-color: var(--border-weak-base);
  305. }
  306. :not(pre) > code {
  307. color: var(--syntax-string);
  308. padding: 0;
  309. border-radius: 0;
  310. background: none;
  311. }
  312. th,
  313. td {
  314. border-bottom: 1px solid var(--border-weaker-base);
  315. }
  316. th {
  317. color: var(--text-strong);
  318. border-bottom-color: var(--border-weak-base);
  319. }
  320. }
  321. [data-component="markdown"] a.external-link:hover > code {
  322. text-decoration: underline;
  323. text-underline-offset: 2px;
  324. }