Is it possible to use TailwindCSS in custom cards? I could not find anything related to it nor anyone using it.
I tried to do it by myself and managed to get the custom element working in a simple test:
But when loading the card in home assistant, the styles are not applied:
First i thought that the problem was Home Assistant not loading the CSS, but now i’m injecting the CSS into the final JS with Vite. It is working, but not on Home Assistant.
You can read the code i made for the tests here: usernein/tailwindcss-in-hass
I did it using Preact, TypeScript, Vite, TailwindCSS and PostCSS