Skip to content

chore(deps): upgrade to Tailwind CSS v4 - #500

Merged
leonardoce merged 1 commit into
mainfrom
dev/tailwind-v4
Oct 21, 2026
Merged

leonardoce merged 1 commit into
mainfrom
dev/tailwind-v4

Conversation

@mnencia

@mnencia mnencia commented Oct 21, 2026

Copy link
Copy Markdown
Member

Move to the v4 CLI (@tailwindcss/cli) and drop the JavaScript config and the <4 version cap in Renovate. Keep the v3 look: v4 puts utilities in a cascade layer, which would let the site stylesheet (style.css) override them, so the utilities are imported unlayered. The v3 font stacks, text line heights and the seven palette colors used in layouts are restored in an @theme block, and md:leading-* is added where v3 let the responsive text size set the line height by CSS order. The Tailwind sources are limited to layouts.

This also clears the postcss-selector-parser Dependabot alert without an override, and supersedes #497 and #499.


Checked in headless Chrome against a build from main, at 1280 and 390 px wide, on 14 page types (home, blog list and posts, releases, support, end users, authors, tags, styleguide, info). Computed styles of 13,254 elements: the remaining differences are rounded-full computing to a larger equivalent radius, quoting and case in font stack strings, and space-x/y using margin-bottom instead of margin-top with the same gaps. Screenshots differ by 0.00% of pixels on almost every page. The blog list differs by 0.2% because Hugo renders some tag titles differently between builds ("Postgresql" or "PostgreSQL"), which is unrelated to CSS. Without the unlayered import the home page differed by 35%.

npm audit goes from 7 findings to 4 high ones: braces (no patched version exists), micromatch, @parcel/watcher and @tailwindcss/cli, which are the CLI's file watching dependencies. Dependabot already auto-dismissed the braces alert.

The minified CSS grows from 19.6 KB to about 38 KB, because v4 emits theme variables. Tailwind's source file is also published at /tailwind.css since assets is Hugo's static directory (already the case since #491).

Move to the v4 CLI and drop the JavaScript config and the Renovate
version cap. Keep the v3 look: v4 puts utilities in a cascade layer,
which would let the site stylesheet override them, so import them
unlayered. Restore the v3 font stacks, text line heights and palette
colors, and add the responsive line heights that v3 applied by CSS
order. This also clears the postcss-selector-parser alert.

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
@leonardoce
leonardoce merged commit 97d3fbd into main Oct 21, 2026
5 checks passed
@leonardoce
leonardoce deleted the dev/tailwind-v4 branch October 21, 2026 09:12
github-actions Bot pushed a commit that referenced this pull request Oct 21, 2026
Move to the v4 CLI (`@tailwindcss/cli`) and drop the JavaScript config
and the `<4` version cap in Renovate. Keep the v3 look: v4 puts
utilities in a cascade layer, which would let the site stylesheet
(`style.css`) override them, so the utilities are imported unlayered.
The v3 font stacks, text line heights and the seven palette colors used
in layouts are restored in an `@theme` block, and `md:leading-*` is
added where v3 let the responsive text size set the line height by CSS
order. The Tailwind sources are limited to `layouts`.

This also clears the postcss-selector-parser Dependabot alert without an
override, and supersedes #497 and #499.

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> 97d3fbd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants