diff --git a/apps/client/src/features/editor/components/footnote/footnote-definition-view.tsx b/apps/client/src/features/editor/components/footnote/footnote-definition-view.tsx index b8fe182f..db61d677 100644 --- a/apps/client/src/features/editor/components/footnote/footnote-definition-view.tsx +++ b/apps/client/src/features/editor/components/footnote/footnote-definition-view.tsx @@ -49,19 +49,14 @@ export default function FootnoteDefinitionView(props: NodeViewProps) { className={classes.definition} style={{ ["--footnote-number" as any]: `"${number}"` }} > - {/* #146: contentDOM MUST be the first child — a non-editable marker before + {/* #146: contentDOM MUST be the first child — non-editable chrome before it makes click hit-testing snap the caret above. Content first; the - marker + back-link follow in DOM and are placed left/right via CSS - flex `order`. The second #146 mitigation lives in + back-link follows in DOM and is placed on the right via CSS flex. The + decorative "N." number is rendered inline via the .definitionContent + ::before rule (from the --footnote-number var), so no marker element + precedes the content. The second #146 mitigation lives in editor-paste-handler.tsx (reflowAfterPaste). */} - {refCount > 1 ? ( // Multiple references -> ↩ followed by one lettered link per occurrence. :first-child::before { + content: var(--footnote-number, "?") ". "; + color: var(--mantine-color-dimmed); + font-variant-numeric: tabular-nums; + user-select: none; +} + +/* The inner editable paragraph inherits `.ProseMirror p { margin: 0.5em 0 }`. + Drop the outer margins so the definition sits tight to the heading above and + the ::before number aligns with the top of the row — same approach used for + callouts in core.css. */ .definitionContent > :first-child { margin-top: 0; }