fix: migrate globals.css to Tailwind CSS v4 syntax#2179
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
🦋 Changeset detectedLatest commit: f76ac74 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
🚀 Preview Environment (PR #2179)Preview URL: https://pr-2179.dev.getgram.ai
Gram Preview Bot |
adaam2
left a comment
There was a problem hiding this comment.
I did a quick spot check, and everything looks as it was 👍🏻
05c2918 to
df08254
Compare
…nt formatter from breaking it
df08254 to
f76ac74
Compare
Summary
@tailwind base/components/utilitieswith@import "tailwindcss"(Tailwind v4)@importstatements to top of file (CSS spec requires@importbefore other rules)@apply border-border,@apply bg-background text-foregroundwith directhsl(var(...))CSS — Tailwind v4 doesn't generate utilities from CSS variable-basedtheme values, so
@applyon custom color classes fails at build timepnpm oxfmtwhich detected the v4 setup and applied v4's canonical class order, which differs slightly from v3'sTest plan
pnpm oxfmtpasses without errorspnpm dev— spot-check borders, background, and text colors in light and dark modeNotes
The class sorting changed because
oxfmtuses Prettier with theprettier-plugin-tailwindcssplugin, which sorts classes according to Tailwind's recommended order. That order is derived from the Tailwind config — specifically the theme and plugin definitions.When you switched from Tailwind v3 (@tailwind directives) to v4 (
@import "tailwindcss"). The Tailwind Prettier plugin detected the v4 setup and applied v4's canonical class order, which differs slightly from v3's. The plugin re-sorted all 225 files to match the new order in one pass.It's a one-time churn — now that the codebase is on v4's order, future runs of
oxfmtwon't re-sort anything unless new classes are added.You can verify this with a script
Note
Low Risk
Low risk styling-only change, but it can cause visual regressions (border/background/text colors) if the new CSS variable HSL mappings or Tailwind v4 import behavior differ from prior builds.
Overview
Migrates the dashboard
globals.cssto Tailwind CSS v4 by switching from@tailwind base/components/utilitiesto@import "tailwindcss"and reordering@importstatements.Replaces a few
@applyusages for theme-driven colors with explicithsl(var(--...))CSS to avoid Tailwind v4 build-time failures, and updates.oxfmtrc.jsonto stop ignoringglobals.cssso it can be formatted/sorted. Adds a patch changeset for the dashboard package.Reviewed by Cursor Bugbot for commit 5ee3d69. Bugbot is set up for automated code reviews on this repo. Configure here.