File tree 3 files changed +21
-3
lines changed
3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change 1
1
## next / unreleased
2
2
3
- * Add experimental support for Tailwind CSS v4. (#420 ) @flavorjones
3
+ * Add experimental support for Tailwind CSS v4. (#420 , # 423 ) @flavorjones
4
4
5
5
6
6
## v3.0.0
Original file line number Diff line number Diff line change @@ -10,12 +10,12 @@ def tailwindcss_version
10
10
def compile_command ( debug : false , **kwargs )
11
11
command = [
12
12
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 ,
14
15
]
15
16
16
17
unless tailwindcss_version >= "4.0"
17
18
command += [
18
- "-i" , Rails . root . join ( "app/assets/stylesheets/application.tailwind.css" ) . to_s ,
19
19
"-c" , Rails . root . join ( "config/tailwind.config.js" ) . to_s ,
20
20
]
21
21
end
Original file line number Diff line number Diff line change @@ -32,6 +32,12 @@ bundle install
32
32
bundle show --paths
33
33
bundle binstubs --all
34
34
35
+ if bundle show | fgrep tailwindcss-ruby | fgrep -q " (4." ; then
36
+ TAILWIND4=1
37
+ else
38
+ TAILWIND4=0
39
+ fi
40
+
35
41
# install tailwindcss
36
42
bin/rails tailwindcss:install
37
43
@@ -45,6 +51,13 @@ task :still_here do
45
51
end
46
52
EOF
47
53
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
+
48
61
bin/rails tailwindcss:build still_here | grep " Rake process did not exit early"
49
62
50
63
if [[ $( rails -v) > " Rails 8.0.0.beta" ]] ; then
@@ -61,4 +74,9 @@ grep -q "Show this post" app/views/posts/index.html.erb
61
74
bin/rails tailwindcss:build[verbose]
62
75
grep -q " py-2" app/assets/builds/tailwind.css
63
76
77
+ if [[ $TAILWIND4 = 1 ]] ; then
78
+ # TEST: contents include application.tailwind.css
79
+ grep -q " #abc12399" app/assets/builds/tailwind.css
80
+ fi
81
+
64
82
echo " OK"
You can’t perform that action at this time.
0 commit comments