Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tailwind CSS v4 support #163

Open
justalever opened this issue Jan 23, 2025 · 1 comment
Open

Tailwind CSS v4 support #163

justalever opened this issue Jan 23, 2025 · 1 comment

Comments

@justalever
Copy link

justalever commented Jan 23, 2025

Running rails new my_app -c tailwind results in the following for me (rails 8.0.1 / ruby 3.4.1):

Add build:css script
  Add build:css script
         run    npm pkg set scripts.build:css="tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify" from "."
         run    yarn build:css from "."
yarn run v1.22.22
$ tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify
rbenv: tailwindcss: command not found

The `tailwindcss' command exists in these Ruby versions:
  3.3.3

error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
         run  bundle install --quiet
         run  bundle binstubs kamal
         run  bundle exec kamal init
Created configuration file in config/deploy.yml
Created .kamal/secrets file
Created sample hooks in .kamal/hooks
       force  .kamal/secrets
       force  config/deploy.yml
       rails  solid_cache:install solid_queue:install solid_cable:install
      create  config/cache.yml
      create  db/cache_schema.rb
        gsub  config/environments/production.rb
      create  config/queue.yml
      create  config/recurring.yml
      create  db/queue_schema.rb
      create  bin/jobs
        gsub  config/environments/production.rb
      create  db/cable_schema.rb
       force  config/cable.yml

It looks like there are a few things to update to get full v4 support:

  • Ditch the tailwind.config.js file
  • Update build:css script and dependencies (unsure if it should be the Tailwind CLI or PostCSS?)
  • update @import statements in application.tailwind.css
@BarnabeD
Copy link

Yesterday I upgraded my rails app which is running on rails main.
I had several issues with yarn in local + in kamal deployment

I solved everything by adding simply add the two gems in my gem file.

gem "tailwindcss-ruby"
gem "tailwindcss-rails"

tagliala added a commit to activeadmin/activeadmin that referenced this issue Jan 26, 2025
On Rails 7.0, lock concurrent-ruby to 1.3.4 to address rails/rails#54260

Rails 7.0 bundle has been updated with 3.3.x:

```
rvm use 3.3.6 do bash -c "BUNDLE_GEMFILE=gemfiles/rails_70/Gemfile bundle update"
```

Additionally, add a workaround to make sure that the test application
uses Tailwind v3. The current cssbundling-rails approach 

Close #8611

Ref: rails/cssbundling-rails#163
tagliala added a commit to activeadmin/activeadmin that referenced this issue Jan 26, 2025
On Rails 7.0, lock concurrent-ruby to 1.3.4 to address rails/rails#54260

Rails 7.0 bundle has been updated with 3.3.x:

```
rvm use 3.3.6 do bash -c "BUNDLE_GEMFILE=gemfiles/rails_70/Gemfile bundle update"
```

Additionally, add a workaround to make sure that the test application
uses Tailwind v3. The current cssbundling-rails approach 

Close #8611

Ref: rails/cssbundling-rails#163
tagliala added a commit to activeadmin/activeadmin that referenced this issue Jan 26, 2025
On Rails 7.0, lock concurrent-ruby to 1.3.4 to address rails/rails#54260

Rails 7.0 bundle has been updated with 3.3.x:

```
rvm use 3.3.6 do bash -c "BUNDLE_GEMFILE=gemfiles/rails_70/Gemfile bundle update"
```

Additionally, add a workaround to make sure that the test application
uses Tailwind v3. The current cssbundling-rails approach 

Close #8611

Ref: rails/cssbundling-rails#163
tagliala added a commit to activeadmin/activeadmin that referenced this issue Jan 26, 2025
On Rails 7.0, lock concurrent-ruby to 1.3.4 to address rails/rails#54260

Rails 7.0 bundle has been updated with 3.3.x:

```
rvm use 3.3.6 do bash -c "BUNDLE_GEMFILE=gemfiles/rails_70/Gemfile bundle update"
```

Additionally, add a workaround to make sure that the test application
uses Tailwind v3. The current cssbundling-rails approach 

Close #8611

Ref: rails/cssbundling-rails#163
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants