You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Custom inputs or outputs](#custom-inputs-or-outputs)
25
-
-[Troubleshooting](#troubleshooting-1)
26
+
-[Troubleshooting](#troubleshooting)
26
27
*[Lost keystrokes or hanging when using terminal-based debugging tools (e.g. IRB, Pry, `ruby/debug`...etc.) with the Puma plugin](#lost-keystrokes-or-hanging-when-using-terminal-based-debugging-tools-eg-irb-pry-rubydebugetc-with-the-puma-plugin)
27
28
*[Running in a docker container exits prematurely](#running-in-a-docker-container-exits-prematurely)
28
29
*[Conflict with sassc-rails](#conflict-with-sassc-rails)
@@ -171,7 +172,7 @@ Done in 56ms
171
172
If this doesn't succeed, it's likely that you've customized your Tailwind configuration and you'll need to do some work to make sure your application upgrades. Please read the [official upgrade guide](https://tailwindcss.com/docs/upgrade-guide) and try following the additional steps in [Updating CSS class names for v4](#updating-css-class-names-for-v4).
172
173
173
174
174
-
### Troubleshooting
175
+
### Troubleshooting a v4 upgrade
175
176
176
177
You may want to check out [TailwindCSS v4 - upgrade experience report · rails/tailwindcss-rails · Discussion #450](https://github.com/rails/tailwindcss-rails/discussions/450) if you're having trouble upgrading.
177
178
@@ -195,7 +196,7 @@ With some additional manual work the upstream upgrade tool will update your appl
195
196
/node_modules
196
197
```
197
198
198
-
**Create** a `package.json`in the root of the project:
199
+
**Create**or **update**a `package.json`in the root of the project:
199
200
200
201
```jsonc
201
202
{
@@ -232,7 +233,9 @@ With some additional manual work the upstream upgrade tool will update your appl
232
233
233
234
Then, once you've run that successfully, clean up:
234
235
235
-
- **Delete** `package.json`, `node_modules/` and `package-lock.json` (or `yarn.lock`), plus remove `/node_modules` from `.gitignore`.
236
+
- **Review** `package.json` to remove unnecessary modules.
237
+
- This includes modules added for the period of upgrade.
238
+
- If you don't need any modules besides `tailwindcss` itself, **delete**`package.json`, `node_modules/` and `package-lock.json` (or `yarn.lock`), plus remove `/node_modules` from `.gitignore`.
236
239
- **Go** to your CSS file and remove the following line (if present):
237
240
```css
238
241
@plugin '@tailwindcss/container-queries';
@@ -273,7 +276,6 @@ This gem also makes available a Puma plugin to manage a live rebuild process whe
273
276
274
277
This gem also generates a `Procfile.dev` file which will run both the rails server and a live rebuild process (see "Live Rebuild" section below).
275
278
276
-
277
279
### Building for production
278
280
279
281
The `tailwindcss:build` is automatically attached to `assets:precompile`, so before the asset pipeline digests the files, the Tailwind output will be generated.
@@ -331,6 +333,32 @@ If you are running `rails tailwindcss:watch` in a docker container without a tty
331
333
Running `bin/dev` invokes Foreman to start both the Tailwind watch process and the rails server in development mode based on your `Procfile.dev` file.
332
334
333
335
336
+
### Using Tailwind plugins
337
+
338
+
If you want to use Tailwind plugins, they can be installed using `package.json`.
339
+
340
+
Using Yarn:
341
+
342
+
``` sh
343
+
[ ! -f package.json ] && yarn init
344
+
yarn add daisyui # example
345
+
```
346
+
347
+
Using npm:
348
+
349
+
``` sh
350
+
npm init
351
+
npm add daisyui # example
352
+
```
353
+
354
+
Than use `@plugin` annotation in `app/assets/tailwind/application.css`:
355
+
356
+
``` css
357
+
@import "tailwindcss";
358
+
@plugin "daisyui";
359
+
```
360
+
361
+
334
362
### Using with PostCSS
335
363
336
364
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.
0 commit comments