In my my-dropdown
component in Stencil, I have this:
<slot name="filter" />
In my HTML, I have this:
<my-dropdown label="dropdown" size="m" filter="true">
<select slot="filter" class="inf__dropdown-select">
<option>One</option>
<option>Two</option>
<option>Three</option>
</select>
</my-dropdown>
The class inf__dropdown-select
is defined in the stylesheet of the component, and it used to be applied to the select
element inside the component.tsx, but since I need to slot it now, I replaced the select
element with a single <slot name="filter" />
slot, but now I don't know how do I apply the class? If I add the class to the slot
inside the component, it's not being
applied. I thought adding it to the element that you are slotting would work, but it doesn't. How do I make sure the class is applied to the slotted select
element?