Skip to content

Migrate to Tailwind v4 #2075

@robertknight

Description

@robertknight

We are currently using Tailwind v3.x. We will need to migrate to Tailwind v4. See Tailwind's migration guide.

V4 has significant changes to the generated CSS and configuration:

  1. The generated CSS now targets a baseline of Safari 16.4 (March 2023), Chrome 111 (March 2023), and Firefox 128 (July 2024). This is newer than the three-year max age we have historically targeted, but we already had to change the client to Chrome 110, Safari 16.4 and FF 115 for compatibility with the newest PDF.js releases.
  2. There have been some slight changes in using Tailwind as a PostCSS plugin
  3. Configuration is now in CSS, although JS config can be loaded for backwards compatibility
  4. The generated CSS now relies on cascade layers. If there is any other CSS on the page, we'll need to take account of the fact that CSS not in a layer takes precedence over CSS that is in a layer. This affects CSS resets on h for example.
  5. There have been changes to various Tailwind style defaults that we'll need to adjust for. The most obvious one I've found so far is a change in how borders work.

We can simplify the initial migration by sticking with the JS config, then change to CSS-based config later.

Sub-tasks for initial migration:

Follow-up tasks:

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions