-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Description
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:
- 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.
- There have been some slight changes in using Tailwind as a PostCSS plugin
- Configuration is now in CSS, although JS config can be loaded for backwards compatibility
- 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.
- 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:
- Support Tailwind v4 in @hypothesis/frontend-build (Support Tailwind v4 in CSS build frontend-build#813)
- Migrate pattern library application to Tailwind v4. Depending on the changes required in the component library itself, this may or may not require a major release of @hypothesis/frontend-shared. (Migrate pattern library site and tests to Tailwind v4 #2084)
- Migrate h to Tailwind v4 (Update to Tailwind v4 h#9877)
- Migrate via to Tailwind v4 (Migrate to Tailwind v4 via#1643)
- Migrate lms to Tailwind v4 (Migrate to Tailwind v4 lms#7211)
- Migrate the client to Tailwind v4 (Migrate to Tailwind v4 client#7291)
Follow-up tasks:
- Remove autoprefixer support from @hypothesis/frontend-build (Remove support for autoprefixer and Tailwind v3 frontend-build#814)
- Fix regression in client where sidebar sometimes appears on left side of window (Sidebar occasionally appears on left side of screen client#7307)
- Fix regression in browser extension where font size of annotation bodies is 12px instead of 13px (Fix sidebar font size in Chrome extension client#7311)
- Migrate from JS to CSS configuration (Add a CSS version of the Tailwind JS config #2090)
- Investigate why an issue appeared with the sidebar position after the TW4 migration, even though the root cause appeared to be something that occurred under TW3 as well (see Recalculate sidebar position when annotator styles load client#7309)
Metadata
Metadata
Assignees
Labels
No labels