Skip to content

Commit f628941

Browse files
author
David Heinemeier Hansson
authored
Merge pull request #65 from dixpac/dix/remove_scaffolds_css
Remove scaffolds styles on install
2 parents e973971 + acf0059 commit f628941

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

README.md

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ The last step adds the purger compressor to `config/environments/production.rb`.
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/scaffolds.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.
22-
2321

2422
## Purging in production
2523

lib/install/tailwindcss.rb

+3
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,8 @@
88
say %( Add <%= stylesheet_link_tag "inter-font" %> and <%= stylesheet_link_tag "tailwind" %> within the <head> tag in your custom layout.)
99
end
1010

11+
say "Removing scaffold styles"
12+
remove_file Rails.root.join("app/assets/stylesheets/scaffolds.scss")
13+
1114
say "Turn on purging of unused css classes in production"
1215
gsub_file Rails.root.join("config/environments/production.rb"), /^\s+#?\s+config.assets.css_compressor =.*$/, %( config.assets.css_compressor = :purger)

0 commit comments

Comments
 (0)