Starter layouts load Google Fonts with display=swap and shift text after first paint
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- playwright, react
- Domain
- frontend, performance, testing-qa
Research direction
Start with nexy/modules/cli/templates/_shared/web-ui/src/routes/layout.nexy.jinja2:17, then inspect the adjacent framework-specific starter layouts and matching layouts under examples/. Locate the existing Playwright test and extend it to delay the fonts.googleapis.com response while recording CLS. The change is done when display=optional appears in every framework root layout and the delayed-response test records CLS 0.000.
Written by the indexing model from the issue text.
Description
Problem
The starter layouts link Google Fonts with display=swap, for example
nexy/modules/cli/templates/_shared/web-ui/src/routes/layout.nexy.jinja2:17 and the React, Vue,
Svelte, Solid and Preact variants beside it. The fallback font paints first, then the web font
replaces it and moves the text.
The baseline from #713 records CLS 0.000 on a cold page. It does not wait for the font response,
so the shift is not covered by any measured scenario.
Change to make
Measure the shift with a delayed fonts.googleapis.com response, then switch the starter layouts
to display=optional so a font that is not ready at first paint is skipped for that load. Apply
the same change to the example layouts under examples/.
Out of scope
Self hosting the font files and changing the font families are not part of this issue.
Checks
A Playwright test with a delayed font response records CLS 0.000. A project created by nx new
carries display=optional in its root layout for every framework.
- Dominant language
- Python
- Stars
- 11
- Forks
- 6
- Avg merge
- 2h 14m
- Merged PRs (30d)
- 265
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NexyPy/nexy
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:cli difficulty:intermediate enhancement
Difficulty 2/5 Half a day Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
area:cli area:docs question
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
area:docs difficulty:beginner good first issue priority:3
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
area:docs difficulty:beginner good first issue priority:3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
backend: claude chore dependencies
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
briandconnelly/amicus#606 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
semantica-agi/semantica#2320 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
vllm-project/vllm-omni#11465 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
jxxghp/MoviePilot#7699 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vllm-project/vllm-ascend#24010 ·
Maintainers usually reply within 1 day