Repository navigation
migrate to tailwind 4 - #472
Conversation
Deploying labs-browserpod-previews with
|
| Latest commit: |
1c045ce
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://7478dbfe.labs-browserpod-previews.pages.dev |
| Branch Preview URL: | https://tailwind-updating.labs-browserpod-previews.pages.dev |
0bef9fc to
3c2cdd9
Compare
3c2cdd9 to
5bbc17a
Compare
b787cfb to
e339356
Compare
There was a problem hiding this comment.
No issues with the code. The only noticeable thing, but minor is a change introduced by Tailwind 4 on how it performs gradient interpolations (only visible on cheerp index hero gradient and cheerpx last gradient section before the footer).
IMO this is minor and can be left like this.
e4863a0 to
89eab66
Compare
6e45b22 to
1c045ce
Compare
|
Thanks for pointing out the colour changes Gaby! I looked into it and found some other changes here's what I changed: New commit changes
Changes accepted on purpose:On first implementation I also overwrote the colour codes of tailwinds default pallete shades to match V3 exactly But on second thought I think it's better to accept these small changes instead. Since most of these pins had no affect, or were very minor. So they didn't seem worth creating a mismatch of V3 and V4's colours. Affected changes and URL's for finding them:
Spacing changesBesides these there are also some small minor spacing changes introduced.
Happy to leave these as is, or fix them if preferred. :) |
Labs Tailwind 4.0 Migration
Migrating labs from TW 3 to 4, both for stack maintenance and to remove version drift blocking the monorepo merge
What to test:
Besides checking the files for code quality an extra visual check through the websites to make sure I didn't miss anything would be appreciated. :)
Changes made
tailwind.ts->styles/theme.css: TW4 deprecates the JS config format and moves to CSS-first. Config moved accordingly.ExportColorsasCssVariablessince theme colours are now exposed as native CSSSiteThemesis now also plain CSS@astrojs/tailwindreplaced by@tailwindcss/vite: TW 4 now ships as a Vite plugin and drops Astro integration, luckily Astro 5 natively supports it still. did need to add extra stylesheet import toshell.astroProductFilter.svelteto comply with V4, which now uses native CSSpt-42,flex-2,w-4.5/h-4.5,px-30wereinvalid in TW 3 so they did nothing. In V4 they now would have so I've removed them. If these were intentional we could still keep them. Though we should make sure to visually check all affected pages.
Review file guide
This PR features a lot of file changes but most of them are small syntax changes, I've categorized the files for easier reviewing:
packages/astro-theme/styles/theme.css(new),packages/astro-theme/tailwind.ts(deleted),sites/*/tailwind.config.cjs(5, deleted),sites/labs/postcss.config.cjs(deleted)packages/astro-theme/index.ts,packages/astro-theme/layouts/Shell.astro,sites/*/package.json` (5)@referencefor@applypackages/astro-theme/layouts/BlogPost.astro,packages/astro-theme/layouts/DemoArticle.astro,packages/astro-theme/lib/callout.css,packages/astro-theme/lib/terminal-os-tabs.csssites/labs/src/components/ProductFilter.sveltepackages/astro-theme/, 8 insites/labs/, 3 insites/cheerpx/, 2 insites/cheerpj/, 1 insites/cheerp/pnpm-lack.yamlVisual changes observed:
Preflight pins
at the bottom of the
theme.cssTheres a blog with a few elements that are currently pushed to maintain V3 behaviour. Added since they would cause small visual changes, so we can now without them easily flag any visual change as a potential bug.--default-ringones are likely to become deprecated in the future, and the rest would be for hygiene to fully put us on V4 defaults.Other notes