markdown.css 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. [data-component="markdown"] {
  2. /* Reset & Base Typography */
  3. min-width: 0;
  4. max-width: 100%;
  5. overflow-wrap: break-word;
  6. color: var(--text-strong);
  7. font-family: var(--font-family-sans);
  8. font-size: var(--font-size-base); /* 14px */
  9. line-height: var(--line-height-x-large);
  10. /* Spacing for flow */
  11. > *:first-child {
  12. margin-top: 0;
  13. }
  14. > *:last-child {
  15. margin-bottom: 0;
  16. }
  17. /* Headings: Same size, distinguished by color and spacing */
  18. h1,
  19. h2,
  20. h3,
  21. h4,
  22. h5,
  23. h6 {
  24. font-size: var(--font-size-base);
  25. color: var(--text-strong);
  26. font-weight: var(--font-weight-medium);
  27. margin-top: 2rem;
  28. margin-bottom: 0.75rem;
  29. line-height: var(--line-height-large);
  30. }
  31. /* Emphasis & Strong: Neutral strong color */
  32. strong,
  33. b {
  34. color: var(--text-strong);
  35. font-weight: var(--font-weight-medium);
  36. }
  37. /* Paragraphs */
  38. p {
  39. margin-bottom: 1rem;
  40. }
  41. /* Links */
  42. a {
  43. color: var(--text-interactive-base);
  44. text-decoration: none;
  45. font-weight: inherit;
  46. }
  47. a:hover {
  48. text-decoration: underline;
  49. text-underline-offset: 2px;
  50. }
  51. /* Lists */
  52. ul,
  53. ol {
  54. margin-top: 0.5rem;
  55. margin-bottom: 1rem;
  56. padding-left: 1.5rem;
  57. list-style-position: outside;
  58. }
  59. ul {
  60. list-style-type: disc;
  61. }
  62. ol {
  63. list-style-type: decimal;
  64. }
  65. li {
  66. margin-bottom: 0.5rem;
  67. }
  68. li > p:first-child {
  69. display: inline;
  70. margin: 0;
  71. }
  72. li > p + p {
  73. display: block;
  74. margin-top: 0.5rem;
  75. }
  76. li::marker {
  77. color: var(--text-weak);
  78. }
  79. /* Nested lists spacing */
  80. li > ul,
  81. li > ol {
  82. margin-top: 0.25rem;
  83. margin-bottom: 0.25rem;
  84. padding-left: 1rem; /* Minimal indent for nesting only */
  85. }
  86. /* Blockquotes */
  87. blockquote {
  88. border-left: 2px solid var(--border-weak-base);
  89. margin: 1.5rem 0;
  90. padding-left: 0.5rem;
  91. color: var(--text-weak);
  92. font-style: normal;
  93. }
  94. /* Horizontal Rule - Invisible spacing only */
  95. hr {
  96. border: none;
  97. height: 0;
  98. margin: 2.5rem 0;
  99. }
  100. .shiki {
  101. font-size: 13px;
  102. padding: 8px 12px;
  103. border-radius: 6px;
  104. border: 0.5px solid var(--border-weak-base);
  105. }
  106. [data-component="markdown-code"] {
  107. position: relative;
  108. }
  109. [data-slot="markdown-copy-button"] {
  110. position: absolute;
  111. top: 4px;
  112. right: 4px;
  113. opacity: 0;
  114. transition: opacity 0.15s ease;
  115. z-index: 1;
  116. &::after {
  117. content: attr(data-tooltip);
  118. position: absolute;
  119. left: 50%;
  120. bottom: calc(100% + 4px);
  121. transform: translateX(-50%);
  122. z-index: 1000;
  123. max-width: 320px;
  124. border-radius: var(--radius-sm);
  125. background: var(--surface-float-base);
  126. color: var(--text-invert-strong);
  127. padding: 2px 8px;
  128. border: 1px solid var(--border-weak-base, rgba(0, 0, 0, 0.07));
  129. box-shadow: var(--shadow-md);
  130. pointer-events: none;
  131. white-space: nowrap;
  132. font-family: var(--font-family-sans);
  133. font-size: var(--font-size-small);
  134. font-style: normal;
  135. font-weight: var(--font-weight-medium);
  136. line-height: var(--line-height-large);
  137. letter-spacing: var(--letter-spacing-normal);
  138. opacity: 0;
  139. transition: opacity 0.15s ease;
  140. }
  141. }
  142. [data-slot="markdown-copy-button"]:hover::after,
  143. [data-slot="markdown-copy-button"]:focus-visible::after {
  144. opacity: 1;
  145. }
  146. [data-slot="markdown-copy-button"][data-variant="secondary"] {
  147. box-shadow: none;
  148. border: 1px solid var(--border-weak-base);
  149. }
  150. [data-slot="markdown-copy-button"][data-variant="secondary"] [data-slot="icon-svg"] {
  151. color: var(--icon-base);
  152. }
  153. [data-component="markdown-code"]:hover [data-slot="markdown-copy-button"] {
  154. opacity: 1;
  155. }
  156. [data-slot="markdown-copy-button"] [data-slot="check-icon"] {
  157. display: none;
  158. }
  159. [data-slot="markdown-copy-button"][data-copied="true"] [data-slot="copy-icon"] {
  160. display: none;
  161. }
  162. [data-slot="markdown-copy-button"][data-copied="true"] [data-slot="check-icon"] {
  163. display: inline-flex;
  164. }
  165. pre {
  166. margin-top: 2rem;
  167. margin-bottom: 2rem;
  168. overflow: auto;
  169. scrollbar-width: none;
  170. &::-webkit-scrollbar {
  171. display: none;
  172. }
  173. }
  174. :not(pre) > code {
  175. font-family: var(--font-family-mono);
  176. font-feature-settings: var(--font-family-mono--font-feature-settings);
  177. color: var(--syntax-string);
  178. font-weight: var(--font-weight-medium);
  179. /* font-size: 13px; */
  180. /* padding: 2px 2px; */
  181. /* margin: 0 1.5px; */
  182. /* border-radius: 2px; */
  183. /* background: var(--surface-base); */
  184. /* box-shadow: 0 0 0 0.5px var(--border-weak-base); */
  185. }
  186. /* Tables */
  187. table {
  188. width: 100%;
  189. border-collapse: collapse;
  190. margin: 1.5rem 0;
  191. font-size: var(--font-size-base);
  192. display: block;
  193. overflow-x: auto;
  194. }
  195. th,
  196. td {
  197. /* Minimal borders for structure, matching TUI "lines" roughly but keeping it web-clean */
  198. border-bottom: 1px solid var(--border-weaker-base);
  199. padding: 0.75rem 0.5rem;
  200. text-align: left;
  201. vertical-align: top;
  202. }
  203. th {
  204. color: var(--text-strong);
  205. font-weight: var(--font-weight-medium);
  206. border-bottom: 1px solid var(--border-weak-base);
  207. }
  208. /* Images */
  209. img {
  210. max-width: 100%;
  211. height: auto;
  212. border-radius: 4px;
  213. margin: 1.5rem 0;
  214. display: block;
  215. }
  216. }
  217. [data-component="markdown"] a.external-link:hover > code {
  218. text-decoration: underline;
  219. text-underline-offset: 2px;
  220. }