Repository navigation
Fix weird character rendering on Windows with Japanese locale - #20318
Conversation
Replace `ui-sans-serif` and `system-ui` with the following set of fonts: - `-apple-system` - `BlinkMacSystemFont` - 'Segoe UI' - Roboto - 'Helvetica Neue' - 'Noto Sans' - Arial For most peole this will look exactly the same, but it's for places like Windows where a different font is used for `system-ui` in case your machine is using a Japanese locale for example. Then the font used is 'Yu Gothic UI' which is the font that has bugs. You could argue that it's a bug in that font and even an OS bug for not providing a proper font for `system-ui`.
736130c to
d3ba8c0
Compare
Confidence Score: 4/5Safe to merge — the change is a direct substitution of a well-known font stack (Bootstrap v4/v5) for the system-ui-based one, and it is consistent across every affected file. The new font list fixes a real rendering defect on Windows CJK locales and the approach is validated by prior art (Starlight, VitePress). The main residual uncertainty — which the author openly acknowledges — is that dropping system-ui might produce subtly different rendering on exotic or future OS/locale combinations that are hard to test exhaustively. All snapshot tests are updated consistently, so there is no snapshot drift risk. No files require special attention; all changed files are in sync with the new font stack. Reviews (1): Last reviewed commit: "update CHANGELOG" | Re-trigger Greptile |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (7)
WalkthroughUpdated Tailwind’s default sans-serif font stack to use explicit platform fonts, including Apple, Windows, Android, and common fallback families, replacing 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
|
This change broke Tailwind defaults in a patch release: #20348 |
Tailwind CSS v4.3.3 changed the default `--font-sans` value to fix broken character rendering on Windows with CJK locales (tailwindlabs/tailwindcss#20318), but the docs still show the previous`ui-sans-serif, system-ui, sans-serif` stack. Update the `font-family` quick reference and the four `theme.css`examples on the theme page to match the stack that actually ships (tailwindlabs/tailwindcss/packages/tailwindcss/theme.css). Reported in tailwindlabs/tailwindcss#20348.
Majors: - vite 7.3.1 -> 8.3.3 (Rolldown + Oxc; Lightning CSS minifies CSS) - @vitejs/plugin-react 5.1.4 -> 6.1.2 (Babel removed; requires Vite 8) - vitest 4.0.18 -> 5.0.3 - typescript 5.9.3 -> 7.0.2 (native compiler; TS 6 defaults become hard) - jsdom 28.1.0 -> 30.1.2 (Node ^24.15.0) Minors and patches: react and react-dom 19.2.4 -> 19.3.0, @types/react and @types/react-dom -> 19.3.0, @xyflow/react 12.10.1 -> 12.12.0, tailwindcss and @tailwindcss/vite 4.1.18 -> 4.3.3, @testing-library/react 16.3.2 -> 16.3.3, @testing-library/user-event 14.6.1 -> 14.6.7. @types/node stays on 24.19.1, the latest 24.x, to match the Node 24 runtime. Breaking changes that hit us: - TypeScript 7 defaults `types` to [] and `noUncheckedSideEffectImports` to true. tsc rejected the side-effect CSS imports (styles.css and @xyflow/react/dist/style.css), and Node types reached the Vite plugins only through Vite's own triple-slash reference. tsconfig now lists "types": ["node", "vite/client"]; vite/client declares `*.css`. - jsdom 30 requires Node ^24.15.0, so engines.node is >=24.15.0. - The old lockfile pinned vitest 4 (a hard dependency on vite ^6 || ^7) and @tailwindcss/vite 4.1 (peer vite ^7), which blocked an incremental resolve, so the lockfile is regenerated from scratch. Removed unused dependencies: recharts, react-is (present only as recharts' peer) and @testing-library/jest-dom (no matcher use and no setup import). AGENTS.md no longer describes recharts. Visible change: Tailwind 4.3 swaps system-ui/ui-sans-serif in the default --font-sans stack for explicit platform fonts (tailwindlabs/tailwindcss#20318). Windows and macOS still get Segoe UI and SF; Linux browsers move from DejaVu Sans to Noto Sans or Arial. Custom @theme tokens resolve unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Upgrade tailwindcss and @tailwindcss/vite from 4.1.18 to 4.3.3, and @tailwindcss/typography from 0.5.19 to 0.5.20. @tailwindcss/vite 4.2.2+ declares Vite 8 as a supported peer, which is required before moving to Astro 7 (Vite 8). Without it pnpm keeps a separate Vite 7 copy just for the Tailwind plugin. No configuration changes are needed: the legacy JS config is still loaded through `@config`, and the generated CSS only differs by equivalent value optimizations, the Firefox iframe focus-ring fix, and the new default sans font stack. Tailwind 4.3.3 replaced `system-ui`/ `ui-sans-serif` with explicit platform fonts so CJK text respects the page `lang` on Windows (tailwindlabs/tailwindcss#20318). This site intentionally spreads Tailwind's default sans stack, so it follows the upstream fix; macOS, iOS, and Windows still resolve to the same system UI fonts. Release notes: https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.3.3
…ense fields, drop unused smol-toml
- package.json: @tailwindcss/vite ^0.0.0-insiders.1bf4291 -> ^4.3.3, and declare
tailwindcss ^4.3.3 (ui/styles/globals.css imports it directly; it only arrived
through @tailwindcss/vite). 4.3.3 is the newest stable 4.x the internal npm mirror
serves; 4.3.4 (2026-11-02) is held back by its new-release age rule.
- bun.lock: tailwindcss, @tailwindcss/{vite,node,oxide} and the 12 oxide platform
builds move to 4.3.3. Ranges that 4.3.3 itself declares also move enhanced-resolve
5.21.6 -> 5.26.0 (^5.24.1) and the oxide-wasm32-wasi bundled @emnapi/core and
@emnapi/runtime 1.11.0 -> 1.11.3 (^1.11.1, plus their @emnapi/wasi-threads 1.2.3).
No other version changes. Tarball URLs stay on the default registry; all 20 new
integrities match public npm (deps.dev SHA-512 lookup).
- Remove the devDependency smol-toml: nothing imports it (not apx's entrypoint.ts,
not the UI); it came from apx's project template.
- License: pyproject.toml `license = "LicenseRef-Databricks"` (PEP 639; wheel METADATA
License-Expression), package.json "SEE LICENSE IN ../../../LICENSE.md".
Compiled CSS: same 162 class selectors; the only rule changes are 4.3.3's own fixes
(platform font stack, tailwindlabs/tailwindcss#20318; Firefox iframe focus ring, #20292).
Screenshots at 1440 px with the backend running locally match pixel for pixel
(the only differing pixels also differ between two runs of the same build).
Co-authored-by: Isaac <no-reply@databricks.com>
This PR fixes an issue where some characters are incorrectly rendered on Windows with the Japanese locale.
This is arguably a bug in the font that's loaded by Windows when it encounters
system-ui. But waiting for fixes there might ... take a while.Another option is to not change the defaults in Tailwind CSS and instead let the users that support different locales implement a fallback by overriding the
--font-sansvariable.The biggest reason for me to not change it in Tailwind CSS is that it requires us to know what the (proper) fallback fonts need to be on a per OS basis.
But the main reason why I did want to make the change is that MDN says this about the
system-uifont:There are PRs in other big projects that made this kind of change as well. E.g.:
The reasoning for getting rid of
ui-sans-serifis twofold:ui-sans-serif, then we will run into the same issue again.Fixes: #19767
Fixes: #19768
Test plan
system-uiis not used anymore, so the bug doesn't happen