chore: upgrade Tailwind CSS v3 → v4#180
Merged
josecelano merged 1 commit intodevelopfrom Feb 26, 2026
Merged
Conversation
Upgrades Tailwind CSS and related packages: - tailwindcss: ^3.4.19 → ^4.2.1 - prettier-plugin-tailwindcss: ^0.6.10 → ^0.7.2 - @tailwindcss/vite: new (replaces PostCSS Tailwind plugin for Vite) - autoprefixer: removed (v4 handles vendor prefixes automatically) Migration steps performed (using official @tailwindcss/upgrade tool + manual fixes): 1. src/app.css: Migrated from @tailwind directives to CSS-first approach: - @tailwind base/components/utilities → @import 'tailwindcss' - plugins (typography, forms, container-queries) → @plugin directives - content array → @source directive - Added v4 compatibility base styles for default border-color 2. vite.config.ts: Added @tailwindcss/vite plugin (recommended over PostCSS for Vite projects). Placed before sveltekit() for proper CSS processing order. 3. postcss.config.js: Removed tailwindcss and autoprefixer plugins (now handled by @tailwindcss/vite and v4's built-in vendor prefixing). 4. tailwind.config.ts: Deleted — theme was empty (no customisations) and plugins are now declared via @plugin in app.css. No template changes needed: the project has no renamed utility usages (shadow-sm, outline-none, ring, etc.) and no @apply in Sass files. The Sass files (src/lib/scss/) are unaffected as they don't use Tailwind directives. All checks pass: - svelte-check: 0 errors, 0 warnings - build: success - lint: success (Prettier + ESLint) Closes #169 Part of epic #174
Member
Author
|
ACK 738d545 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Upgrades Tailwind CSS from v3 to v4 — a ground-up rewrite with a CSS-first configuration model.
Part of epic #174.
Closes #169
Package Changes
tailwindcss^3.4.19^4.2.1prettier-plugin-tailwindcss^0.6.10^0.7.2@tailwindcss/vite^4.2.1(new)autoprefixer^10.4.24The plugin packages (
@tailwindcss/typography,@tailwindcss/forms,@tailwindcss/container-queries) stay at their current versions — they work with v4 via the new@plugindirective.Migration Details
Used the official
@tailwindcss/upgradetool for the initial migration, then applied manual fixes.src/app.css
@tailwind base/components/utilities→@import 'tailwindcss'tailwind.config.ts→@plugindirectivescontentarray migrated to@sourcedirectiveborder-color(wasgray-200, nowcurrentColor)vite.config.ts
@tailwindcss/viteplugin (recommended for Vite projects over PostCSS)sveltekit()for correct CSS processing orderpostcss.config.js
tailwindcssandautoprefixerplugins (both now handled internally by@tailwindcss/vite)tailwind.config.ts — deleted
extend: {})@plugininapp.cssWhat Was NOT Needed
shadow-sm→shadow-xs,outline-none→outline-hidden,ring→ring-3, etc.)src/lib/scss/files and<style lang="scss">component blocks are unaffected — they use pure Sass features and no@applyTesting Checklist
svelte-check: 0 errors, 0 warningsnpm run build: successnpm run lint: success (Prettier + ESLint)