Skip to content

Commit 747d0a7

Browse files
committed
Unbreak support for v4 input file.
Reverts part of 6e828eb but adds to test coverage now that I understand the other changes v4 requires.
1 parent 0f282e2 commit 747d0a7

File tree

3 files changed

+21
-3
lines changed

3 files changed

+21
-3
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## next / unreleased
22

3-
* Add experimental support for Tailwind CSS v4. (#420) @flavorjones
3+
* Add experimental support for Tailwind CSS v4. (#420, #423) @flavorjones
44

55

66
## v3.0.0

lib/tailwindcss/commands.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ def tailwindcss_version
1010
def compile_command(debug: false, **kwargs)
1111
command = [
1212
Tailwindcss::Ruby.executable(**kwargs),
13-
"-o", Rails.root.join("app/assets/builds/tailwind.css").to_s
13+
"-o", Rails.root.join("app/assets/builds/tailwind.css").to_s,
14+
"-i", Rails.root.join("app/assets/stylesheets/application.tailwind.css").to_s,
1415
]
1516

1617
unless tailwindcss_version >= "4.0"
1718
command += [
18-
"-i", Rails.root.join("app/assets/stylesheets/application.tailwind.css").to_s,
1919
"-c", Rails.root.join("config/tailwind.config.js").to_s,
2020
]
2121
end

test/integration/user_journey_test.sh

+18
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ bundle install
3232
bundle show --paths
3333
bundle binstubs --all
3434

35+
if bundle show | fgrep tailwindcss-ruby | fgrep -q "(4." ; then
36+
TAILWIND4=1
37+
else
38+
TAILWIND4=0
39+
fi
40+
3541
# install tailwindcss
3642
bin/rails tailwindcss:install
3743

@@ -45,6 +51,13 @@ task :still_here do
4551
end
4652
EOF
4753

54+
if [[ $TAILWIND4 = 1 ]] ; then
55+
cat > app/assets/stylesheets/application.tailwind.css <<EOF
56+
@import "tailwindcss";
57+
@theme { --color-special: #abc12399; }
58+
EOF
59+
fi
60+
4861
bin/rails tailwindcss:build still_here | grep "Rake process did not exit early"
4962

5063
if [[ $(rails -v) > "Rails 8.0.0.beta" ]] ; then
@@ -61,4 +74,9 @@ grep -q "Show this post" app/views/posts/index.html.erb
6174
bin/rails tailwindcss:build[verbose]
6275
grep -q "py-2" app/assets/builds/tailwind.css
6376

77+
if [[ $TAILWIND4 = 1 ]] ; then
78+
# TEST: contents include application.tailwind.css
79+
grep -q "#abc12399" app/assets/builds/tailwind.css
80+
fi
81+
6482
echo "OK"

0 commit comments

Comments
 (0)