Skip to content

chore: migrate from Tailwind CSS v3 to v4#287

Merged
andygrunwald merged 1 commit intomainfrom
chore/tailwind-v4-migration
Mar 22, 2026
Merged

chore: migrate from Tailwind CSS v3 to v4#287
andygrunwald merged 1 commit intomainfrom
chore/tailwind-v4-migration

Conversation

@andygrunwald
Copy link
Member

Summary

  • Upgrade Tailwind CSS from v3.4.19 to v4 with CSS-first configuration
  • Replace deprecated @astrojs/tailwind integration with @tailwindcss/vite plugin
  • Convert tailwind.config.cjs (554 lines) to a @theme block in src/styles/global.css
  • Convert newspost.scss to plain CSS (SCSS not supported in Tailwind v4)
  • Remove sass dependency

Key changes

  • Dependencies: Removed @astrojs/tailwind, sass; added @tailwindcss/vite; updated tailwindcss to v4
  • Astro config: Moved from integrations: [tailwind()] to vite: { plugins: [tailwindcss()] }
  • Theme: Custom values (brand colors, blueGray palette, xl breakpoint at 1140px, 6px border-radius, custom shadows, font stacks) migrated to CSS @theme directive. Standard color palettes (gray, red, yellow, etc.) are identical to v4 defaults and omitted.
  • bg-body/text-body split: In v3 these mapped to different colors (#fff / #1e293b). In v4 a single --color-body generates both. Solved by using bg-white for backgrounds and --color-body: #1e293b for text.
  • Border color default: Added @layer base rule to preserve v3's #e2e8f0 default (v4 defaults to currentColor)
  • SCSS → CSS: The newspost styles use only CSS nesting + @apply (no SCSS-specific features), so the conversion is a file rename + @reference directive for v4 compatibility
  • CI: Removed deleted tailwind.config.cjs from workflow path triggers

Test plan

  • make build succeeds (verified locally)
  • Visual inspection: homepage rounded buttons (6px), pricing card shadows, sourcectl-orange brand color, blueGray text colors
  • Visual inspection: changelog post typography (headings, lists, blockquotes, links)
  • Visual inspection: responsive breakpoints (especially xl at 1140px)
  • Mobile navigation menu toggle works

🤖 Generated with Claude Code

- Replace @astrojs/tailwind (deprecated) with @tailwindcss/vite plugin
- Convert tailwind.config.cjs to CSS-first @theme config in global.css
- Convert newspost.scss to plain CSS (SCSS not supported in v4)
- Remove sass dependency (no longer needed)
- Replace bg-body with bg-white in layouts (v4 single color per name)
- Add @reference directive for @apply in component CSS files
- Update CI workflow paths (remove deleted tailwind.config.cjs)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@netlify
Copy link

netlify bot commented Mar 21, 2026

Deploy Preview for lively-frangollo-e43a02 ready!

Name Link
🔨 Latest commit 02ade3b
🔍 Latest deploy log https://app.netlify.com/projects/lively-frangollo-e43a02/deploys/69bf08d381b1e90007b1966b
😎 Deploy Preview https://deploy-preview-287--lively-frangollo-e43a02.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@andygrunwald andygrunwald merged commit 35fbebf into main Mar 22, 2026
5 checks passed
@andygrunwald andygrunwald deleted the chore/tailwind-v4-migration branch March 22, 2026 07:55
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.

1 participant