diff --git a/scripts/browser-check.cjs b/scripts/browser-check.cjs index 3707dc96..5fe4fc6c 100644 --- a/scripts/browser-check.cjs +++ b/scripts/browser-check.cjs @@ -220,6 +220,17 @@ async function checkEditorNewlines(page) { `${name}: retained after switching languages`, ); } + + // The overlay paints the glyphs the textarea positions, so a that + // resolves its own font family drifts away from the caret line by line. + assert.equal( + await page + .locator("#editor-highlight code") + .evaluate((node) => getComputedStyle(node).fontFamily), + await editor.evaluate((node) => getComputedStyle(node).fontFamily), + "editor: highlight font matches the textarea", + ); + console.log( `editor: ${cases.length} Enter cases passed, including undo, redo and language switching`, ); diff --git a/web/styles.css b/web/styles.css index f0a45982..23360812 100644 --- a/web/styles.css +++ b/web/styles.css @@ -865,6 +865,10 @@ p { overflow: hidden; } +#editor-highlight code { + font: inherit; +} + #editor-lines { position: absolute; inset: 0 auto 0 0;