Skip to content

Commit 32d4da0

Browse files
flavorjonesahmeij
andcommitted
doc: update README with caveats about postcss
Co-authored-by: Andre Meij <[email protected]>
1 parent 70d3a54 commit 32d4da0

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

Diff for: README.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Running `bin/dev` invokes Foreman to start both the Tailwind watch process and t
151151

152152
### Using with PostCSS
153153

154-
If you want to use PostCSS as a preprocessor, create a custom `config/postcss.config.js` and it will be loaded automatically.
154+
If you want to use PostCSS as a preprocessor, create a custom `config/postcss.config.js` and that file will be loaded by tailwind automatically.
155155

156156
For example, to enable nesting:
157157

@@ -167,6 +167,25 @@ module.exports = {
167167
}
168168
```
169169

170+
⚠ 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:
171+
172+
```json
173+
// package.json
174+
{
175+
"name": "my app",
176+
"private": true,
177+
"dependencies": {
178+
"postcss-advanced-variables": "^4.0.0",
179+
"postcss-import": "^16.0.1",
180+
"postcss-mixins": "^9.0.4",
181+
"tailwindcss": "^3.4.1"
182+
}
183+
}
184+
```
185+
186+
Then you can use yarn or npm to install the dependencies.
187+
188+
170189
### Custom inputs or outputs
171190

172191
If you need to use a custom input or output file, you can run `bundle exec tailwindcss` to access the platform-specific executable, and give it your own build options.

0 commit comments

Comments
 (0)