Skip to content

Commit a5b6ff3

Browse files
committed
Make FindAndReplace scroll work in Firefox/Prism (fixes #119) ; Make selector of line-numbers dialog container width correctly specific
1 parent 8af07e7 commit a5b6ff3

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

plugins/prism-line-numbers.css

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ code-input.line-numbers, .line-numbers code-input {
1616
}
1717

1818
/* Make keyboard navigation still fill width */
19-
code-input .code-input_dialog-container .code-input_keyboard-navigation-instructions {
19+
code-input.line-numbers .code-input_dialog-container .code-input_keyboard-navigation-instructions, .line-numbers code-input .code-input_dialog-container .code-input_keyboard-navigation-instructions {
2020
width: calc(100% + max(3.8em, var(--padding, 16px)))!important;
2121
}
22+
23+
/* Override Prism styles so there's no display:inline, relatively-positioned code element which breaks offsetTop, used in FindAndReplace, in Firefox. */
24+
code-input pre[class*=language-].line-numbers>code {
25+
position: static;
26+
}
27+
/* Line numbers now positioned relative to the pre element not the code element. */
28+
code-input .line-numbers .line-numbers-rows {
29+
left: 0;
30+
top: var(--padding);
31+
}
32+
/* Things with padding when instructions are present */
33+
code-input:not(:has(.code-input_keyboard-navigation-instructions:empty)):has(textarea:focus):not(.code-input_mouse-focused) .line-numbers .line-numbers-rows {
34+
top: calc(var(--padding) + 3em);
35+
}

0 commit comments

Comments
 (0)