Skip to content

How do you handle component CSS and Interactivity? #534

Answered by joeldrapper
dscataglini asked this question in Help
Discussion options

You must be logged in to vote

One option is to use CSS frameworks like UnoCSS or Tailwind and JavaScript frameworks like Stimulus or Alpine that allow you to do most of this in your HTML.

Another option is to use the Evil Martians approach, where you keep your CSS and JavaScript in the same folder as the component. They wrote about how they do this with ViewComponent components, but it’s all applicable to Phlex. https://evilmartians.com/chronicles/viewcomponent-in-the-wild-supercharging-your-components

Others have built extensions on Phlex to support CSS Modules. I think @joelmoss has been working on something like this.

It's not something I see Phlex addressing directly in the near future. One thing I am keeping an e…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dscataglini
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants