Files
Netcatty/components/notes/mdxEditor.css
T
陈大猫 ad3d0cfeda refactor: streamline codebase, unify duplicated modules, and consolidate test suite (#4307)
* refactor: streamline codebase, unify duplicated modules, and consolidate tests

* fix(test): batch discovered test files into Windows-safe command lines
2026-11-23 11:00:14 +08:00

1157 lines
37 KiB
CSS

@import "@mdxeditor/editor/style.css";
.netcatty-mdx-editor {
container-type: inline-size;
/* MDX linkDialog uses position:fixed anchors with coords adjusted whenever
* getFixedContainingBlock sees container-type. Browsers do not treat
* container-type alone as a fixed CB, so unadjusted viewport coords + those
* offsets park the preview toolbar over the notes tree. A zero transform
* makes the fixed CB real so the adjustment matches. */
transform: translateZ(0);
min-width: 0;
--basePageBg: hsl(var(--background));
--baseBase: hsl(var(--background));
--baseBgSubtle: hsl(var(--secondary) / 0.45);
--baseBg: hsl(var(--secondary) / 0.7);
--baseBgHover: hsl(var(--secondary));
--baseBgActive: hsl(var(--secondary));
--baseLine: hsl(var(--border) / 0.45);
--baseBorder: hsl(var(--border) / 0.6);
--baseBorderHover: hsl(var(--border));
--baseSolid: hsl(var(--muted-foreground));
--baseText: hsl(var(--muted-foreground));
--baseTextContrast: hsl(var(--foreground));
--accentText: hsl(var(--primary));
--accentSolid: hsl(var(--primary));
--accentSolidHover: hsl(var(--primary) / 0.9);
background: transparent;
color: hsl(var(--foreground));
}
.netcatty-note-preview-empty {
min-height: calc(100vh - 15rem);
color: hsl(var(--muted-foreground));
font-size: 14px;
line-height: 1.75;
}
.netcatty-mdx-editor,
.netcatty-mdx-editor .mdxeditor-root-contenteditable {
min-height: 100%;
overflow: visible;
}
.mdxeditor-popup-container.netcatty-mdx-editor {
position: fixed;
inset: 0;
z-index: 200000;
min-height: 0;
overflow: visible;
pointer-events: none;
}
.mdxeditor-popup-container.netcatty-mdx-editor [data-radix-popper-content-wrapper],
.mdxeditor-popup-container.netcatty-mdx-editor [role="dialog"],
.mdxeditor-popup-container.netcatty-mdx-editor [class*="_tableColumnEditorPopoverContent_"] {
pointer-events: auto;
}
/*
* Image edit / insert dialog (MDX ImageDialog via Radix).
* Match Netcatty popover / form tokens instead of stock MDX chrome.
*/
.netcatty-mdx-editor [class*="_dialogOverlay_"] {
background: hsl(var(--background) / 0.55) !important;
backdrop-filter: blur(2px);
opacity: 1 !important;
z-index: 200100 !important;
}
.netcatty-mdx-editor [class*="_dialogContent_"],
.netcatty-mdx-editor [class*="_largeDialogContent_"] {
min-width: min(22rem, calc(100vw - 2rem));
max-width: min(26rem, calc(100vw - 2rem));
padding: 1rem 1.1rem 0.9rem !important;
gap: 0.65rem !important;
align-items: stretch !important;
flex-direction: column !important;
border: 1px solid hsl(var(--border) / 0.7) !important;
border-radius: 0.75rem !important;
background: hsl(var(--popover)) !important;
color: hsl(var(--popover-foreground)) !important;
box-shadow:
0 0 0 1px hsl(var(--border) / 0.35),
0 12px 40px hsl(0 0% 0% / 0.28) !important;
filter: none !important;
z-index: 200110 !important;
font-size: 13px !important;
}
.netcatty-mdx-editor [class*="_dialogContent_"] > h2,
.netcatty-mdx-editor [class*="_largeDialogContent_"] > h2 {
margin: 0 0 0.15rem !important;
padding: 0 !important;
font-size: 0.9375rem !important;
font-weight: 600 !important;
letter-spacing: -0.01em;
color: hsl(var(--foreground)) !important;
line-height: 1.3 !important;
}
.netcatty-mdx-editor form[class*="_multiFieldForm_"] {
padding: 0.15rem 0 0 !important;
gap: 0.75rem !important;
}
.netcatty-mdx-editor form[class*="_multiFieldForm_"] [class*="_formField_"] {
gap: 0.35rem !important;
}
.netcatty-mdx-editor form[class*="_multiFieldForm_"] [class*="_formField_"] > label {
font-size: 11px !important;
font-weight: 500 !important;
letter-spacing: 0.01em;
color: hsl(var(--muted-foreground)) !important;
line-height: 1.3 !important;
}
.netcatty-mdx-editor [class*="_textInput_"],
.netcatty-mdx-editor [class*="_downshiftInput_"],
.netcatty-mdx-editor [class*="_dialogInput_"] {
width: 100% !important;
min-height: 2.1rem !important;
box-sizing: border-box !important;
padding: 0.4rem 0.65rem !important;
border-radius: 0.5rem !important;
border: 1px solid hsl(var(--border) / 0.75) !important;
background: hsl(var(--background)) !important;
color: hsl(var(--foreground)) !important;
font-size: 12.5px !important;
line-height: 1.35 !important;
box-shadow: none !important;
transition: border-color 120ms ease, box-shadow 120ms ease;
}
.netcatty-mdx-editor [class*="_textInput_"]:focus,
.netcatty-mdx-editor [class*="_downshiftInput_"]:focus,
.netcatty-mdx-editor [class*="_dialogInput_"]:focus,
.netcatty-mdx-editor [class*="_downshiftInputWrapper_"]:focus-within {
outline: none !important;
border-color: hsl(var(--primary) / 0.65) !important;
box-shadow: 0 0 0 3px hsl(var(--primary) / 0.18) !important;
}
.netcatty-mdx-editor [class*="_downshiftInputWrapper_"] {
width: 100% !important;
border-radius: 0.5rem !important;
border: 1px solid hsl(var(--border) / 0.75) !important;
background: hsl(var(--background)) !important;
overflow: hidden;
}
.netcatty-mdx-editor [class*="_downshiftInputWrapper_"] [class*="_downshiftInput_"] {
border: 0 !important;
box-shadow: none !important;
border-radius: 0 !important;
}
.netcatty-mdx-editor [class*="_downshiftInputWrapper_"]:focus-within {
border-color: hsl(var(--primary) / 0.65) !important;
box-shadow: 0 0 0 3px hsl(var(--primary) / 0.18) !important;
}
.netcatty-mdx-editor [class*="_imageDimensionsContainer_"] {
display: grid !important;
grid-template-columns: 1fr 1fr;
gap: 0.65rem !important;
}
.netcatty-mdx-editor [class*="_imageDimensionsContainer_"] [class*="_formField_"] {
min-width: 0;
}
/* Action row at the bottom of the form */
.netcatty-mdx-editor form[class*="_multiFieldForm_"] > div:last-child {
display: flex !important;
justify-content: flex-end !important;
align-items: center !important;
gap: 0.5rem !important;
margin-top: 0.35rem !important;
padding-top: 0.75rem !important;
border-top: 1px solid hsl(var(--border) / 0.55);
}
.netcatty-mdx-editor [class*="_primaryButton_"],
.netcatty-mdx-editor [class*="_secondaryButton_"] {
display: inline-flex !important;
align-items: center !important;
justify-content: center !important;
min-height: 2rem !important;
padding: 0.35rem 0.85rem !important;
border-radius: 0.5rem !important;
font-size: 12px !important;
font-weight: 550 !important;
line-height: 1.2 !important;
cursor: pointer !important;
transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease, opacity 120ms ease;
}
.netcatty-mdx-editor [class*="_primaryButton_"] {
border: 1px solid hsl(var(--primary) / 0.35) !important;
background: hsl(var(--primary)) !important;
color: hsl(var(--primary-foreground)) !important;
}
.netcatty-mdx-editor [class*="_primaryButton_"]:hover {
background: hsl(var(--primary) / 0.9) !important;
}
.netcatty-mdx-editor [class*="_secondaryButton_"] {
border: 1px solid hsl(var(--border) / 0.8) !important;
background: hsl(var(--secondary) / 0.55) !important;
color: hsl(var(--foreground)) !important;
}
.netcatty-mdx-editor [class*="_secondaryButton_"]:hover {
background: hsl(var(--secondary)) !important;
}
/* Hide empty "Upload an image" file field chrome when handler is null (hidden input only). */
.netcatty-mdx-editor form[class*="_multiFieldForm_"] input[type="file"] {
font-size: 12px;
color: hsl(var(--muted-foreground));
}
.netcatty-mdx-content {
min-height: calc(100vh - 15rem);
padding: 0;
color: hsl(var(--foreground) / 0.9);
/* Note body follows the UI font (Settings > Appearance > Interface Font);
the note font tool only controls code block / inline code fonts. */
font-family: var(--font-sans);
font-size: var(--note-font-size, 15px);
line-height: 1.75;
outline: none;
}
.netcatty-mdx-content:focus {
outline: none;
}
.netcatty-mdx-content p {
margin: 0.55rem 0;
}
.netcatty-mdx-content[contenteditable="true"] > p:first-child {
min-height: 1.85em;
}
.netcatty-mdx-editor .mdxeditor-root-contenteditable > .netcatty-mdx-content:not([contenteditable]) {
top: 0;
padding: 0 !important;
color: hsl(var(--muted-foreground));
line-height: 1.75;
}
.netcatty-mdx-editor .mdxeditor-root-contenteditable > .netcatty-mdx-content:not([contenteditable]) p {
margin: 0;
}
.netcatty-mdx-content h1,
.netcatty-mdx-content h2,
.netcatty-mdx-content h3 {
color: hsl(var(--foreground));
font-weight: 650;
letter-spacing: 0;
}
.netcatty-mdx-content h1 {
margin: 1.1rem 0 0.7rem;
font-size: 1.7rem;
line-height: 1.2;
}
.netcatty-mdx-content h2 {
margin: 1rem 0 0.6rem;
font-size: 1.3rem;
line-height: 1.25;
}
.netcatty-mdx-content h3 {
margin: 0.85rem 0 0.5rem;
font-size: 1.05rem;
line-height: 1.35;
}
.netcatty-mdx-content ul,
.netcatty-mdx-content ol {
margin: 0.55rem 0;
padding-left: 1.35rem;
}
.netcatty-mdx-content ul {
list-style-type: disc;
}
.netcatty-mdx-content ul ul {
list-style-type: circle;
}
.netcatty-mdx-content ul ul ul {
list-style-type: square;
}
.netcatty-mdx-content ol {
list-style-type: decimal;
}
.netcatty-mdx-content ol ol {
list-style-type: lower-alpha;
}
.netcatty-mdx-content ol ol ol {
list-style-type: lower-roman;
}
.netcatty-mdx-content li {
margin: 0.25rem 0;
}
/*
* GFM task lists (Lexical CheckListPlugin): default MDX styles pin the checkbox
* at top:0, which sits high against our 1.75 line-height. Re-center the box with
* the first text line, keep a solid hit target, and drop the hanging negative
* margin so label text lines up cleanly with the control.
*/
.netcatty-mdx-content ul:has(> li[role="checkbox"]),
.netcatty-mdx-content ul:has(> li[aria-checked]),
.netcatty-mdx-content ul:has(> li[class*="_listItemChecked_"]),
.netcatty-mdx-content ul:has(> li[class*="_listItemUnchecked_"]) {
list-style: none !important;
list-style-type: none !important;
padding-left: 0.15rem;
margin-left: 0;
}
.netcatty-mdx-content li[role="checkbox"],
.netcatty-mdx-content li[aria-checked] {
position: relative;
list-style: none;
margin-left: 0 !important;
margin-inline-start: 0 !important;
padding-left: 1.75rem !important;
padding-right: 0 !important;
min-height: 1.75em;
line-height: 1.75;
cursor: default;
}
.netcatty-mdx-content li[role="checkbox"]::before,
.netcatty-mdx-content li[aria-checked]::before {
content: "" !important;
box-sizing: border-box !important;
position: absolute !important;
/* Vertically center 1rem box in a 1.75em line: (1.75em - 1rem) / 2 */
top: calc((1.75em - 1rem) / 2) !important;
left: 0 !important;
width: 1rem !important;
height: 1rem !important;
margin: 0 !important;
cursor: pointer !important;
pointer-events: auto !important;
display: block !important;
background-size: cover !important;
border-radius: 3px !important;
}
.netcatty-mdx-content li[aria-checked="false"]::before,
.netcatty-mdx-content li[role="checkbox"][aria-checked="false"]::before {
border: 1px solid hsl(var(--border)) !important;
background-color: transparent !important;
}
.netcatty-mdx-content li[aria-checked="true"]::before {
border: 1px solid hsl(var(--primary) / 0.7) !important;
background-color: hsl(var(--primary)) !important;
}
/* Checkmark glyph (MDX draws this with ::after) */
.netcatty-mdx-content li[aria-checked="true"]::after {
top: calc((1.75em - 1rem) / 2 + 0.1rem) !important;
left: 0.35rem !important;
width: 0.28rem !important;
height: 0.55rem !important;
cursor: pointer !important;
}
/* Preview is readOnly — still show pointer on the control so it feels clickable. */
.netcatty-mdx-editor--preview .netcatty-mdx-content li[role="checkbox"],
.netcatty-mdx-editor--preview .netcatty-mdx-content li[aria-checked] {
cursor: default;
}
.netcatty-mdx-editor--preview .netcatty-mdx-content li[role="checkbox"]::before,
.netcatty-mdx-editor--preview .netcatty-mdx-content li[aria-checked]::before,
.netcatty-mdx-editor--preview .netcatty-mdx-content li[aria-checked="true"]::after {
cursor: pointer !important;
}
.netcatty-mdx-content code {
border-radius: 4px;
background: hsl(var(--secondary) / 0.8);
padding: 0.12rem 0.3rem;
font-family: var(--note-font-family, var(--font-mono));
font-size: var(--note-code-font-size, 0.88em);
}
.netcatty-mdx-content pre {
border: 0;
border-radius: 0;
background: transparent;
padding: 0;
}
.netcatty-mdx-editor [class*="_codeMirrorWrapper_"] {
position: relative !important;
min-height: 2rem !important;
margin: 0.35rem 0 0.65rem;
border: 0 !important;
border-radius: 0;
background: transparent !important;
padding: 0 !important;
overflow: visible !important;
}
.netcatty-note-code-copy {
position: absolute !important;
top: 0.2rem !important;
right: 0.15rem !important;
z-index: 40 !important;
display: inline-flex !important;
align-items: center !important;
justify-content: center !important;
width: 1.45rem !important;
height: 1.45rem !important;
padding: 0 !important;
border: 0 !important;
border-radius: 4px !important;
background: transparent !important;
color: hsl(var(--muted-foreground)) !important;
box-shadow: none !important;
opacity: 0;
cursor: pointer !important;
transition: opacity 0.15s, color 0.15s, background-color 0.15s;
}
.netcatty-mdx-editor [class*="_codeMirrorWrapper_"]:hover .netcatty-note-code-copy,
.netcatty-mdx-editor .cm-editor:hover ~ .netcatty-note-code-copy,
.netcatty-mdx-editor pre:hover .netcatty-note-code-copy,
.netcatty-mdx-content pre:hover .netcatty-note-code-copy,
.netcatty-mdx-editor--preview .netcatty-note-code-copy,
.netcatty-note-code-copy[data-copied="true"],
.netcatty-note-code-copy:focus-visible {
opacity: 0.85 !important;
pointer-events: auto !important;
}
.netcatty-note-code-copy:hover,
.netcatty-mdx-editor--preview .netcatty-note-code-copy:hover {
opacity: 1 !important;
background: hsl(var(--secondary)) !important;
color: hsl(var(--foreground)) !important;
}
.netcatty-note-code-copy[data-copied="true"] {
color: hsl(var(--foreground)) !important;
}
.netcatty-mdx-editor .cm-editor,
.netcatty-mdx-editor .cm-content,
.netcatty-mdx-editor [class*="_codeMirrorWrapper_"],
.netcatty-mdx-editor pre,
.netcatty-mdx-editor code,
.netcatty-mdx-editor [class*="_code_"],
.netcatty-mdx-editor [class*="code_"],
.netcatty-mdx-editor kbd,
.netcatty-mdx-editor samp,
.netcatty-mdx-content pre,
.netcatty-mdx-content code,
.netcatty-mdx-content [class*="_code_"],
.netcatty-mdx-content [class*="code_"],
.netcatty-mdx-content kbd,
.netcatty-mdx-content samp {
font-family: var(--note-font-family, var(--font-mono)) !important;
}
.netcatty-mdx-editor .cm-editor,
.netcatty-mdx-editor .cm-content,
.netcatty-mdx-editor pre,
.netcatty-mdx-content pre {
font-size: var(--note-code-font-size, 13px) !important;
}
.netcatty-mdx-editor [class*="_codeMirrorWrapper_"]:has([data-language="latex"]),
.netcatty-mdx-editor [class*="_codeMirrorWrapper_"]:has([data-language="tex"]) {
border: 0 !important;
background: transparent !important;
padding: 0 !important;
}
.netcatty-math-formula-preview {
display: flex;
align-items: center;
justify-content: safe center;
padding: 0.55rem 0;
margin: 0.4rem 0;
border-radius: 0;
background: transparent;
border: 0;
font-size: 1.45em;
color: hsl(var(--foreground));
overflow-x: auto;
max-width: 100%;
user-select: text;
min-height: 2.25rem;
}
.netcatty-math-formula-preview .katex-display {
flex: 0 0 auto;
margin: 0;
}
.netcatty-math-formula-preview .katex {
font-size: 1em;
color: inherit;
}
.netcatty-math-formula-preview .katex-mathml math {
flex: 0 0 auto;
}
.netcatty-math-reading-mode .cm-editor {
display: none !important;
}
.netcatty-math-reading-mode {
background: transparent !important;
border: none !important;
padding: 0 !important;
margin: 0.4rem 0 !important;
}
.netcatty-math-reading-mode .netcatty-math-formula-preview {
margin: 0;
background: transparent;
}
.netcatty-math-reading-mode > .netcatty-note-code-copy {
display: none !important;
}
.netcatty-mdx-editor:not(.netcatty-mdx-editor--preview) [class*="_codeMirrorWrapper_"] {
display: flex;
flex-direction: column;
align-items: stretch;
gap: 0;
margin: 0.25rem 0 0.55rem;
border-radius: 0;
background: transparent !important;
overflow: visible !important;
}
.netcatty-mdx-editor:not(.netcatty-mdx-editor--preview) .netcatty-mdx-content p:has(+ [class*="_codeMirrorWrapper_"]) {
margin-bottom: 0.2rem;
}
.netcatty-mdx-editor:not(.netcatty-mdx-editor--preview) [class*="_codeMirrorWrapper_"] .cm-editor {
min-height: 2rem !important;
background: transparent !important;
border-radius: 0 !important;
}
.netcatty-mdx-editor:not(.netcatty-mdx-editor--preview) [class*="_codeMirrorWrapper_"] .cm-content {
padding: 0 !important;
}
.netcatty-mdx-editor:not(.netcatty-mdx-editor--preview) [class*="_codeMirrorWrapper_"] .cm-scroller {
padding-right: 4.8rem !important;
min-height: 2.2rem !important;
}
.netcatty-mdx-editor:not(.netcatty-mdx-editor--preview) [class*="_codeMirrorToolbar_"] {
position: absolute !important;
top: 0.35rem !important;
right: 0.35rem !important;
z-index: 30 !important;
display: inline-flex !important;
align-items: center !important;
justify-content: flex-end;
gap: 0.25rem !important;
padding: 0.2rem 0.25rem !important;
margin: 0 !important;
width: auto !important;
border-radius: 6px !important;
background: hsl(var(--background) / 0.94) !important;
border: 1px solid hsl(var(--border) / 0.65) !important;
backdrop-filter: blur(8px) !important;
box-shadow: 0 2px 8px rgb(0 0 0 / 0.18) !important;
opacity: 0 !important;
pointer-events: none !important;
transition: opacity 0.15s ease !important;
}
.netcatty-mdx-editor:not(.netcatty-mdx-editor--preview) [class*="_codeMirrorWrapper_"]:hover [class*="_codeMirrorToolbar_"],
.netcatty-mdx-editor:not(.netcatty-mdx-editor--preview) [class*="_codeMirrorWrapper_"]:focus-within [class*="_codeMirrorToolbar_"],
.netcatty-mdx-editor:not(.netcatty-mdx-editor--preview) [class*="_codeMirrorToolbar_"]:has([data-state="open"]) {
opacity: 1 !important;
pointer-events: auto !important;
}
/* Language selector trigger in toolbar */
/* Align the TooltipWrap span wrapper so the language select sits level with action buttons */
.netcatty-mdx-editor [class*="_codeMirrorToolbar_"] [class*="_tooltipTrigger_"] {
display: inline-flex !important;
align-items: center !important;
align-self: center !important;
line-height: 1 !important;
}
.netcatty-mdx-editor [class*="_codeMirrorToolbar_"] [class*="_toolbarCodeBlockLanguageSelectTrigger_"],
.netcatty-mdx-editor [class*="_codeMirrorToolbar_"] [class*="_selectTrigger_"] {
display: inline-flex !important;
align-items: center !important;
justify-content: flex-start !important;
height: 1.45rem !important;
min-height: 1.45rem !important;
width: auto !important;
min-width: 0 !important;
max-width: none !important;
padding: 0 0.45rem !important;
margin: 0 !important;
gap: 0.25rem !important;
font-size: 11px !important;
font-weight: 500 !important;
line-height: 1 !important;
white-space: nowrap !important;
border: 0 !important;
border-radius: 4px !important;
background: hsl(var(--muted) / 0.7) !important;
color: hsl(var(--foreground)) !important;
box-shadow: none !important;
cursor: pointer !important;
transition: background-color 0.15s ease, color 0.15s ease !important;
}
.netcatty-mdx-editor [class*="_codeMirrorToolbar_"] [class*="_toolbarCodeBlockLanguageSelectTrigger_"]:hover,
.netcatty-mdx-editor [class*="_codeMirrorToolbar_"] [class*="_selectTrigger_"]:hover {
background: hsl(var(--secondary)) !important;
}
.netcatty-mdx-editor [class*="_codeMirrorToolbar_"] [class*="_selectTrigger_"] [data-radix-select-value],
.netcatty-mdx-editor [class*="_codeMirrorToolbar_"] [class*="_selectTrigger_"] > span:first-child {
flex: 0 0 auto;
overflow: visible;
max-width: none;
font-size: 11px !important;
line-height: 1 !important;
white-space: nowrap;
}
.netcatty-mdx-editor [class*="_codeMirrorToolbar_"] [class*="_selectDropdownArrow_"] svg,
.netcatty-mdx-editor [class*="_codeMirrorToolbar_"] [class*="_toolbarCodeBlockLanguageSelectTrigger_"] svg,
.netcatty-mdx-editor [class*="_codeMirrorToolbar_"] [class*="_selectTrigger_"] svg {
width: 10px !important;
height: 10px !important;
flex-shrink: 0;
opacity: 0.75;
}
/* Base style for all action buttons (Delete & Copy) in toolbar */
.netcatty-mdx-editor [class*="_codeMirrorToolbar_"] button:not([class*="_selectTrigger_"]):not([class*="_toolbarCodeBlockLanguageSelectTrigger_"]) {
display: inline-flex !important;
align-items: center !important;
justify-content: center !important;
height: 1.4rem !important;
min-height: 1.4rem !important;
max-height: 1.4rem !important;
width: 1.4rem !important;
min-width: 1.4rem !important;
max-width: 1.4rem !important;
padding: 0 !important;
margin: 0 !important;
border: 0 !important;
border-radius: 4px !important;
background: transparent !important;
color: hsl(var(--muted-foreground)) !important;
box-shadow: none !important;
cursor: pointer !important;
transition: background-color 0.15s ease, color 0.15s ease !important;
}
/* Delete Button specific hover */
.netcatty-mdx-editor [class*="_codeMirrorToolbar_"] button:not([class*="_selectTrigger_"]):not([class*="_toolbarCodeBlockLanguageSelectTrigger_"]):not(.netcatty-note-code-copy):hover {
background: hsl(var(--destructive) / 0.15) !important;
color: hsl(var(--destructive)) !important;
}
/* Copy Button inside toolbar */
.netcatty-mdx-editor [class*="_codeMirrorToolbar_"] .netcatty-note-code-copy {
position: static !important;
opacity: 1 !important;
pointer-events: auto !important;
}
.netcatty-mdx-editor [class*="_codeMirrorToolbar_"] .netcatty-note-code-copy:hover {
background: hsl(160 84% 39% / 0.15) !important;
color: hsl(160 84% 39%) !important;
}
.netcatty-mdx-editor [class*="_codeMirrorToolbar_"] button svg {
width: 10px !important;
height: 10px !important;
}
.netcatty-mdx-editor:not(.netcatty-mdx-editor--preview) [class*="_codeMirrorWrapper_"]:has([class*="_codeMirrorToolbar_"]) > .netcatty-note-code-copy {
display: none !important;
}
.netcatty-mdx-editor--preview [class*="_codeMirrorToolbar_"] {
display: none !important;
}
.netcatty-mdx-editor [class*="_codeMirrorToolbar_"] [class*="_toolbarCodeBlockLanguageSelectTrigger_"] span {
font-size: inherit !important;
line-height: inherit !important;
}
.netcatty-mdx-editor [class*="_toolbarCodeBlockLanguageSelectContent_"],
.netcatty-mdx-editor [class*="_codeMirrorToolbar_"] [class*="_selectContainer_"] {
width: auto !important;
min-width: max-content !important;
max-width: none !important;
max-height: 12rem;
overflow-x: visible !important;
overflow-y: auto;
font-size: 11px !important;
line-height: 1.25 !important;
margin: 0 !important;
padding: 0.15rem 0 !important;
border: 1px solid hsl(var(--border) / 0.7) !important;
border-radius: 6px !important;
background: hsl(var(--popover)) !important;
box-shadow: 0 8px 20px rgb(0 0 0 / 0.22) !important;
filter: none !important;
}
.netcatty-mdx-editor [class*="_toolbarCodeBlockLanguageSelectContent_"] [data-radix-select-viewport] {
width: auto !important;
min-width: max-content !important;
max-width: none !important;
padding: 0 !important;
}
.netcatty-mdx-editor [class*="_toolbarCodeBlockLanguageSelectContent_"] [class*="_selectItem_"] {
font-size: 11px !important;
line-height: 1.25 !important;
padding: 0.28rem 0.45rem !important;
min-height: 0 !important;
white-space: nowrap;
overflow: visible;
text-overflow: clip;
}
.netcatty-mdx-editor [class*="_toolbarCodeBlockLanguageSelectContent_"] [class*="_selectItem_"] [data-radix-select-item-text] {
font-size: 11px !important;
line-height: 1.25 !important;
white-space: nowrap;
overflow: visible;
text-overflow: clip;
}
.netcatty-mdx-editor [class*="_toolbarCodeBlockLanguageSelectContent_"] {
width: auto !important;
min-width: max-content !important;
max-width: none !important;
font-size: 11px !important;
max-height: 12rem;
overflow-y: auto;
}
.netcatty-mdx-editor [class*="_toolbarCodeBlockLanguageSelectContent_"] [class*="_selectItem_"] {
font-size: 11px !important;
padding: 0.28rem 0.45rem !important;
min-height: 0 !important;
}
.netcatty-mdx-editor .cm-editor {
--note-code-token-muted: hsl(var(--muted-foreground) / 0.9);
--note-code-token-keyword: color-mix(in oklab, hsl(var(--primary)) 82%, hsl(var(--foreground)));
--note-code-token-name: color-mix(in oklab, hsl(var(--primary)) 50%, hsl(var(--foreground)));
--note-code-token-value: color-mix(in oklab, hsl(var(--primary)) 38%, hsl(var(--foreground)));
--note-code-token-string: color-mix(in oklab, hsl(var(--primary)) 24%, hsl(var(--foreground)));
overflow: hidden;
border: 0 !important;
border-radius: 0;
background: transparent !important;
color: hsl(var(--foreground) / 0.9) !important;
font-family: var(--font-mono);
font-size: 13px !important;
}
.netcatty-mdx-editor .cm-scroller {
background: transparent !important;
color: hsl(var(--foreground) / 0.9) !important;
font-family: var(--font-mono);
}
.netcatty-mdx-editor .cm-content {
background: transparent !important;
color: hsl(var(--foreground) / 0.9) !important;
font-family: var(--font-mono);
padding: 0 !important;
}
.netcatty-mdx-editor .cm-line {
color: inherit !important;
line-height: 1.45 !important;
}
.netcatty-mdx-editor .cm-content .netcatty-code-token-muted {
color: var(--note-code-token-muted) !important;
}
.netcatty-mdx-editor .cm-content .netcatty-code-token-keyword {
color: var(--note-code-token-keyword) !important;
}
.netcatty-mdx-editor .cm-content .netcatty-code-token-name,
.netcatty-mdx-editor .cm-content .netcatty-code-token-variable,
.netcatty-mdx-editor .cm-content .netcatty-code-token-type,
.netcatty-mdx-editor .cm-content .netcatty-code-token-property {
color: var(--note-code-token-name) !important;
}
.netcatty-mdx-editor .cm-content .netcatty-code-token-value {
color: var(--note-code-token-value) !important;
}
.netcatty-mdx-editor .cm-content .netcatty-code-token-string {
color: var(--note-code-token-string) !important;
}
.netcatty-mdx-editor .cm-content .netcatty-code-token-link {
color: hsl(var(--primary)) !important;
text-decoration: underline;
}
.netcatty-mdx-editor .cm-content .netcatty-code-token-heading,
.netcatty-mdx-editor .cm-content .netcatty-code-token-strong {
font-weight: 600;
}
.netcatty-mdx-editor .cm-content .netcatty-code-token-emphasis {
font-style: italic;
}
.netcatty-mdx-editor .cm-content .netcatty-code-token-invalid {
color: hsl(var(--destructive)) !important;
}
.netcatty-mdx-editor .cm-gutters {
border-right: 1px solid hsl(var(--border) / 0.35) !important;
background: transparent !important;
color: hsl(var(--muted-foreground) / 0.75) !important;
font-family: var(--font-mono);
font-size: 13px !important;
line-height: 1.45 !important;
padding: 0 !important;
}
.netcatty-mdx-editor .cm-gutterElement {
font-size: 13px !important;
line-height: 1.45 !important;
}
.netcatty-mdx-editor .cm-lineNumbers .cm-gutterElement {
padding: 0 0.45rem 0 0.55rem !important;
}
.netcatty-mdx-editor .cm-activeLine,
.netcatty-mdx-editor .cm-activeLineGutter {
background: transparent !important;
}
.netcatty-mdx-editor .cm-editor:focus-within .cm-activeLine,
.netcatty-mdx-editor .cm-editor:focus-within .cm-activeLineGutter {
background: hsl(var(--primary) / 0.08) !important;
}
.netcatty-mdx-editor .cm-selectionBackground {
background: hsl(var(--primary) / 0.22) !important;
}
.netcatty-mdx-editor .cm-cursor {
border-left-color: hsl(var(--foreground)) !important;
}
.netcatty-mdx-content blockquote {
margin: 0.7rem 0;
border-left: 2px solid hsl(var(--border));
padding-left: 0.85rem;
color: hsl(var(--muted-foreground));
}
.netcatty-mdx-content hr {
margin: 1.35rem 0;
border-color: hsl(var(--border) / 0.45);
}
.netcatty-mdx-content table:not([class*="_tableEditor_"]) {
margin: 0.9rem 0;
width: max-content;
max-width: 100%;
border-collapse: collapse;
border: 1px solid hsl(var(--border));
}
.netcatty-mdx-content table:not([class*="_tableEditor_"]) th,
.netcatty-mdx-content table:not([class*="_tableEditor_"]) td {
border: 1px solid hsl(var(--border) / 0.45);
padding: 0.42rem 0.65rem;
text-align: left;
vertical-align: top;
}
.netcatty-mdx-content table:not([class*="_tableEditor_"]) th {
font-weight: 650;
}
/*
* Note images: source keeps width/height (HTML attrs for MDX / aspect ratio).
* Display: max-width caps screenshots to the pane; height:auto keeps ratio
* when width is known or unconstrained. Do NOT force height:auto on height-only
* images (e.g. <img height="24">) — that would ignore the presentational size.
* Do NOT force width:auto — that would ignore a 128px logo preference.
*/
.netcatty-mdx-content img,
.netcatty-mdx-editor [class*="_imageWrapper_"] img,
.netcatty-mdx-editor img {
max-width: 100% !important;
object-fit: contain;
display: block;
margin-left: auto;
margin-right: auto;
border-radius: 0.375rem;
}
/* Width-only (or no size): keep aspect ratio via height:auto. */
.netcatty-mdx-content img:not([height]),
.netcatty-mdx-content img[width],
.netcatty-mdx-editor [class*="_imageWrapper_"] img:not([height]),
.netcatty-mdx-editor [class*="_imageWrapper_"] img[width],
.netcatty-mdx-editor img:not([height]),
.netcatty-mdx-editor img[width] {
height: auto !important;
}
/* Height-only: keep aspect ratio via width:auto (do not force height:auto above). */
.netcatty-mdx-content img[height]:not([width]),
.netcatty-mdx-editor [class*="_imageWrapper_"] img[height]:not([width]),
.netcatty-mdx-editor img[height]:not([width]) {
width: auto !important;
max-width: 100% !important;
}
/* Cap MDX image chrome when ImageNode bakes large pixel widths into styles. */
.netcatty-mdx-editor [class*="_imageWrapper_"],
.netcatty-mdx-editor [class*="_imageContainer_"],
.netcatty-mdx-editor [class*="_imageControlWrapper_"] {
max-width: 100% !important;
height: auto !important;
overflow: visible !important;
box-sizing: border-box;
}
/*
* Small icon rows (README distro wall, width≤96): flow horizontally.
* JS sets data-note-img-size="sm" (see annotateNoteImageSizes) so we avoid a
* combinatorial :has(img[width="N"]) matrix that thrashes style recalc on
* badge walls. Large screenshots stay block + full-width capped above.
*/
.netcatty-mdx-content img[data-note-img-size="sm"],
.netcatty-mdx-editor img[data-note-img-size="sm"] {
display: inline-block !important;
margin: 0.35rem 0.4rem !important;
vertical-align: middle;
border-radius: 0.25rem;
}
.netcatty-mdx-editor [data-editor-block-type="image"][data-note-img-size="sm"],
.netcatty-mdx-editor [class*="_imageWrapper_"][data-note-img-size="sm"] {
display: inline-block !important;
vertical-align: middle;
margin: 0.2rem 0.15rem !important;
max-width: none !important;
width: auto !important;
}
/* Lone image paragraph marked sm by JS — keep it in the icon row. */
.netcatty-mdx-content p[data-note-img-size="sm"],
.netcatty-mdx-editor p[data-note-img-size="sm"] {
display: inline !important;
margin: 0 !important;
}
/* Image chrome stays out of the image until the image is hovered or focused. */
.netcatty-mdx-editor [data-editor-block-type="image"] [class*="_editImageToolbar_"],
.netcatty-mdx-editor [class*="_imageWrapper_"] [class*="_editImageToolbar_"] {
top: 0.375rem;
right: 0.375rem;
gap: 0.0625rem;
padding: 0.125rem;
opacity: 0;
pointer-events: none;
border: 1px solid hsl(var(--border) / 0.8);
border-radius: 0.375rem;
background: hsl(var(--background) / 0.96);
box-shadow: 0 2px 8px hsl(var(--foreground) / 0.12);
transition: opacity 120ms ease;
}
.netcatty-mdx-editor [data-editor-block-type="image"] [class*="_editImageToolbar_"] button,
.netcatty-mdx-editor [class*="_imageWrapper_"] [class*="_editImageToolbar_"] button {
display: inline-flex;
width: 1.375rem;
height: 1.375rem;
align-items: center;
justify-content: center;
border-radius: 0.25rem;
}
.netcatty-mdx-editor [data-editor-block-type="image"] [class*="_editImageToolbar_"] button svg,
.netcatty-mdx-editor [class*="_imageWrapper_"] [class*="_editImageToolbar_"] button svg {
width: 0.875rem;
height: 0.875rem;
}
.netcatty-mdx-editor [data-editor-block-type="image"] [class*="_editImageToolbar_"] button:hover,
.netcatty-mdx-editor [class*="_imageWrapper_"] [class*="_editImageToolbar_"] button:hover {
background: hsl(var(--secondary) / 0.75);
}
.netcatty-mdx-editor [data-editor-block-type="image"]:hover [class*="_editImageToolbar_"],
.netcatty-mdx-editor [data-editor-block-type="image"]:focus-within [class*="_editImageToolbar_"],
.netcatty-mdx-editor [class*="_imageWrapper_"]:hover [class*="_editImageToolbar_"],
.netcatty-mdx-editor [class*="_imageWrapper_"]:focus-within [class*="_editImageToolbar_"] {
opacity: 1;
pointer-events: auto;
}
/*
* Preserve README-style center alignment from paste (MDX edit path).
* (<div align="center"> / align=center / text-align:center).
*/
.netcatty-mdx-content [align="center"],
.netcatty-mdx-editor [align="center"],
.netcatty-mdx-content [style*="text-align:center"],
.netcatty-mdx-content [style*="text-align: center"],
.netcatty-mdx-editor [style*="text-align:center"],
.netcatty-mdx-editor [style*="text-align: center"] {
text-align: center !important;
}
.netcatty-mdx-content [align="center"] img,
.netcatty-mdx-editor [align="center"] img,
.netcatty-mdx-content [align="center"] [class*="_imageWrapper_"],
.netcatty-mdx-editor [align="center"] [class*="_imageWrapper_"],
.netcatty-mdx-content [align="center"] [data-editor-block-type="image"],
.netcatty-mdx-editor [align="center"] [data-editor-block-type="image"] {
margin-left: auto !important;
margin-right: auto !important;
}
/* Badge / shield images inside links: keep inline so rows stay horizontal. */
.netcatty-mdx-content a img,
.netcatty-mdx-editor a img,
.netcatty-mdx-content a [class*="_imageWrapper_"],
.netcatty-mdx-editor a [class*="_imageWrapper_"],
.netcatty-mdx-content a [data-editor-block-type="image"],
.netcatty-mdx-editor a [data-editor-block-type="image"] {
display: inline-block !important;
margin: 0.25rem 0.35rem !important;
vertical-align: middle;
max-width: 100% !important;
height: auto !important;
}
.netcatty-mdx-content a:has(img),
.netcatty-mdx-editor a:has(img),
.netcatty-mdx-content a:has([data-editor-block-type="image"]),
.netcatty-mdx-editor a:has([data-editor-block-type="image"]) {
display: inline-block !important;
text-decoration: none !important;
vertical-align: middle;
margin: 0.15rem 0.25rem;
}
.netcatty-mdx-content a {
color: hsl(var(--primary));
text-decoration: underline;
text-underline-offset: 0.18em;
}
.netcatty-mdx-content a[data-netcatty-host-link="true"] {
display: inline-flex;
align-items: baseline;
gap: 0.28em;
}
.netcatty-mdx-content a[data-netcatty-host-link="true"]::before {
content: "";
display: inline-block;
width: 0.92em;
height: 0.92em;
flex: 0 0 auto;
background-color: currentColor;
transform: translateY(0.12em);
-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='16' height='10' x='4' y='5' rx='2'/%3E%3Cpath d='M12 15v4'/%3E%3Cpath d='M8 19h8'/%3E%3C/svg%3E") center / contain no-repeat;
mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='16' height='10' x='4' y='5' rx='2'/%3E%3Cpath d='M12 15v4'/%3E%3Cpath d='M8 19h8'/%3E%3C/svg%3E") center / contain no-repeat;
}
.dark .netcatty-mdx-content table:not([class*="_tableEditor_"]) {
border-color: hsl(var(--foreground) / 0.32);
}
.dark .netcatty-mdx-content table:not([class*="_tableEditor_"]) th,
.dark .netcatty-mdx-content table:not([class*="_tableEditor_"]) td {
border-color: hsl(var(--foreground) / 0.18);
}
.netcatty-mdx-editor [class*="_tableColumnEditorTrigger_"],
.netcatty-mdx-editor [class*="_tableRowEditorTrigger_"],
.netcatty-mdx-editor [class*="_addRowButton_"],
.netcatty-mdx-editor [class*="_addColumnButton_"],
.netcatty-mdx-editor [class*="_tableColumnEditorToolbar_"] button {
cursor: pointer !important;
}
.netcatty-mdx-editor [class*="_tableColumnEditorPopoverContent_"] {
z-index: 80;
background: hsl(var(--popover));
color: hsl(var(--popover-foreground));
}
.netcatty-mdx-editor [data-radix-popper-content-wrapper] {
z-index: 90 !important;
}
.netcatty-mdx-editor [class*="_tableEditor_"] > tbody > tr > td:not([class*="_toolCell_"]),
.netcatty-mdx-editor [class*="_tableEditor_"] > tbody > tr > th:not([class*="_toolCell_"]):not([data-tool-cell="true"]) {
border-color: hsl(var(--border)) !important;
}
.dark .netcatty-mdx-editor [class*="_tableEditor_"] > tbody > tr > td:not([class*="_toolCell_"]),
.dark .netcatty-mdx-editor [class*="_tableEditor_"] > tbody > tr > th:not([class*="_toolCell_"]):not([data-tool-cell="true"]) {
border-color: hsl(var(--foreground) / 0.3) !important;
}