Skip to content

Commit e204e3b

Browse files
committed
fix: use ch instead of em unit
1 parent a579ebb commit e204e3b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

frontend/components/CodeEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export function CodeEditor({
131131
}
132132
}, [])
133133

134-
const lineNumOffset = `${Math.floor(Math.log10(lineCount)) + 2}em`
134+
const lineNumOffset = `${Math.floor(Math.log10(lineCount)) + 3}ch`
135135

136136
return (
137137
<div className={className} {...rest}>

frontend/pages/DisplayPaste.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import { tst } from "../utils/overrides.js"
1515
import { highlightHTML, useHLJS } from "../utils/HighlightLoader.js"
1616

1717
import "../style.css"
18+
import "../styles/highlight-theme-light.css"
19+
import "../styles/highlight-theme-dark.css"
1820

1921
function isBinaryPath(path: string) {
2022
return binaryExtensions.includes(path.replace(/.*\./, ""))
@@ -195,7 +197,7 @@ export function DisplayPaste() {
195197
</div>
196198
<div className="font-mono relative" role="article">
197199
<pre
198-
style={{ paddingLeft: `${Math.floor(Math.log10(pasteLineCount)) + 2}em` }}
200+
style={{ paddingLeft: `${Math.floor(Math.log10(pasteLineCount)) + 3}ch` }}
199201
dangerouslySetInnerHTML={{ __html: highlightedHTML }}
200202
/>
201203
<span

0 commit comments

Comments
 (0)