markdown.css 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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. margin-left: 0;
  57. padding-left: 1.5rem;
  58. list-style-position: outside;
  59. }
  60. ul {
  61. list-style-type: disc;
  62. }
  63. ol {
  64. list-style-type: decimal;
  65. padding-left: 2.25rem;
  66. }
  67. li {
  68. margin-bottom: 0.5rem;
  69. }
  70. li > p:first-child {
  71. display: inline;
  72. margin: 0;
  73. }
  74. li > p + p {
  75. display: block;
  76. margin-top: 0.5rem;
  77. }
  78. li::marker {
  79. color: var(--text-weak);
  80. }
  81. /* Nested lists spacing */
  82. li > ul,
  83. li > ol {
  84. margin-top: 0.25rem;
  85. margin-bottom: 0.25rem;
  86. padding-left: 1rem; /* Minimal indent for nesting only */
  87. }
  88. li > ol {
  89. padding-left: 1.75rem;
  90. }
  91. /* Blockquotes */
  92. blockquote {
  93. border-left: 2px solid var(--border-weak-base);
  94. margin: 1.5rem 0;
  95. padding-left: 0.5rem;
  96. color: var(--text-weak);
  97. font-style: normal;
  98. }
  99. /* Horizontal Rule - Invisible spacing only */
  100. hr {
  101. border: none;
  102. height: 0;
  103. margin: 2.5rem 0;
  104. }
  105. .shiki {
  106. font-size: 13px;
  107. padding: 8px 12px;
  108. border-radius: 6px;
  109. border: 0.5px solid var(--border-weak-base);
  110. }
  111. [data-component="markdown-code"] {
  112. position: relative;
  113. }
  114. [data-slot="markdown-copy-button"] {
  115. position: absolute;
  116. top: 4px;
  117. right: 4px;
  118. opacity: 0;
  119. transition: opacity 0.15s ease;
  120. z-index: 1;
  121. &::after {
  122. content: attr(data-tooltip);
  123. position: absolute;
  124. left: 50%;
  125. bottom: calc(100% + 4px);
  126. transform: translateX(-50%);
  127. z-index: 1000;
  128. max-width: 320px;
  129. border-radius: var(--radius-sm);
  130. background: var(--surface-float-base);
  131. color: var(--text-invert-strong);
  132. padding: 2px 8px;
  133. border: 1px solid var(--border-weak-base, rgba(0, 0, 0, 0.07));
  134. box-shadow: var(--shadow-md);
  135. pointer-events: none;
  136. white-space: nowrap;
  137. font-family: var(--font-family-sans);
  138. font-size: var(--font-size-small);
  139. font-style: normal;
  140. font-weight: var(--font-weight-medium);
  141. line-height: var(--line-height-large);
  142. letter-spacing: var(--letter-spacing-normal);
  143. opacity: 0;
  144. transition: opacity 0.15s ease;
  145. }
  146. }
  147. [data-slot="markdown-copy-button"]:hover::after,
  148. [data-slot="markdown-copy-button"]:focus-visible::after {
  149. opacity: 1;
  150. }
  151. [data-slot="markdown-copy-button"][data-variant="secondary"] {
  152. box-shadow: none;
  153. border: 1px solid var(--border-weak-base);
  154. }
  155. [data-slot="markdown-copy-button"][data-variant="secondary"] [data-slot="icon-svg"] {
  156. color: var(--icon-base);
  157. }
  158. [data-component="markdown-code"]:hover [data-slot="markdown-copy-button"] {
  159. opacity: 1;
  160. }
  161. [data-slot="markdown-copy-button"] [data-slot="check-icon"] {
  162. display: none;
  163. }
  164. [data-slot="markdown-copy-button"][data-copied="true"] [data-slot="copy-icon"] {
  165. display: none;
  166. }
  167. [data-slot="markdown-copy-button"][data-copied="true"] [data-slot="check-icon"] {
  168. display: inline-flex;
  169. }
  170. pre {
  171. margin-top: 2rem;
  172. margin-bottom: 2rem;
  173. overflow: auto;
  174. scrollbar-width: none;
  175. &::-webkit-scrollbar {
  176. display: none;
  177. }
  178. }
  179. :not(pre) > code {
  180. font-family: var(--font-family-mono);
  181. font-feature-settings: var(--font-family-mono--font-feature-settings);
  182. color: var(--syntax-string);
  183. font-weight: var(--font-weight-medium);
  184. /* font-size: 13px; */
  185. /* padding: 2px 2px; */
  186. /* margin: 0 1.5px; */
  187. /* border-radius: 2px; */
  188. /* background: var(--surface-base); */
  189. /* box-shadow: 0 0 0 0.5px var(--border-weak-base); */
  190. }
  191. /* Tables */
  192. table {
  193. width: 100%;
  194. border-collapse: collapse;
  195. margin: 1.5rem 0;
  196. font-size: var(--font-size-base);
  197. display: block;
  198. overflow-x: auto;
  199. }
  200. th,
  201. td {
  202. /* Minimal borders for structure, matching TUI "lines" roughly but keeping it web-clean */
  203. border-bottom: 1px solid var(--border-weaker-base);
  204. padding: 0.75rem 0.5rem;
  205. text-align: left;
  206. vertical-align: top;
  207. }
  208. th {
  209. color: var(--text-strong);
  210. font-weight: var(--font-weight-medium);
  211. border-bottom: 1px solid var(--border-weak-base);
  212. }
  213. /* Images */
  214. img {
  215. max-width: 100%;
  216. height: auto;
  217. border-radius: 4px;
  218. margin: 1.5rem 0;
  219. display: block;
  220. }
  221. }
  222. [data-component="markdown"] a.external-link:hover > code {
  223. text-decoration: underline;
  224. text-underline-offset: 2px;
  225. }