tailwindcss icon indicating copy to clipboard operation
tailwindcss copied to clipboard

Tailwind 4.3.3 changes the default sans font in a patch release

Open akfaew opened this issue 4 months ago • 11 comments

Upgrading Tailwind from 4.3.2 to 4.3.3 changed our application’s typography and text metrics.

The default changed from:

ui-sans-serif, system-ui, sans-serif

to:

-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif

This was intended to fix CJK language handling on Windows, but also changes Latin typography, wrapping, and layout depending on locally installed fonts.

The change is documented under “Fixed” in the 4.3.3 release notes (https://github.com/tailwindlabs/tailwindcss/releases/tag/v4.3.3), despite being visually breaking. The font-family documentation (https://tailwindcss.com/docs/font-family) still shows the previous default stack.

Tailwind previously stated that Preflight follows semantic versioning and should not change incompatibly within a major version in this maintainer discussion (https://github.com/tailwindlabs/tailwindcss/discussions/7496). Shipping a global typography change in a patch release appears inconsistent with that expectation.

akfaew avatar Jul 18 '26 12:07 akfaew

Please share more about the actual issue you are running into.

RobinMalfait avatar Jul 18 '26 16:07 RobinMalfait

I am not sure how to make this clearer, all the fonts in my app changed with this release.

akfaew avatar Jul 19 '26 11:07 akfaew

We fixed a legitimate bug, and every bug fix can be a breaking change if you somehow relied on the broken behavior.

Since system-ui is a font that gets replaced by another font, and if that font has bugs (like the bug we fixed) then we need to do something. I would like to help you but I really do need more information to try and solve this. Reverting the fix will fix your issue but will re-introduce the other bug.

Some questions:

  • What font was being used before?
  • What font is being used now?
  • What OS are you on where you see the issue?
  • What browser are you using?

As a workaround you can revert the --font-sans value yourself by using:

@theme {
  --font-sans:
    ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
    'Noto Color Emoji';
}

But know that this will break the CJK rendering bug.

If you can give me more information, then we can try to figure out a solution that works for you.

RobinMalfait avatar Jul 19 '26 13:07 RobinMalfait

We run screenshot tests in GitHub Actions and observed a font change on Ubuntu 24.04 after updating Tailwind CSS from v4.3.2 to v4.3.3. If the Tailwind CSS team would like a reproducible example, the changes are available in this PR:

https://github.com/ocavue/starlight-theme-nova/pull/202/changes

Example screenshot: website/test/screenshots.spec.ts-snapshots/linux/mobile-light/components-code.png

Before (GitHub Actions, Ubuntu 24.04, Tailwind CSS v4.3.2):

Before updating Tailwind CSS

After (GitHub Actions, Ubuntu 24.04, Tailwind CSS v4.3.3):

After updating Tailwind CSS

Diff:

Image

We also run the same screenshot tests on macOS 15 and observed no differences after the update.

I am not suggesting that this font change is necessarily a bug. I am only providing evidence that may support the earlier report: “all the fonts in my app changed with this release.”

ocavue avatar Jul 21 '26 06:07 ocavue

Same observation in our CI tests, but to be fair, the new font rendering looks more proper to me.

dargmuesli avatar Jul 21 '26 07:07 dargmuesli

Same issue on my site. Here's the diff that my visual regression tests caught:

Image

This site uses Tailwind's default configuration's default fonts. 100% vanilla paragraph text in a 100% vanilla config has significant visual diffs.

This repo is public if you care to inspect it:

  • https://github.com/sentience/kevinyank.com/pull/283
  • My stylesheet: styles/styles.css

sentience avatar Jul 21 '26 09:07 sentience

Well yes, I've easily set the fonts that used to be default manually. It is fixed for me. I just wished to inform you you broke the default behaviour for everybody with a patch release and may wish to revert this.

akfaew avatar Jul 21 '26 11:07 akfaew

The documentation side of this is addressed in tailwindlabs/tailwindcss.com#2513

thejamesgore avatar Jul 25 '26 10:07 thejamesgore

@sentience since the fonts changed, it's expected to change on some platforms since a different font will be loaded instead of a font with bugs.

Since ui-sans-serif and system-ui are essentially "variables", it means that your site won't look the same in all browsers / OSs (even before this change).

If you want your site to have the same font on all platforms, I would recommend to configure a custom font. More info: https://tailwindcss.com/docs/font-family#customizing-your-theme

Looking at your style.css file, it looks like that might have been what you wanted to do in the first place by loading Roboto? https://github.com/sentience/kevinyank.com/blob/ae4a64e821b77162cb7787f12db6bea0b99866dd/styles/styles.css#L1 it looks like you're not using it though.

You can use Roboto as the default font:

@theme {
  --font-sans: Roboto;
}

@thejamesgore got that merged in, thanks!


Going to close this for now since a different font is expected on some platforms. If you are running into this yourself I would recommend to either:

  1. Use a custom font, such that your site looks the same on all platforms (before this change, your site would've looked different on different platforms as well). More info: https://tailwindcss.com/docs/font-family#customizing-your-theme
  2. You can use the previous font setup:
@theme {
  --font-sans:
    ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
    'Noto Color Emoji';
}

Just be aware that this will re-introduce some bugs: https://github.com/tailwindlabs/tailwindcss/issues/19767 and https://github.com/tailwindlabs/tailwindcss/issues/19768

RobinMalfait avatar Jul 28 '26 10:07 RobinMalfait

This change should have been released by at least an minor level. It is too destructive to be included in a patch release.

GitHub Actions, Ubuntu 24.04

I wonder what the following commands outputs there.

  • fc-list : family
  • gsettings get org.gnome.desktop.interface font-name

What fonts are used before and after the change? system-ui does not guarantee that a font optimized for Latin alphabets and punctuation is chosen in pages written in English in all environments.

You might have (or be able) to apt-get install some fonts to suppress this change.

macOS 15 and observed no differences after the update.

This change was carefully designed in this way.

tats-u avatar Jul 29 '26 03:07 tats-u

What OS are you on where you see the issue?

Plus, what is the system language of your OS (especially if you are using Windows)?

tats-u avatar Jul 29 '26 07:07 tats-u