Skip to content

Commit 8e7cd39

Browse files
authored
[dev-overlay] disable font ligatures (#77865)
### Why? The font ligatures on code frames like `!==` may negatively affect the users by the readability and inconsistency with their editor. | Before | After | |--------|--------| | ![CleanShot 2025-04-05 at 18 57 57@2x](https://github.com/user-attachments/assets/ac4e4dc0-934a-4422-8006-3cd29726d48c) | ![CleanShot 2025-04-05 at 18 58 20@2x](https://github.com/user-attachments/assets/2fe497d5-fe21-4255-91f5-b3bf917df4ba) |
1 parent fd5f588 commit 8e7cd39

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/next/src/client/components/react-dev-overlay/ui/container/errors.stories.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,17 +134,17 @@ const runtimeErrors: ReadyRuntimeError[] = [
134134
{
135135
id: 4,
136136
runtime: true,
137-
error: new Error('Fourth error message'),
137+
error: new Error('typeof window !== undefined'),
138138
frames: () =>
139139
Promise.resolve([
140140
{
141141
error: true,
142-
reason: 'Fourth error message',
142+
reason: 'typeof window !== undefined',
143143
external: false,
144144
ignored: false,
145145
sourceStackFrame,
146146
originalStackFrame,
147-
originalCodeFrame: originalCodeFrame('Fourth error message'),
147+
originalCodeFrame: originalCodeFrame('typeof window !== undefined'),
148148
},
149149
]),
150150
},

packages/next/src/client/components/react-dev-overlay/ui/styles/base.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export function Base({ scale = 1 }: { scale?: DevToolsScale }) {
3333
'Source Sans Pro', sans-serif;
3434
3535
font-family: var(--font-stack-sans);
36+
font-variant-ligatures: none;
3637
3738
/* TODO: Remove replaced ones. */
3839
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);

0 commit comments

Comments
 (0)