|
14 | 14 | * [Upgrade steps](#upgrade-steps) |
15 | 15 | * [Troubleshooting a v4 upgrade](#troubleshooting-a-v4-upgrade) |
16 | 16 | * [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) |
18 | 18 | * [Configuration and commands](#configuration-and-commands) |
19 | 19 | * [Building for production](#building-for-production) |
20 | 20 | * [Building for testing](#building-for-testing) |
@@ -44,7 +44,7 @@ With Rails 7 you can generate a new application preconfigured with Tailwind CSS |
44 | 44 | 1. Run `./bin/bundle add tailwindcss-rails` |
45 | 45 | 2. Run `./bin/rails tailwindcss:install` |
46 | 46 |
|
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. |
48 | 48 |
|
49 | 49 | ### Choosing a specific version of `tailwindcss` |
50 | 50 |
|
@@ -239,7 +239,7 @@ Then, once you've run that successfully, clean up: |
239 | 239 | ``` |
240 | 240 | - **Revert** the changes to `config/tailwind.config.js` so that paths are once again relative to the application root. |
241 | 241 |
|
242 | | -## Developing with Tailwindcss |
| 242 | +## Developing with TailwindCSS |
243 | 243 |
|
244 | 244 | ### Configuration and commands |
245 | 245 |
|
@@ -355,35 +355,12 @@ Than use `@plugin` annotation in `app/assets/tailwind/application.css`: |
355 | 355 |
|
356 | 356 | ### Using with PostCSS |
357 | 357 |
|
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). |
385 | 362 |
|
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). |
387 | 364 |
|
388 | 365 | ### Custom inputs or outputs |
389 | 366 |
|
|
0 commit comments