Skip to content

doc: Add to v3-v4 upgrade guide about custom css files #486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ First, update to `tailwindcss-rails` v4.0.0 or higher. This will also ensure you
gem "tailwindcss-rails", "~> 4.0" # which transitively pins tailwindcss-ruby to v4
```

**Update** references to any existing css files imported in `application.tailwind.css`
```diff
-@import "pagy.css";
+@import "../stylesheets/pagy.css";
```

If you want to migrate CSS class names for v4 (this is an optional step!), jump to [Updating CSS class names for v4](#updating-css-class-names-for-v4) before continuing.

Then, run `bin/rails tailwindcss:upgrade`. Among other things, this will try to run the official Tailwind upgrade utility. It requires `npx` in order to run, but it's a one-time operation and is *highly recommended* for a successful upgrade.
Expand Down Expand Up @@ -232,7 +238,6 @@ Then, once you've run that successfully, clean up:
```
- **Revert** the changes to `config/tailwind.config.js` so that paths are once again relative to the application root.


## Developing with Tailwindcss

### Configuration and commands
Expand Down