Skip to content

fix(blazor): pin Tailwind CSS to v3 to restore CI build#142

Merged
phmatray merged 1 commit intomainfrom
fix/tailwind-v4-cli
Feb 27, 2026
Merged

fix(blazor): pin Tailwind CSS to v3 to restore CI build#142
phmatray merged 1 commit intomainfrom
fix/tailwind-v4-cli

Conversation

@phmatray
Copy link
Contributor

Summary

Pins tailwindcss from ^4.0.0 back to ^3.4.0 to fix the CI build failure.

Root Cause

Tailwind CSS v4 introduced breaking changes:

  1. CLI removed — The CLI was moved to a separate @tailwindcss/cli package
  2. @apply semantics changed — Custom component classes defined in @layer components can no longer be cross-referenced via @apply

The Blazor demo app's CSS extensively uses cross-referenced @apply (e.g., .btn-primary { @apply btn ... }, .toast-success { @apply toast ... }) across ~20 component classes, making a v4 migration non-trivial.

Changes

  • package.json: Pin tailwindcss to ^3.4.0 (was ^4.0.0)
  • package-lock.json: Updated lockfile for v3

Testing

  • Verified npm run build:css succeeds locally with Tailwind v3
  • CSS output is generated correctly at wwwroot/css/output.css

Discovered Issues

  • A full Tailwind CSS v4 migration should be tracked as a separate issue — requires rewriting component classes to use @utility directive or plain CSS instead of cross-referencing via @apply

Tailwind CSS v4 removed the CLI from the main package and changed
@apply semantics (custom component classes can no longer be cross-
referenced via @apply). Since the Blazor demo app's CSS extensively
uses this pattern (~20 component classes), pin to v3 for now.

A full v4 migration should be tracked as a separate issue.
@phmatray phmatray merged commit 98c99d1 into main Feb 27, 2026
2 checks passed
@phmatray phmatray deleted the fix/tailwind-v4-cli branch February 27, 2026 16:19
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