fix: Cursor position changes on new token with line numbers enabled (#4896)

Move line numbers to psuedo element
This commit is contained in:
Tom Moor
2023-02-18 13:56:26 -05:00
committed by GitHub
parent 66b5dd0a2b
commit 4805259823
2 changed files with 31 additions and 22 deletions

View File

@@ -992,15 +992,21 @@ mark {
pre {
padding-left: calc(var(--line-number-gutter-width, 0) * 1em + 1.5em);
}
}
.code-block .line-numbers {
position: absolute;
left: 1em;
color: ${props.theme.textTertiary};
text-align: right;
font-variant-numeric: tabular-nums;
user-select: none;
&:after {
content: attr(data-line-numbers);
position: absolute;
left: 1em;
top: calc(1px + 0.75em);
font-family: ${props.theme.fontFamilyMono};
font-size: 13px;
line-height: 1.4em;
color: ${props.theme.textTertiary};
text-align: right;
font-variant-numeric: tabular-nums;
user-select: none;
}
}
.mermaid-diagram-wrapper {