phoenixframework / phoenix

Peace of mind from prototype to production
https://www.phoenixframework.org
MIT License
21.45k stars 2.88k forks source link

Allowing custom classes on some core components #5887

Closed ThiagoMonaco closed 3 months ago

ThiagoMonaco commented 3 months ago

This changes allow custom classes in some core components provided by Phoenix (#5886)

chrismccord commented 3 months ago

This is actually not something we want to promote as a general pattern. It's fine in your app here and there, but the issue is the precedence of the classes passed by the caller cannot be trusted. If the caller is trying to override or accidentally shadows an existing class, it's mostly a complete guess on which classes apply. This is because the css precedence actually users the order the class appears in the stylesheet. For customizing higher level components, what you really want is something like a variant system. Thanks!