How to install TailwindCSS 2 on Rails 6

TailwindCSS v2.0 was released on 19 November 2020 🎉, but it had a few changes that requires some tweak to install and use it on Rails 6, such as the requirement of PostCSS 8 and Webpack 5. As of current (10 December 2020), Rails 6 comes with webpack 4 and PostCSS 7, which doesn’t match the requirement of TailwindCSS v2.If we install TailwindCSS v2 directly on a Rails 6 app using yarn add tailwindcss, we might get a error (PostCSS plugin tailwindcss requires PostCSS 8) like this when running the server :.
How to install TailwindCSS 2 on Rails 6 #ruby #rubydeveloper #rubyonrails #tailwindcss https://rubyonrails.ba/single/how-to-install-tailwindcss-2-on-rails-6

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles