Skip to content

Commit 462c147

Browse files
committed
Switch to tailwindcss-ruby external pipeline
Replace middleman-tailwind with tailwindcss-ruby and run Tailwind via an external_pipeline in config.rb. Add 'ostruct' for Ruby 4.0+. Remove the checked-in compiled site.css and tailwind.config.js and ignore source/stylesheets/site.css.
1 parent 11cb183 commit 462c147

File tree

7 files changed

+22
-1321
lines changed

7 files changed

+22
-1321
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
.DS_Store
44
build/
55
.tmp/
6+
source/stylesheets/site.css

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
source 'https://rubygems.org'
22

3+
gem 'ostruct' # Required for Ruby 4.0+
4+
35
gem 'middleman'
46
gem 'middleman-favicon-maker'
57

68
gem 'middleman-inline_svg'
79
gem 'middleman-livereload'
810
gem 'middleman-robots'
9-
gem 'middleman-tailwind', github: 'teaforthecat/middleman-tailwind', branch: 'upgrade-execs-to-3.4.1'
11+
gem 'tailwindcss-ruby'

Gemfile.lock

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
GIT
2-
remote: https://github.com/teaforthecat/middleman-tailwind.git
3-
revision: bd6452cd9ed79a821943ef35e8f8e866ca2bc6eb
4-
branch: upgrade-execs-to-3.4.1
5-
specs:
6-
middleman-tailwind (1.1.0)
7-
middleman-core (>= 4.0.0)
8-
91
GEM
102
remote: https://rubygems.org/
113
specs:
@@ -119,6 +111,7 @@ GEM
119111
nokogiri (1.19.0)
120112
mini_portile2 (~> 2.8.2)
121113
racc (~> 1.4)
114+
ostruct (0.6.3)
122115
padrino-helpers (0.15.3)
123116
i18n (>= 0.6.7, < 2)
124117
padrino-support (= 0.15.3)
@@ -142,6 +135,8 @@ GEM
142135
ffi (~> 1.9)
143136
securerandom (0.4.1)
144137
servolux (0.13.0)
138+
tailwindcss-ruby (4.1.18)
139+
tailwindcss-ruby (4.1.18-arm64-darwin)
145140
temple (0.10.4)
146141
thor (1.5.0)
147142
tilt (2.7.0)
@@ -155,6 +150,7 @@ GEM
155150
webrick (1.9.2)
156151

157152
PLATFORMS
153+
arm64-darwin-25
158154
ruby
159155

160156
DEPENDENCIES
@@ -163,7 +159,8 @@ DEPENDENCIES
163159
middleman-inline_svg
164160
middleman-livereload
165161
middleman-robots
166-
middleman-tailwind!
162+
ostruct
163+
tailwindcss-ruby
167164

168165
BUNDLED WITH
169166
2.7.2

config.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
# https://middlemanapp.com/advanced/configuration/#environment-specific-settings
66
set :url_root, @app.data.site.host
77

8-
activate :tailwind do |config|
9-
config.destination_path = 'source/stylesheets/site.css'
10-
config.css_path = 'source/stylesheets/tailwind.css'
11-
config.config_path = 'tailwind.config.js'
12-
end
8+
activate :external_pipeline,
9+
name: :tailwindcss,
10+
command: build? ? 'tailwindcss -i source/stylesheets/tailwind.css -o source/stylesheets/site.css --minify' : 'tailwindcss -i source/stylesheets/tailwind.css -o source/stylesheets/site.css --watch',
11+
source: 'source',
12+
latency: 1
1313
activate :livereload
1414
activate :i18n,
1515
mount_at_root: :en,

0 commit comments

Comments
 (0)