<!-- my-poly -->
<template>
<content select=".useBtn">
<button id="defaultBtn">
<content select=".useBtnIcon">
Button
</content>
</button>
</content>
</template>
So if my Element gets used, the User can input a Button which will be shown instead of the defaultBtn
. But if no Button is given, the defaultBtn
with the Button Text will be shown. But the user also should have the Option to use the defaultBtn
and to input a text or icon which will be shown in the Button.
If I use a <div class="useBtn"></div>
it will be used as the Button. But <div class="useBtnIcon"> BtnText</div>
does not seem to work. Is there a way to make this work?
According to the spec its not going to work.
http://www.w3.org/TR/shadow-dom/#content-insertion-points
With this in mind, i guess, you cant make this thing work with nestetd content elements.
This one will work. Custom Icon wins if both are applied