Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9120ad3b2d |
@@ -49,19 +49,14 @@ export default function FootnoteDefinitionView(props: NodeViewProps) {
|
|||||||
className={classes.definition}
|
className={classes.definition}
|
||||||
style={{ ["--footnote-number" as any]: `"${number}"` }}
|
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
|
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
|
back-link follows in DOM and is placed on the right via CSS flex. The
|
||||||
flex `order`. The second #146 mitigation lives in
|
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). */}
|
editor-paste-handler.tsx (reflowAfterPaste). */}
|
||||||
<NodeViewContent className={classes.definitionContent} />
|
<NodeViewContent className={classes.definitionContent} />
|
||||||
<span
|
|
||||||
className={classes.definitionMarker}
|
|
||||||
contentEditable={false}
|
|
||||||
aria-hidden="true"
|
|
||||||
>
|
|
||||||
{number}.
|
|
||||||
</span>
|
|
||||||
{refCount > 1 ? (
|
{refCount > 1 ? (
|
||||||
// Multiple references -> ↩ followed by one lettered link per occurrence.
|
// Multiple references -> ↩ followed by one lettered link per occurrence.
|
||||||
<span
|
<span
|
||||||
|
|||||||
@@ -81,34 +81,34 @@
|
|||||||
.definition {
|
.definition {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: flex-start;
|
align-items: flex-start;
|
||||||
/* Tight number→text spacing (~one space) so it reads like "1. text"
|
/* Tight spacing between the content and the trailing ↩ back-link. */
|
||||||
instead of leaving a wide gap after the period. */
|
gap: 0.3em;
|
||||||
gap: 0.4em;
|
|
||||||
padding: 2px 0;
|
padding: 2px 0;
|
||||||
|
/* Footnotes read smaller than body text (16px). Matches .listHeading. */
|
||||||
|
font-size: var(--mantine-font-size-sm);
|
||||||
}
|
}
|
||||||
|
|
||||||
.definitionMarker {
|
/* The "N." number is decorative (from the --footnote-number CSS var on the
|
||||||
order: -1; /* keep the "N." marker on the LEFT though it follows content in DOM (#146) */
|
wrapper, never in the document model) and is rendered inline at the start of
|
||||||
flex: 0 0 auto;
|
the first content line via ::before. This keeps text and wrapped lines flush
|
||||||
min-width: 1.5em;
|
to the left margin — no hanging indent — while the editable contentDOM stays
|
||||||
/* Right-align within the narrow column so the period sits next to the text
|
the FIRST DOM child (#146). */
|
||||||
and multi-digit numbers (10, 11, …) stay aligned on their right edge. */
|
|
||||||
text-align: right;
|
|
||||||
font-variant-numeric: tabular-nums;
|
|
||||||
color: var(--mantine-color-dimmed);
|
|
||||||
user-select: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.definitionContent {
|
.definitionContent {
|
||||||
flex: 1 1 auto;
|
flex: 1 1 auto;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The inner editable paragraph inherits `.ProseMirror p { margin: 0.5em 0 }`,
|
.definitionContent > :first-child::before {
|
||||||
which pushes the first text line ~0.5em below the "N." marker (aligned to
|
content: var(--footnote-number, "?") ". ";
|
||||||
flex-start), making the number float above the text. Drop the outer margins
|
color: var(--mantine-color-dimmed);
|
||||||
so the marker and the first line share the same top edge — same approach
|
font-variant-numeric: tabular-nums;
|
||||||
used for callouts in core.css. */
|
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 {
|
.definitionContent > :first-child {
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user