editor-markdown.web.css 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. /*
  2. * MDXEditor wiki field overrides.
  3. * Imported AFTER @mdxeditor/editor/style.css so these win the cascade —
  4. * MDXEditor sets --basePageBg: white on the same node with equal specificity.
  5. */
  6. .mdxeditor.mdxeditor-wiki,
  7. .mdxeditor-popup-container.mdxeditor-wiki {
  8. --basePageBg: rgb(var(--input));
  9. --baseBase: rgb(var(--muted) / 0.35);
  10. --baseBgSubtle: rgb(var(--muted) / 0.25);
  11. --baseBg: rgb(var(--muted) / 0.45);
  12. --baseBgHover: rgb(var(--muted) / 0.65);
  13. --baseBgActive: rgb(var(--muted) / 0.85);
  14. --baseLine: rgb(var(--border) / 0.6);
  15. --baseBorder: rgb(var(--border) / 0.7);
  16. --baseBorderHover: rgb(var(--border));
  17. --baseSolid: rgb(var(--muted-foreground));
  18. --baseSolidHover: rgb(var(--secondary-foreground));
  19. --baseText: rgb(var(--muted-foreground));
  20. --baseTextContrast: rgb(var(--card-foreground));
  21. /* Used for disabled icons + select placeholder — must stay readable in dark. */
  22. --baseBorderHover: rgb(var(--muted-foreground));
  23. --accentBase: rgb(var(--accent));
  24. --accentBgSubtle: rgb(var(--accent));
  25. --accentBg: rgb(var(--accent));
  26. --accentBgHover: rgb(var(--primary) / 0.12);
  27. --accentBgActive: rgb(var(--primary) / 0.18);
  28. --accentLine: rgb(var(--primary) / 0.35);
  29. --accentBorder: rgb(var(--primary) / 0.45);
  30. --accentBorderHover: rgb(var(--primary) / 0.6);
  31. --accentSolid: rgb(var(--primary));
  32. --accentSolidHover: rgb(var(--primary-hover));
  33. --accentText: rgb(var(--primary));
  34. --accentTextContrast: rgb(var(--primary-foreground));
  35. color: rgb(var(--card-foreground));
  36. background-color: rgb(var(--input));
  37. }
  38. .mdxeditor.mdxeditor-wiki .mdxeditor-wiki-toolbar,
  39. .mdxeditor.mdxeditor-wiki .mdxeditor-toolbar {
  40. width: 100%;
  41. max-width: 100%;
  42. box-sizing: border-box;
  43. border-radius: 0 !important;
  44. border-bottom: 1px solid rgb(var(--border) / 0.6);
  45. /* Solid chrome — sticky over scrolled content must not show text through. */
  46. background-color: rgb(var(--muted)) !important;
  47. position: sticky;
  48. top: 0;
  49. z-index: 3;
  50. }
  51. /* Active toolbar icons */
  52. .mdxeditor.mdxeditor-wiki .mdxeditor-toolbar svg,
  53. .mdxeditor.mdxeditor-wiki .mdxeditor-wiki-toolbar svg {
  54. color: rgb(var(--secondary-foreground));
  55. }
  56. /*
  57. * MDXEditor paints [data-disabled] icons with --baseBorderHover.
  58. * That token maps to --border (near-black in dark) → invisible on the toolbar.
  59. */
  60. .mdxeditor.mdxeditor-wiki .mdxeditor-toolbar [data-disabled] svg,
  61. .mdxeditor.mdxeditor-wiki .mdxeditor-wiki-toolbar [data-disabled] svg,
  62. .mdxeditor.mdxeditor-wiki .mdxeditor-toolbar button:disabled svg,
  63. .mdxeditor.mdxeditor-wiki .mdxeditor-wiki-toolbar button:disabled svg {
  64. color: rgb(var(--muted-foreground)) !important;
  65. opacity: 0.85;
  66. }
  67. /*
  68. * Separators use --baseBorder / --baseBase (also near-black in dark).
  69. * Force a readable hairline against the toolbar surface.
  70. */
  71. .mdxeditor.mdxeditor-wiki .mdxeditor-toolbar [role='separator'],
  72. .mdxeditor.mdxeditor-wiki .mdxeditor-wiki-toolbar [role='separator'] {
  73. border-left-color: rgb(var(--muted-foreground) / 0.45) !important;
  74. border-right-color: transparent !important;
  75. align-self: center;
  76. min-height: 1rem;
  77. }
  78. /* Block type / language select — label was invisible (placeholder used --baseBorderHover). */
  79. .mdxeditor.mdxeditor-wiki .mdxeditor-toolbar button[role='combobox'],
  80. .mdxeditor.mdxeditor-wiki .mdxeditor-wiki-toolbar button[role='combobox'] {
  81. color: rgb(var(--card-foreground)) !important;
  82. background-color: rgb(var(--muted) / 0.55) !important;
  83. border: 1px solid rgb(var(--border) / 0.6);
  84. }
  85. .mdxeditor.mdxeditor-wiki .mdxeditor-toolbar button[role='combobox'][data-placeholder] > span:first-child,
  86. .mdxeditor.mdxeditor-wiki .mdxeditor-wiki-toolbar button[role='combobox'][data-placeholder] > span:first-child {
  87. color: rgb(var(--muted-foreground)) !important;
  88. }
  89. .mdxeditor.mdxeditor-wiki .mdxeditor-toolbar button[role='combobox']:disabled,
  90. .mdxeditor.mdxeditor-wiki .mdxeditor-wiki-toolbar button[role='combobox']:disabled {
  91. color: rgb(var(--muted-foreground)) !important;
  92. opacity: 0.85;
  93. }
  94. /*
  95. * Parent surface scrolls (overflow-y: auto + maxHeight on the field wrapper).
  96. * Don't trap overflow inside rich/source/diff — let content grow naturally.
  97. */
  98. .mdxeditor.mdxeditor-wiki .mdxeditor-diff-source-wrapper {
  99. display: block;
  100. min-height: 0;
  101. }
  102. .mdxeditor.mdxeditor-wiki .mdxeditor-rich-text-editor {
  103. overflow: visible !important;
  104. }
  105. /* Lexical root + wrapper */
  106. .mdxeditor.mdxeditor-wiki .mdxeditor-rich-text-editor .mdxeditor-root-contenteditable,
  107. .mdxeditor.mdxeditor-wiki .mdxeditor-root-contenteditable {
  108. color: rgb(var(--card-foreground)) !important;
  109. background-color: transparent;
  110. caret-color: rgb(var(--card-foreground));
  111. min-height: 7rem;
  112. box-sizing: border-box;
  113. }
  114. .mdxeditor.mdxeditor-wiki .mdxeditor-source-editor,
  115. .mdxeditor.mdxeditor-wiki .mdxeditor-diff-editor,
  116. .mdxeditor.mdxeditor-wiki .cm-sourceView {
  117. min-height: 12rem;
  118. overflow: visible;
  119. }
  120. .mdxeditor.mdxeditor-wiki .cm-mergeView {
  121. min-height: 12rem;
  122. overflow: visible;
  123. }
  124. /* Source / diff CodeMirror panes (basicLight is hardcoded in MDXEditor). */
  125. .mdxeditor.mdxeditor-wiki .mdxeditor-source-editor,
  126. .mdxeditor.mdxeditor-wiki .mdxeditor-diff-editor,
  127. .mdxeditor.mdxeditor-wiki .cm-sourceView,
  128. .mdxeditor.mdxeditor-wiki .cm-editor {
  129. background-color: rgb(var(--input)) !important;
  130. color: rgb(var(--card-foreground)) !important;
  131. }
  132. .mdxeditor.mdxeditor-wiki .cm-scroller {
  133. background-color: rgb(var(--input)) !important;
  134. color: rgb(var(--card-foreground)) !important;
  135. /* Grow with document; outer field surface scrolls. */
  136. overflow: visible !important;
  137. }
  138. .mdxeditor.mdxeditor-wiki .cm-content {
  139. caret-color: rgb(var(--card-foreground));
  140. color: rgb(var(--card-foreground)) !important;
  141. }
  142. .mdxeditor.mdxeditor-wiki .cm-gutters {
  143. background-color: rgb(var(--muted) / 0.35) !important;
  144. color: rgb(var(--muted-foreground)) !important;
  145. border: none !important;
  146. }
  147. .mdxeditor.mdxeditor-wiki .cm-activeLineGutter,
  148. .mdxeditor.mdxeditor-wiki .cm-activeLine {
  149. background-color: rgb(var(--muted) / 0.25) !important;
  150. }
  151. .mdxeditor.mdxeditor-wiki .cm-selectionBackground,
  152. .mdxeditor.mdxeditor-wiki .cm-content ::selection {
  153. background-color: rgb(var(--primary) / 0.35) !important;
  154. }
  155. .mdxeditor.mdxeditor-wiki .cm-cursor {
  156. border-left-color: rgb(var(--card-foreground)) !important;
  157. }
  158. /* Syntax tokens — keep readable on dark input surfaces. */
  159. .mdxeditor.mdxeditor-wiki.dark-theme .cm-content .tok-keyword,
  160. .mdxeditor.mdxeditor-wiki.dark-theme .cm-content .tok-operator {
  161. color: #c4b5fd;
  162. }
  163. .mdxeditor.mdxeditor-wiki.dark-theme .cm-content .tok-string,
  164. .mdxeditor.mdxeditor-wiki.dark-theme .cm-content .tok-string2 {
  165. color: #86efac;
  166. }
  167. .mdxeditor.mdxeditor-wiki.dark-theme .cm-content .tok-comment {
  168. color: rgb(var(--muted-foreground));
  169. }
  170. .mdxeditor.mdxeditor-wiki.dark-theme .cm-content .tok-heading,
  171. .mdxeditor.mdxeditor-wiki.dark-theme .cm-content .tok-strong {
  172. color: #fde68a;
  173. }
  174. .mdxeditor.mdxeditor-wiki.dark-theme .cm-content .tok-link,
  175. .mdxeditor.mdxeditor-wiki.dark-theme .cm-content .tok-url,
  176. .mdxeditor.mdxeditor-wiki.dark-theme .cm-content .tok-meta {
  177. color: #93c5fd;
  178. }
  179. .mdxeditor.mdxeditor-wiki.dark-theme .cm-content .tok-monospace,
  180. .mdxeditor.mdxeditor-wiki.dark-theme .cm-content .tok-atom {
  181. color: #f9a8d4;
  182. }
  183. .mdxeditor-select-content.mdxeditor-wiki,
  184. .mdxeditor.mdxeditor-wiki .mdxeditor-select-content,
  185. [data-radix-popper-content-wrapper] .mdxeditor-select-content {
  186. --basePageBg: rgb(var(--popover));
  187. --baseBase: rgb(var(--popover));
  188. --baseBg: rgb(var(--muted) / 0.45);
  189. --baseBgHover: rgb(var(--muted) / 0.65);
  190. --baseBgActive: rgb(var(--muted) / 0.85);
  191. --baseBorder: rgb(var(--border) / 0.7);
  192. --baseText: rgb(var(--muted-foreground));
  193. --baseTextContrast: rgb(var(--popover-foreground));
  194. background-color: rgb(var(--popover)) !important;
  195. color: rgb(var(--popover-foreground)) !important;
  196. border: 1px solid rgb(var(--border) / 0.6);
  197. }