DEV Community

Discussion on: How to Setup Tailwind 3 on Rails 7

Collapse
 
software_writer profile image
Akshay Khot

Bryan, thank you for the comment.

You can add the forms plugin in the tailwind.config.js file as follows:

module.exports = {
  content: ["./app/**/*.{html,js,erb}"],
  theme: {
    extend: {},
  },
  plugins: [
    require('@tailwindcss/forms')
  ],
}
Enter fullscreen mode Exit fullscreen mode

Reference: Tailwind Plugins

Collapse
 
bryanbeshore profile image
Bryan Beshore

Aksahy, thank you for the reply.

For some reason, this does not seem to be working.

Added: npm install @tailwindcss/forms as well as the plugin and for some reason I cannot get this to work.

Starting a new project from scratch with a static#home controller... Not sure why this is not working.

Would love to leverage some of the (requires JS) components here: tailwindui.com/

Thread Thread
 
software_writer profile image
Akshay Khot

Hey Bryan,

Did you restart the Tailwind CLI build process after making changes to the tailwind.config.js file?

The @tailwindcss/forms plugin resets the default form styles to make it easier to style form elements with utility classes. So if you are not seeing any form styles, try adding some form utility classes and see if those show up.

Also, what specific error are you getting with the forms?

Thread Thread
 
bryanbeshore profile image
Bryan Beshore

Looks like restarting the Tailwind CLI build process made all the difference. Didn't realize that I needed to rerun that each time. Many thanks!

Thread Thread
 
software_writer profile image
Akshay Khot

Good to know that solved your issue. Glad to help 😀