Skip to content

Remove setting of tailwindcss as the default template_engine #131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,28 @@ With Rails 7 you can generate a new application preconfigured with Tailwind by u
1. Run `./bin/bundle add tailwindcss-rails`
2. Run `./bin/rails tailwindcss:install`

## Using the included TailwindCSS generator templates

Included are several pre-styled templates.

```
Tailwindcss:
tailwindcss:controller
tailwindcss:mailer
tailwindcss:scaffold
```

Simply prepend `tailwindcss:` to the generator type for some styling.

```
rails generate tailwindcss:scaffold Post title:string content:text
```
These templated styles have been set up with a container element in mind. This element is added to `views/layouts/application.html.erb` during the above install process.
```
<main class="container mx-auto mt-28 px-5 flex">
<%= yield %>
</main>
```

## Building in production

Expand Down
4 changes: 0 additions & 4 deletions lib/tailwindcss/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,5 @@ class Engine < ::Rails::Engine
initializer "tailwindcss.disable_generator_stylesheets" do
Rails.application.config.generators.stylesheets = false
end

config.app_generators do |g|
g.template_engine :tailwindcss
end
end
end