'Tailwindcss 3 with Angular 13 - new styles don't show after ctrl+s livereaload
I am using Tailwindcss 3 with Angular 13. When I apply new class (for example bg-cyan-500) the style is not added into final .css file and the change is not visible. I have to kill the "ng serve" command and re-run it. After I re-run "ng serve" command everything works fine. But it impossible to rerun "ng serve" with every css change I made.
Solution 1:[1]
Solution 2:[2]
Add this to tailwind.config.js
module.exports = {
content: ["./src/**/*.{html,ts}"],
}
Also create a postcss.config.js in the root of your project and paste this
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
}
}
This is for Angular 13 and Tailwind 3
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Guillermo |
Solution 2 | okuja |