Skip to content

Commit 1235694

Browse files
authored
Update README.md (#157)
Clarify that `cssbundling` isn't used if you run `rails new --css=tailwind` or `--css=dart`
1 parent 4f4c621 commit 1235694

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,16 @@ You must already have node and yarn installed on your system. You will also need
2222
1. Run `./bin/bundle add cssbundling-rails`
2323
2. Run `./bin/rails css:install:[tailwind|bootstrap|bulma|postcss|sass]`
2424

25-
Or, in Rails 7+, you can preconfigure your new application to use a specific bundler with `rails new myapp --css [tailwind|bootstrap|bulma|postcss|sass]`.
26-
25+
Or, in Rails 7+, you can preconfigure your new application to use `cssbundling-rails` for `bootstrap`, `bulma` or `postcss` with `rails new myapp --css [bootstrap|bulma|postcss]`.
2726

2827
## FAQ
2928

3029
### How does this compare to tailwindcss-rails and dartsass-rails?
3130

3231
If you're already relying on Node to process your JavaScript, this gem is the way to go. But if you're using [the default import map setup in Rails 7+](https://github.com/rails/importmap-rails/), you can avoid having to deal with Node at all by using the standalone versions of Tailwind CSS and Dart Sass that are available through [tailwindcss-rails](https://github.com/rails/tailwindcss-rails/) and [dartsass-rails](https://github.com/rails/dartsass-rails/). It's simpler, fewer moving parts, and still has all the functionality.
3332

33+
In Rails 7+, you can preconfigure your new application to use `tailwindcss-rails` and `dartsass-rails` with `rails new myapp --css [tailwind|sass]`.
34+
3435
### How do I import relative CSS files with Tailwind?
3536

3637
If you want to use `@import` statements as part of your Tailwind application.js file, you need to [configure Tailwind to use `postcss` and then `postcss-import`](https://tailwindcss.com/docs/using-with-preprocessors#build-time-imports). But you should also consider simply referring to your other CSS files directly, instead of bundling them all into one big file. It's better for caching, and it's simpler to setup. You can refer to other CSS files by expanding the `stylesheet_link_tag` in `application.html.erb` like so: `<%= stylesheet_link_tag "application", "other", "styles", "data-turbo-track": "reload" %>`.

0 commit comments

Comments
 (0)