Skip to content

Commit 3d7cd5a

Browse files
author
David Heinemeier Hansson
committed
Turn off stylesheet generation by default
1 parent 7aa8805 commit 3d7cd5a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ When run on an app using the just the asset pipeline, the last step adds the pur
1818

1919
You can do these things yourself, if you've changed the default setup.
2020

21-
Note: You should ensure to delete `app/assets/stylesheets/scaffold.scss` that Rails adds after running a scaffold command. This stylesheet will interfere with Tailwind's reset of base styles.
21+
Note: You should ensure to delete `app/assets/stylesheets/scaffold.scss` that Rails adds after running a scaffold command, if you had run this generator before installing Tailwind CSS for Rails. This stylesheet will interfere with Tailwind's reset of base styles. This gem will turn off stylesheet generation for all future scaffold runs.
2222

2323
When run on an app using Webpacker, the last step adds the npm dependencies for Tailwind CSS, configures postCSS, and generates a app/javascript/stylesheets/application.scss file as the default for using Tailwind.
2424

lib/tailwindcss/engine.rb

+4
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ class Engine < ::Rails::Engine
1010
Rails.application.config.assets.precompile += %w( tailwind.css inter-font.css )
1111
end
1212

13+
initializer "tailwindcss.disable_generator_stylesheets" do
14+
Rails.application.config.generators.stylesheets = false
15+
end
16+
1317
initializer "tailwindcss.disable_assets_cache" do
1418
Rails.application.config.assets.configure do |env|
1519
env.cache = ActiveSupport::Cache.lookup_store(:null_store)

0 commit comments

Comments
 (0)