Skip to content

Commit 45a182e

Browse files
authored
Add section about conflict with with asset pipeline
Add a paragraph to the Troubleshooting section about resolving a misconfiguration that otherwise causes double-processing of Tailwind's entry file, as described in issue #190.
1 parent 771d3ad commit 45a182e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: README.md

+6
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@ The inline version also works:
192192
<section class="bg-[url('image.svg')]">Has the image as it's background</section>
193193
```
194194

195+
### Conflict with pre-existing asset pipeline stylesheets
196+
197+
If you get a warning `Unrecognized at-rule or error parsing at-rule ‘@tailwind’.` in the browser console after installation, you incorrectly double-process `application.tailwind.css`. This is a misconfiguration, even though the styles will be fully effective in many cases. The file `application.tailwind.css` is installed when running `rails tailwindcss:install` and is placed alongside the common `application.css` in `app/assets/stylesheets`. Because the `application.css` in a newly generated Rails app includes a `require_tree .` directive, the asset pipeline incorrectly processes `application.tailwind.css`, where it should be taken care of by `tailwindcss`. The asset pipeline ignores TailwindCSS's at-directives, and the browser can't process them.
198+
199+
To fix the warning, you can either remove the `application.css`, if you don't plan to use the asset pipeline for stylesheets, and instead rely on TailwindCSS completely for styles. This is what this installer assumes. Else, if you do want to keep using the asset pipeline in parallel, make sure to remove the `require_tree .` line from the `application.css`.
200+
195201
## License
196202

197203
Tailwind for Rails is released under the [MIT License](https://opensource.org/licenses/MIT).

0 commit comments

Comments
 (0)