Open
Description
Often partials use a param called class
and are nested. In that case, I don't want to use the parent class
data in a nested partial that doesn't receive class
itself:
{{# The parent partial receives a class. #}}
{{ partial:parent class="some-class" }}
{{#
@name Parent
@param class Custom CSS classes.
#}}
{{# No class passed to the child. #}}
<div :$class>
{{ partial:child }}
</div>
{{#
@name Child
@param class Custom CSS classes.
#}}
{{# Since class is null, the Cascade would look upwards until it finds class data. #}}
<div :$class>
I am a child.
</div>
My solution here was to use view:class
. The nested partial doesn't receive the parent's class data anymore. I don't know if this is the intended use case (besides that).
I would either add this as a "best practice" (like in the linked docs article) to the Data Inheritance docs page or another solution that might be better.
Metadata
Metadata
Assignees
Labels
No labels