Skip to content

Commit 8a8ce36

Browse files
committed
Remove scaffolds styles on install
This stylesheet will interfere with Tailwind's reset of base styles.
1 parent 9363025 commit 8a8ce36

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
@@ -3,6 +3,9 @@
33
if APPLICATION_LAYOUT_PATH.exist?
44
say "Add Tailwindcss include tags in application layout"
55
insert_into_file Rails.root.join("app/views/layouts/application.html.erb").to_s, %(\n <%= stylesheet_link_tag "inter-font" %>\n <%= stylesheet_link_tag "tailwind" %>), before: /^\s*<%= stylesheet_link_tag/
6+
7+
say "Removing scaffold styles"
8+
remove_file Rails.root.join("app/assets/stylesheets/scaffolds.scss")
69
else
710
say "Default application.html.erb is missing!", :red
811
say %( Add <%= stylesheet_link_tag "inter-font" %> and <%= stylesheet_link_tag "tailwind" %> within the <head> tag in your custom layout.)

0 commit comments

Comments
 (0)