Skip to content

WIP: Upgrade Tailwind V3 to V4 - #594

Open
tarunsinghofficial wants to merge 14 commits into
developfrom
feat/tailwind-v4
Open

WIP: Upgrade Tailwind V3 to V4#594
tarunsinghofficial wants to merge 14 commits into
developfrom
feat/tailwind-v4

Conversation

@tarunsinghofficial

@tarunsinghofficial tarunsinghofficial commented Aug 20, 2026

Copy link
Copy Markdown
Collaborator

Summary

Migrates Wayfinder from Tailwind CSS v3.4 to v4, using the @tailwindcss/vite plugin and keeping the existing JS config via @config so env-var branding (generatePalette(), brand/surface colors) continues to work unchanged.

Closes #353

What changed

Build pipeline

  • Install tailwindcss@4 + @tailwindcss/vite
  • Wire Tailwind into vite.config.js; remove postcss.config.js, autoprefixer, and @tailwindcss/line-clamp (built into v4)
  • Bump @tailwindcss/forms and prettier-plugin-tailwindcss

CSS / config

  • Replace @tailwind directives with @import "tailwindcss" + @config "../tailwind.config.js"
  • Add @custom-variant dark using :is(.dark, .dark *) so dark utilities beat light ones on the same node (fixes search pane in dark mode)
  • Adapt tailwind.config.js for ESM plugin imports

Codemod + fixes

  • Run @tailwindcss/upgrade for v4 utility renames (bg-gradient-to-*bg-linear-to-*, break-wordswrap-break-word, etc.)
  • Add @reference in StopMarker.svelte for @apply in component styles
  • Add maplibre-gl as a direct dependency (peer of @maplibre/maplibre-gl-leaflet, dropped by --legacy-peer-deps installs)

Flowbite

Spiked flowbite-svelte@1.33 — needs Svelte 5.40+, Datepicker build/API churn, and component API updates across 6 files. flowbite-svelte@0.47 works with Tailwind v4 (build + UI verified), so it stays on 0.47 for this PR. A Flowbite 1.x upgrade can be a follow-up issue.

Components in use: Modal, Button, Tabs/TabItem, Datepicker, Radio, Checkbox, Input (6 files).

Visual QA

Compared 8 dark-mode before/after screenshots (search pane, All Routes, route detail, map pins, etc.) — no visible regressions after the dark-mode specificity fix.

Test plan

  • npm run lint
  • npx vitest run (103 files, 1794 tests)
  • npm run build

Summary by CodeRabbit

  • Refactor

    • Updated styling for compatibility with Tailwind CSS 4.
    • Improved text wrapping for route names and badges.
    • Refined light and dark theme colors across route, stop, search, and itinerary views.
    • Updated menu, header, toast, accordion, and skip-link positioning.
  • Bug Fixes

    • Improved dark-mode backgrounds in search panels.
    • Standardized gradient and layout styling across loading, error, and itinerary screens.
  • Documentation

    • Updated arrival and departure redesign specifications to reflect revised text wrapping.

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@tarunsinghofficial, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8fb69dff-52fd-448f-93f7-d1f32b580fdd

📥 Commits

Reviewing files that changed from the base of the PR and between 26a4042 and a383acf.

⛔ Files ignored due to path filters (10)
  • docs/tailwind-bef/Screenshot 2026-08-20 at 9.02.32 PM.png is excluded by !**/*.png
  • docs/tailwind-bef/Screenshot 2026-08-20 at 9.02.40 PM.png is excluded by !**/*.png
  • docs/tailwind-bef/Screenshot 2026-08-20 at 9.02.45 PM.png is excluded by !**/*.png
  • docs/tailwind-bef/Screenshot 2026-08-20 at 9.02.54 PM.png is excluded by !**/*.png
  • docs/tailwind-bef/Screenshot 2026-08-20 at 9.03.00 PM.png is excluded by !**/*.png
  • docs/tailwind-bef/Screenshot 2026-08-20 at 9.03.12 PM.png is excluded by !**/*.png
  • docs/tailwind-bef/Screenshot 2026-08-20 at 9.03.52 PM.png is excluded by !**/*.png
  • docs/tailwind-bef/Screenshot 2026-08-20 at 9.03.58 PM.png is excluded by !**/*.png
  • docs/tailwind-bef/Screenshot 2026-08-20 at 9.04.06 PM.png is excluded by !**/*.png
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (48)
  • .github/workflows/lint.yml
  • docs/superpowers/plans/2026-07-22-arrival-departure-redesign.md
  • docs/superpowers/plans/2026-07-23-map-stop-selection.md
  • docs/superpowers/plans/2026-08-07-survey-banner.md
  • docs/superpowers/specs/2026-07-22-arrival-departure-redesign-design.md
  • package.json
  • src/app.css
  • src/components/ArrivalDeparture.svelte
  • src/components/FullPageLoadingSpinner.svelte
  • src/components/LoadingSpinner.svelte
  • src/components/MapExperience.svelte
  • src/components/RouteBadge.svelte
  • src/components/StopItem.svelte
  • src/components/map/ContextMenuPopup.svelte
  • src/components/map/PopupContent.svelte
  • src/components/map/RouteLegend.svelte
  • src/components/map/StopMarker.svelte
  • src/components/map/VehiclePopupContent.svelte
  • src/components/navigation/AlertsModal.svelte
  • src/components/navigation/BottomSheet.svelte
  • src/components/navigation/Header.svelte
  • src/components/navigation/LanguageSwitcher/LanguageSwitcher.svelte
  • src/components/navigation/OverflowMenu.svelte
  • src/components/oba/TripDetailsPane.svelte
  • src/components/routes/RouteModal.svelte
  • src/components/routes/ViewAllRoutesModal.svelte
  • src/components/search/CollapsedSearchField.svelte
  • src/components/search/SearchField.svelte
  • src/components/search/SearchPane.svelte
  • src/components/search/SearchResultItem.svelte
  • src/components/service-alerts/ServiceAlertItem.svelte
  • src/components/service-alerts/ServiceAlerts.svelte
  • src/components/service-alerts/__tests__/ServiceAlerts.test.js
  • src/components/stops/StopPageHeader.svelte
  • src/components/stops/StopPane.svelte
  • src/components/surveys/SurveyBanner.svelte
  • src/components/surveys/SurveyLauncher.svelte
  • src/components/surveys/SurveyModal.svelte
  • src/components/surveys/SurveyQuestion.svelte
  • src/components/trip-planner/ItineraryDetails.svelte
  • src/components/trip-planner/LegDetails.svelte
  • src/components/trip-planner/RecentTripsList.svelte
  • src/components/trip-planner/TripOptionsModal.svelte
  • src/components/trip-planner/TripPlan.svelte
  • src/routes/+error.svelte
  • src/routes/+layout.svelte
  • src/routes/stops/[stopID]/schedule/+page.svelte
  • vite.config.js

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 00f5c97b-9f16-4b67-9c3f-aebba66bd5b9

📥 Commits

Reviewing files that changed from the base of the PR and between 1fd4dd8 and 26a4042.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (23)
  • docs/superpowers/plans/2026-07-22-arrival-departure-redesign.md
  • docs/superpowers/specs/2026-07-22-arrival-departure-redesign-design.md
  • package.json
  • postcss.config.js
  • src/app.css
  • src/components/FullPageLoadingSpinner.svelte
  • src/components/RouteBadge.svelte
  • src/components/RouteItem.svelte
  • src/components/StopItem.svelte
  • src/components/__tests__/RouteItem.test.js
  • src/components/containers/AccordionItem.svelte
  • src/components/map/StopMarker.svelte
  • src/components/navigation/Header.svelte
  • src/components/navigation/LanguageSwitcher/LanguageSwitcher.svelte
  • src/components/navigation/OverflowMenu.svelte
  • src/components/notification/Toast.svelte
  • src/components/search/SearchField.svelte
  • src/components/search/SearchPane.svelte
  • src/components/stops/__tests__/StopItem.test.js
  • src/components/trip-planner/ItineraryDetails.svelte
  • src/routes/+error.svelte
  • src/routes/+layout.svelte
  • vite.config.js
💤 Files with no reviewable changes (1)
  • postcss.config.js

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Tailwind CSS 4 migration

Layer / File(s) Summary
Tailwind CSS 4 build and theme setup
package.json, vite.config.js, src/app.css, src/components/map/StopMarker.svelte
Tailwind CSS 4 replaces Tailwind CSS 3. Vite now loads the Tailwind plugin. Global CSS uses the new import and dark variant syntax.
Tailwind utility syntax migration
src/components/FullPageLoadingSpinner.svelte, src/components/RouteBadge.svelte, docs/superpowers/..., src/components/containers/AccordionItem.svelte, src/components/navigation/..., src/components/notification/Toast.svelte, src/components/search/SearchField.svelte, src/components/trip-planner/ItineraryDetails.svelte, src/routes/...
Components and related documentation replace changed Tailwind utility forms for gradients, wrapping, positioning, z-index, and growth behavior.
Theme-aware component updates
src/components/RouteItem.svelte, src/components/StopItem.svelte, src/components/search/SearchPane.svelte, src/components/**/__tests__/*
Route and stop text styles use updated theme utilities. Search pane dark background placement changes. Matching test assertions are updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 26a40

This dependency and build-tooling upgrade has no actionable merge-blocking risk remaining based on the supplied evidence and is merge-ready after normal checks and review.

Suggested reviewers: aaronbrethorst, ahmedhossamdev

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: upgrading the project from Tailwind CSS v3 to v4.
Linked Issues check ✅ Passed The changes address issue #353 through Tailwind v4 tooling, plugin cleanup, CSS migration, configuration retention, and utility updates.
Out of Scope Changes check ✅ Passed All listed changes support the Tailwind CSS v4 migration or its required compatibility and styling updates.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/tailwind-v4

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

flowbite-svelte-icons@1.6.2 peers tailwindcss ^3.3.2, which breaks
plain npm install on Tailwind v4. The package is not imported anywhere.
@tarunsinghofficial
tarunsinghofficial marked this pull request as ready for review August 23, 2026 07:21
maplibre-gl pulls @mapbox/jsonlint-lines-primitives@2.0.3, which
requires Node >=22. With engine-strict, npm install fails on CI
(Node 18 lint / Node 20 test). Override to 2.0.2.
Tailwind v4 pulls @tailwindcss/oxide, which requires Node >=20.
@coveralls

coveralls commented Aug 23, 2026

Copy link
Copy Markdown

Coverage Status

Coverage is 93.106%feat/tailwind-v4 into develop. No base build found for develop.

0.8.1 crashes with "a.startsWith is not a function" on non-Svelte
files, making prettier --check exit 2 (lint fails in CI). 0.6.14
still sorts Tailwind v4 classes. Reformat affected files.
Import Flowbite components from subpath exports instead of the package
barrel, and rewrite internal barrel imports in vite.config.js. Prevents
Vite SSR crash after dependency re-optimization on Tailwind v4.
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.

Upgrade from Tailwind CSS v3 to v4

2 participants