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

Installation should assume Tailwind CSS v4 #463

Closed
Tracked by #462
flavorjones opened this issue Jan 23, 2025 · 5 comments · Fixed by #464
Closed
Tracked by #462

Installation should assume Tailwind CSS v4 #463

flavorjones opened this issue Jan 23, 2025 · 5 comments · Fixed by #464

Comments

@flavorjones
Copy link
Member

flavorjones commented Jan 23, 2025

When running "rails tailwindcss:install", the resulting application does not apply styles with tailwindcss-ruby v4.0.0.

I think what needs to happen is:

  • bump dependency to tailwindcss-ruby ~> 4.0 in the gemspec
  • drop the config file and move it into application.tailwind.css
  • add anything that the @tailwindcss/upgrade@next injects into application.tailwind.css for any of our generated views
  • drop the Inter font (see Remove Inter font assets from inclusion in downstream projects #353)
  • bump the major version of this gem to v4 (a happy coincidence)
@flavorjones flavorjones changed the title we should fix this gem to install properly assuming tailwind css v4 is being run Installation should assume Tailwind CSS v4 Jan 23, 2025
@EricGusmao
Copy link
Contributor

@flavorjones You can assign me this one if you wish, i can solve it :)

@flavorjones
Copy link
Member Author

flavorjones commented Jan 23, 2025

@EricGusmao thanks for offering. If you want to start a PR that would be great. I'm also working on one because I have some learning to do, but if you know what you're doing I would appreciate the help.

(Please don't bump the gem version in the PR though.)

@EricGusmao
Copy link
Contributor

@flavorjones ok, I'm going to start working on it right now. I also added some observations I discovered at #450

@drale2k
Copy link

drale2k commented Jan 23, 2025

Hi guys,

is there already an upgrade path to v4? I tried running the upgrade script manually but it errors out:

npx @tailwindcss/upgrade@next --config config/tailwind.config.js


 Searching for CSS files in the current directory and its subdirectories… 

│ ↳ Failed to resolve import: `tailwindcss` in `./application.tailwind.css`. Skipping. 

│ ↳ Linked `./config/tailwind.config.js` to `./app/assets/stylesheets/application.tailwind.css` 

│ Migrating JavaScript configuration files… 

│ ↳ Could not load the configuration file: Cannot find module 'tailwindcss/defaultTheme' 
│   Require stack: 
│   - /Users/myfolder/data/code/config/tailwind.config.js 

It seems to have an issue with defaultTheme coming from my tailwind config which i believe is default.

const defaultTheme = require('tailwindcss/defaultTheme')

module.exports = {
  content: [
    './public/*.html',
    './app/helpers/**/*.rb',
    './app/javascript/**/*.js',
    './app/views/**/*.{erb,haml,html,slim}'
  ],
  theme: {
    extend: {
      fontFamily: {
        sans: ['Inter', ...defaultTheme.fontFamily.sans]
      },
      colors: {
        tertiary: '#737373'
      }
    }
  },
  plugins: [
    ... list here
  ]
}

Should i open a separate issue for this?

@EricGusmao
Copy link
Contributor

EricGusmao commented Jan 23, 2025

Hi @drale2k! Please, go to #450 for help, questions, and discussion. As @flavorjones mentioned in #462 (comment). Thank you!

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

Successfully merging a pull request may close this issue.

3 participants