Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
754db28e
Unverified
Commit
754db28e
authored
Dec 18, 2025
by
Will Binns-Smith
Committed by
GitHub
Dec 18, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bundle analyzer: remove geist font in favor of system ui fonts (#87292)
parent
1e1fd1ec
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
108 deletions
+14
-108
globals.css
apps/bundle-analyzer/app/globals.css
+2
-2
layout.tsx
apps/bundle-analyzer/app/layout.tsx
+0
-5
treemap-visualizer.tsx
apps/bundle-analyzer/components/treemap-visualizer.tsx
+12
-15
globals.css
apps/bundle-analyzer/styles/globals.css
+0
-86
No files found.
apps/bundle-analyzer/app/globals.css
View file @
754db28e
...
@@ -69,8 +69,8 @@
...
@@ -69,8 +69,8 @@
}
}
@theme
inline
{
@theme
inline
{
--font-sans
:
'Geist'
,
'Geist Fallback'
;
--font-sans
:
system-ui
,
sans-serif
;
--font-mono
:
'Geist Mono'
,
'Geist Mono Fallback'
;
--font-mono
:
ui-monospace
,
monospace
;
--color-background
:
var
(
--background
);
--color-background
:
var
(
--background
);
--color-foreground
:
var
(
--foreground
);
--color-foreground
:
var
(
--foreground
);
--color-card
:
var
(
--card
);
--color-card
:
var
(
--card
);
...
...
apps/bundle-analyzer/app/layout.tsx
View file @
754db28e
import
type
{
Metadata
}
from
'next'
import
type
{
Metadata
}
from
'next'
import
{
Geist
,
Geist_Mono
}
from
'next/font/google'
import
type
React
from
'react'
import
type
React
from
'react'
import
'./globals.css'
import
'./globals.css'
// These get used as font-sans and font-mono
const
_geist
=
Geist
({
subsets
:
[
'latin'
]
})
const
_geistMono
=
Geist_Mono
({
subsets
:
[
'latin'
]
})
export
const
metadata
:
Metadata
=
{
export
const
metadata
:
Metadata
=
{
title
:
'Next.js Bundle Analyzer'
,
title
:
'Next.js Bundle Analyzer'
,
description
:
description
:
...
...
apps/bundle-analyzer/components/treemap-visualizer.tsx
View file @
754db28e
...
@@ -13,6 +13,8 @@ import {
...
@@ -13,6 +13,8 @@ import {
import
{
SpecialModule
}
from
'@/lib/types'
import
{
SpecialModule
}
from
'@/lib/types'
import
{
formatBytes
}
from
'@/lib/utils'
import
{
formatBytes
}
from
'@/lib/utils'
const
UI_FONT
=
'system-ui, sans-serif'
interface
TreemapVisualizerProps
{
interface
TreemapVisualizerProps
{
analyzeData
:
AnalyzeData
analyzeData
:
AnalyzeData
sourceIndex
:
number
sourceIndex
:
number
...
@@ -307,7 +309,7 @@ function drawTreemap(
...
@@ -307,7 +309,7 @@ function drawTreemap(
const
{
titleFontSize
}
=
calculateTitleFontSizes
(
titleBarHeight
)
const
{
titleFontSize
}
=
calculateTitleFontSizes
(
titleBarHeight
)
ctx
.
fillStyle
=
colors
.
text
ctx
.
fillStyle
=
colors
.
text
ctx
.
font
=
`600
${
titleFontSize
}
px
sans-serif
`
ctx
.
font
=
`600
${
titleFontSize
}
px
${
UI_FONT
}
`
ctx
.
textAlign
=
'left'
ctx
.
textAlign
=
'left'
ctx
.
textBaseline
=
'middle'
ctx
.
textBaseline
=
'middle'
ctx
.
fillText
(
ctx
.
fillText
(
...
@@ -421,14 +423,10 @@ function drawTreemap(
...
@@ -421,14 +423,10 @@ function drawTreemap(
const
sizeFontSize
=
10
const
sizeFontSize
=
10
const
lineHeight
=
fontSize
+
2
const
lineHeight
=
fontSize
+
2
// Check if we have space for both name and size
ctx
.
font
=
`
${
fontSize
}
px
${
UI_FONT
}
`
const
hasSpaceForSize
=
rect
.
height
>
50
ctx
.
font
=
`
${
fontSize
}
px sans-serif`
const
displayName
=
truncateTextWithEllipsisIfNeeded
(
ctx
,
name
,
maxWidth
)
const
displayName
=
truncateTextWithEllipsisIfNeeded
(
ctx
,
name
,
maxWidth
)
const
hasSpaceForSize
=
rect
.
height
>
50
if
(
hasSpaceForSize
)
{
if
(
hasSpaceForSize
)
{
ctx
.
font
=
`
${
fontSize
}
px sans-serif`
ctx
.
fillText
(
ctx
.
fillText
(
displayName
,
displayName
,
rect
.
x
+
rect
.
width
/
2
,
rect
.
x
+
rect
.
width
/
2
,
...
@@ -436,7 +434,7 @@ function drawTreemap(
...
@@ -436,7 +434,7 @@ function drawTreemap(
)
)
ctx
.
globalAlpha
=
opacity
*
0.75
ctx
.
globalAlpha
=
opacity
*
0.75
ctx
.
font
=
`
${
sizeFontSize
}
px
sans-serif
`
ctx
.
font
=
`
${
sizeFontSize
}
px
${
UI_FONT
}
`
ctx
.
fillText
(
ctx
.
fillText
(
sizeText
,
sizeText
,
rect
.
x
+
rect
.
width
/
2
,
rect
.
x
+
rect
.
width
/
2
,
...
@@ -445,7 +443,6 @@ function drawTreemap(
...
@@ -445,7 +443,6 @@ function drawTreemap(
ctx
.
globalAlpha
=
opacity
ctx
.
globalAlpha
=
opacity
}
else
{
}
else
{
// Only name fits, draw it centered
// Only name fits, draw it centered
ctx
.
font
=
`
${
fontSize
}
px sans-serif`
ctx
.
fillText
(
ctx
.
fillText
(
displayName
,
displayName
,
rect
.
x
+
rect
.
width
/
2
,
rect
.
x
+
rect
.
width
/
2
,
...
@@ -497,12 +494,12 @@ function drawTreemap(
...
@@ -497,12 +494,12 @@ function drawTreemap(
ctx
.
textBaseline
=
'middle'
ctx
.
textBaseline
=
'middle'
// Measure size text first to reserve space
// Measure size text first to reserve space
ctx
.
font
=
`
${
sizeFontSize
}
px
sans-serif
`
ctx
.
font
=
`
${
sizeFontSize
}
px
${
UI_FONT
}
`
const
sizeWidth
=
measureTextCached
(
ctx
,
sizeText
)
const
sizeWidth
=
measureTextCached
(
ctx
,
sizeText
)
const
nameX
=
rect
.
x
+
8
const
nameX
=
rect
.
x
+
8
const
availableNameWidth
=
Math
.
max
(
0
,
rect
.
width
-
16
-
sizeWidth
-
gap
)
const
availableNameWidth
=
Math
.
max
(
0
,
rect
.
width
-
16
-
sizeWidth
-
gap
)
ctx
.
font
=
`600
${
titleFontSize
}
px
sans-serif
`
ctx
.
font
=
`600
${
titleFontSize
}
px
${
UI_FONT
}
`
const
displayName
=
truncateTextWithEllipsisIfNeeded
(
const
displayName
=
truncateTextWithEllipsisIfNeeded
(
ctx
,
ctx
,
name
,
name
,
...
@@ -518,7 +515,7 @@ function drawTreemap(
...
@@ -518,7 +515,7 @@ function drawTreemap(
// Only draw size text if it fits within bounds
// Only draw size text if it fits within bounds
if
(
sizeX
+
sizeWidth
<=
rect
.
x
+
rect
.
width
-
8
)
{
if
(
sizeX
+
sizeWidth
<=
rect
.
x
+
rect
.
width
-
8
)
{
ctx
.
font
=
`
${
sizeFontSize
}
px
sans-serif
`
ctx
.
font
=
`
${
sizeFontSize
}
px
${
UI_FONT
}
`
ctx
.
fillStyle
=
colors
.
textMuted
ctx
.
fillStyle
=
colors
.
textMuted
ctx
.
fillText
(
sizeText
,
sizeX
,
centerY
)
ctx
.
fillText
(
sizeText
,
sizeX
,
centerY
)
}
}
...
@@ -566,12 +563,12 @@ function drawTreemap(
...
@@ -566,12 +563,12 @@ function drawTreemap(
ctx
.
textBaseline
=
'middle'
ctx
.
textBaseline
=
'middle'
ctx
.
font
=
`
${
sizeFontSize
}
px
sans-serif
`
ctx
.
font
=
`
${
sizeFontSize
}
px
${
UI_FONT
}
`
const
sizeWidth
=
measureTextCached
(
ctx
,
sizeText
)
const
sizeWidth
=
measureTextCached
(
ctx
,
sizeText
)
const
nameX
=
rect
.
x
+
8
const
nameX
=
rect
.
x
+
8
const
availableNameWidth
=
Math
.
max
(
0
,
rect
.
width
-
16
-
sizeWidth
-
gap
)
const
availableNameWidth
=
Math
.
max
(
0
,
rect
.
width
-
16
-
sizeWidth
-
gap
)
ctx
.
font
=
`600
${
titleFontSize
}
px
sans-serif
`
ctx
.
font
=
`600
${
titleFontSize
}
px
${
UI_FONT
}
`
const
displayName
=
truncateTextWithEllipsisIfNeeded
(
const
displayName
=
truncateTextWithEllipsisIfNeeded
(
ctx
,
ctx
,
name
,
name
,
...
@@ -587,7 +584,7 @@ function drawTreemap(
...
@@ -587,7 +584,7 @@ function drawTreemap(
// Only draw size text if it fits within bounds
// Only draw size text if it fits within bounds
if
(
sizeX
+
sizeWidth
<=
rect
.
x
+
rect
.
width
-
8
)
{
if
(
sizeX
+
sizeWidth
<=
rect
.
x
+
rect
.
width
-
8
)
{
ctx
.
font
=
`
${
sizeFontSize
}
px
sans-serif
`
ctx
.
font
=
`
${
sizeFontSize
}
px
${
UI_FONT
}
`
ctx
.
fillStyle
=
colors
.
textMuted
ctx
.
fillStyle
=
colors
.
textMuted
ctx
.
fillText
(
sizeText
,
sizeX
,
centerY
)
ctx
.
fillText
(
sizeText
,
sizeX
,
centerY
)
}
}
...
...
apps/bundle-analyzer/styles/globals.css
deleted
100644 → 0
View file @
1e1fd1ec
@import
'tailwindcss'
;
@import
'tw-animate-css'
;
@custom-variant
dark
(
&
:
is
(.
dark
*
));
:root
{
--background
:
oklch
(
1
0
0
);
--foreground
:
oklch
(
0.145
0
0
);
--popover
:
oklch
(
1
0
0
);
--popover-foreground
:
oklch
(
0.145
0
0
);
--primary
:
oklch
(
0.205
0
0
);
--primary-foreground
:
oklch
(
0.985
0
0
);
--secondary
:
oklch
(
0.97
0
0
);
--secondary-foreground
:
oklch
(
0.205
0
0
);
--muted
:
oklch
(
0.97
0
0
);
--muted-foreground
:
oklch
(
0.556
0
0
);
--accent
:
oklch
(
0.97
0
0
);
--accent-foreground
:
oklch
(
0.205
0
0
);
--destructive
:
oklch
(
0.577
0.245
27.325
);
--destructive-foreground
:
oklch
(
0.577
0.245
27.325
);
--border
:
oklch
(
0.922
0
0
);
--input
:
oklch
(
0.922
0
0
);
--ring
:
oklch
(
0.708
0
0
);
--polyfill
:
oklch
(
0.478
0.0185
252.37
);
--polyfill-foreground
:
oklch
(
0.99
0
0
);
--radius
:
0.625rem
;
}
.dark
{
--background
:
oklch
(
0.145
0
0
);
--foreground
:
oklch
(
0.985
0
0
);
--popover
:
oklch
(
0.145
0
0
);
--popover-foreground
:
oklch
(
0.985
0
0
);
--primary
:
oklch
(
0.985
0
0
);
--primary-foreground
:
oklch
(
0.205
0
0
);
--secondary
:
oklch
(
0.269
0
0
);
--secondary-foreground
:
oklch
(
0.985
0
0
);
--muted
:
oklch
(
0.269
0
0
);
--muted-foreground
:
oklch
(
0.708
0
0
);
--accent
:
oklch
(
0.269
0
0
);
--accent-foreground
:
oklch
(
0.985
0
0
);
--destructive
:
oklch
(
0.396
0.141
25.723
);
--destructive-foreground
:
oklch
(
0.637
0.237
25.331
);
--border
:
oklch
(
0.269
0
0
);
--input
:
oklch
(
0.269
0
0
);
--ring
:
oklch
(
0.439
0
0
);
--polyfill
:
oklch
(
0.478
0.0185
252.37
);
--polyfill-foreground
:
oklch
(
0.99
0
0
);
}
@theme
inline
{
--font-sans
:
'Geist'
,
'Geist Fallback'
;
--font-mono
:
'Geist Mono'
,
'Geist Mono Fallback'
;
--color-background
:
var
(
--background
);
--color-foreground
:
var
(
--foreground
);
--color-popover
:
var
(
--popover
);
--color-popover-foreground
:
var
(
--popover-foreground
);
--color-primary
:
var
(
--primary
);
--color-primary-foreground
:
var
(
--primary-foreground
);
--color-secondary
:
var
(
--secondary
);
--color-secondary-foreground
:
var
(
--secondary-foreground
);
--color-muted
:
var
(
--muted
);
--color-muted-foreground
:
var
(
--muted-foreground
);
--color-accent
:
var
(
--accent
);
--color-accent-foreground
:
var
(
--accent-foreground
);
--color-destructive
:
var
(
--destructive
);
--color-destructive-foreground
:
var
(
--destructive-foreground
);
--color-border
:
var
(
--border
);
--color-input
:
var
(
--input
);
--color-ring
:
var
(
--ring
);
--color-polyfill
:
var
(
--polyfill
);
--color-polyfill-foreground
:
var
(
--polyfill-foreground
);
--radius-sm
:
calc
(
var
(
--radius
)
-
4px
);
--radius-md
:
calc
(
var
(
--radius
)
-
2px
);
--radius-lg
:
var
(
--radius
);
--radius-xl
:
calc
(
var
(
--radius
)
+
4px
);
}
@layer
base
{
*
{
@apply
border-border
outline-ring/50;
}
body
{
@apply
bg-background
text-foreground;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment