yarn add tailwindcss@^3.4.1
package.json Resolutions{
// keep previous keys as it was
"resolutions": {
"strip-ansi": "^6.0.1",
"string-width": "^4.2.2"
}
}
mkdir -p ./app/javascript/stylesheets/
npx tailwindcss init -p
Replace content in tailwind.config.js:
module.exports = {
important: true,
content: ["./app/javascript/**/*.{js,jsx}", "./app/views/**/*.html.erb"],
};
touch ./app/javascript/stylesheets/application.scss
Append to application.scss:
@tailwind base;
@tailwind components;
@tailwind utilities;
OR run the command:
touch ./app/javascript/stylesheets/application.scss # creates the file
cat <<EOT >> ./app/javascript/stylesheets/application.scss
@tailwind base;
@tailwind components;
@tailwind utilities;
EOT
application.jsManually append:
import "../stylesheets/application.scss"