odoo / owl

OWL: A web framework for structured, dynamic and maintainable applications
https://odoo.github.io/owl/
Other
1.11k stars 334 forks source link

add t-class directive? #1546

Open ged-odoo opened 9 months ago

ged-odoo commented 9 months ago

Being able to specify a css class for the root element of a child component is very useful. We removed it going from owl 1 to owl 2 because it could not really be implemented properly in a generic way, and also, because it couples the implementation of the component with its use. However, i am starting to think that all these class, root or className props are not really much better. What if we allow adding classes to the root element, and it throws error if there is a branching?

<div>
  <Child t-class="hello"/>
</div>

Even if we decide that the given class is purely static, it could be useful.