Skip to content

Commit 768594a

Browse files
committed
Remove tailwind.config.js from the generator
Tailwind v4 doesn't need a config file.
1 parent 2895fc9 commit 768594a

File tree

7 files changed

+7
-63
lines changed

7 files changed

+7
-63
lines changed

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,9 @@ You can also use a local (npm-based) installation if you prefer, please go to ht
5959

6060
### Configuration and commands
6161

62-
#### Configuration file: `config/tailwind.config.js`
63-
64-
You can customize the Tailwind build through the `config/tailwind.config.js` file, just like you would if Tailwind was running in a traditional node installation. All the first-party plugins are supported.
65-
6662
#### Input file: `app/assets/stylesheets/application.tailwind.css`
6763

68-
The installer will generate a Tailwind input file in `app/assets/stylesheets/application.tailwind.css`. This is where you import the plugins you want to use, and where you can setup your custom `@apply` rules.
64+
The installer will generate a Tailwind input file in `app/assets/stylesheets/application.tailwind.css`. This is where you import the plugins you want to use and where you can setup your custom `@apply` rules.
6965

7066
#### Output file: `app/assets/builds/tailwind.css`
7167

lib/install/application.tailwind.css

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1 @@
1-
@tailwind base;
2-
@tailwind components;
3-
@tailwind utilities;
4-
5-
/*
6-
7-
@layer components {
8-
.btn-primary {
9-
@apply py-2 px-4 bg-blue-200;
10-
}
11-
}
12-
13-
*/
1+
@import "tailwindcss";

lib/install/tailwind.config.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

lib/install/tailwindcss.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@
2828
append_to_file(".gitignore", %(\n/app/assets/builds/*\n!/app/assets/builds/.keep\n))
2929
end
3030

31-
unless Rails.root.join("config/tailwind.config.js").exist?
32-
say "Add default config/tailwindcss.config.js"
33-
copy_file "#{__dir__}/tailwind.config.js", "config/tailwind.config.js"
34-
end
35-
3631
unless Rails.root.join("app/assets/stylesheets/application.tailwind.css").exist?
3732
say "Add default app/assets/stylesheets/application.tailwind.css"
3833
copy_file "#{__dir__}/application.tailwind.css", "app/assets/stylesheets/application.tailwind.css"

lib/tailwindcss/commands.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ def compile_command(debug: false, **kwargs)
1010
Tailwindcss::Ruby.executable(**kwargs),
1111
"-i", rails_root.join("app/assets/stylesheets/application.tailwind.css").to_s,
1212
"-o", rails_root.join("app/assets/builds/tailwind.css").to_s,
13-
"-c", rails_root.join("config/tailwind.config.js").to_s,
1413
]
1514

1615
command << "--minify" unless (debug || rails_css_compressor?)

test/integration/user_journey_test.sh

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ set -eux
99
rm -f Gemfile.lock
1010
bundle remove actionmailer
1111
bundle add rails --skip-install ${RAILSOPTS:-}
12-
bundle install
12+
bundle install --prefer-local
1313

1414
# do our work a directory with spaces in the name (#176, #184)
1515
rm -rf "My Workspace"
@@ -27,16 +27,10 @@ bundle add rails --skip-install ${RAILSOPTS:-}
2727

2828
# use the tailwindcss-rails under test
2929
bundle add tailwindcss-rails --skip-install --path="../.."
30-
bundle install
30+
bundle install --prefer-local
3131
bundle show --paths
3232
bundle binstubs --all
3333

34-
if bundle show | fgrep tailwindcss-ruby | fgrep -q "(4." ; then
35-
TAILWIND4=1
36-
else
37-
TAILWIND4=0
38-
fi
39-
4034
# install tailwindcss
4135
bin/rails tailwindcss:install
4236

@@ -50,12 +44,9 @@ task :still_here do
5044
end
5145
EOF
5246

53-
if [[ $TAILWIND4 = 1 ]] ; then
54-
cat > app/assets/stylesheets/application.tailwind.css <<EOF
55-
@import "tailwindcss";
47+
cat >> app/assets/stylesheets/application.tailwind.css <<EOF
5648
@theme { --color-special: #abc12399; }
5749
EOF
58-
fi
5950

6051
bin/rails tailwindcss:build still_here | grep "Rake process did not exit early"
6152

@@ -73,9 +64,7 @@ grep -q "Show this post" app/views/posts/index.html.erb
7364
bin/rails tailwindcss:build[verbose]
7465
grep -q "py-2" app/assets/builds/tailwind.css
7566

76-
if [[ $TAILWIND4 = 1 ]] ; then
77-
# TEST: contents include application.tailwind.css
78-
grep -q "#abc12399" app/assets/builds/tailwind.css
79-
fi
67+
# TEST: contents include application.tailwind.css
68+
grep -q "#abc12399" app/assets/builds/tailwind.css
8069

8170
echo "OK"

test/lib/tailwindcss/commands_test.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def setup
1515
assert_kind_of(Array, actual)
1616
assert_equal(executable, actual.first)
1717
assert_includes(actual, "-i")
18-
assert_includes(actual, "-c")
1918
assert_includes(actual, "-o")
2019
end
2120
end

0 commit comments

Comments
 (0)