Skip to content

Commit c653267

Browse files
authored
Merge pull request #576 from thewatts/patch-1
Update README.md to add context around Tailwind 4 and PostCSS
2 parents 35958b5 + 6585718 commit c653267

File tree

1 file changed

+8
-31
lines changed

1 file changed

+8
-31
lines changed

README.md

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* [Upgrade steps](#upgrade-steps)
1515
* [Troubleshooting a v4 upgrade](#troubleshooting-a-v4-upgrade)
1616
* [Updating CSS class names for v4](#updating-css-class-names-for-v4)
17-
- [Developing with Tailwindcss](#developing-with-tailwindcss)
17+
- [Developing with TailwindCSS](#developing-with-tailwindcss)
1818
* [Configuration and commands](#configuration-and-commands)
1919
* [Building for production](#building-for-production)
2020
* [Building for testing](#building-for-testing)
@@ -44,7 +44,7 @@ With Rails 7 you can generate a new application preconfigured with Tailwind CSS
4444
1. Run `./bin/bundle add tailwindcss-rails`
4545
2. Run `./bin/rails tailwindcss:install`
4646

47-
This gem depends on the `tailwindcss-ruby` gem to install a working Tailwind CLI executable.
47+
This gem depends on the `tailwindcss-ruby` gem to install a working TailwindCSS CLI executable.
4848

4949
### Choosing a specific version of `tailwindcss`
5050

@@ -239,7 +239,7 @@ Then, once you've run that successfully, clean up:
239239
```
240240
- **Revert** the changes to `config/tailwind.config.js` so that paths are once again relative to the application root.
241241
242-
## Developing with Tailwindcss
242+
## Developing with TailwindCSS
243243
244244
### Configuration and commands
245245
@@ -355,35 +355,12 @@ Than use `@plugin` annotation in `app/assets/tailwind/application.css`:
355355
356356
### Using with PostCSS
357357
358-
If you want to use PostCSS as a preprocessor, create a custom `postcss.config.js` in your project root directory, and that file will be loaded by Tailwind automatically.
359-
360-
For example, to enable nesting:
361-
362-
```js
363-
// postcss.config.js
364-
export default {
365-
plugins: {
366-
"@tailwindcss/postcss": {},
367-
},
368-
};
369-
```
370-
371-
⚠ Note that PostCSS is a JavaScript tool with its own prerequisites! By default `tailwindcss-rails` does not require any JavaScript tooling, so in order to use PostCSS, a `package.json` with dependencies for your plugins and a package manager like `yarn` or `npm` is required, for example:
372-
373-
```json
374-
// package.json
375-
{
376-
"name": "my app",
377-
"private": true,
378-
"dependencies": {
379-
"@tailwindcss/postcss": "^4.0.0",
380-
"tailwindcss": "^4.0.0",
381-
"postcss": "^8.5.1"
382-
}
383-
}
384-
```
358+
> [!NOTE]
359+
> Starting with Tailwind v4, the upstream CLI tool no longer supports PostCSS, and the `--postcss` option has
360+
been removed. If you want to leverage PostCSS with Tailwind 3, please reference the [tailwindcss-rails v3
361+
README](https://github.com/rails/tailwindcss-rails/tree/v3-stable?tab=readme-ov-file#using-with-postcss).
385362
386-
Then you can use yarn or npm to install the dependencies.
363+
To leverage PostCSS with Tailwind 4, please reference [The official Tailwind 4 PostCSS docs](https://tailwindcss.com/docs/installation/using-postcss), and leverage [cssbundling-rails](https://github.com/rails/cssbundling-rails).
387364
388365
### Custom inputs or outputs
389366

0 commit comments

Comments
 (0)