- From: yuzhehan <notifications@github.com>
- Date: Fri, 06 Mar 2020 16:27:44 -0800
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Saturday, 7 March 2020 00:27:57 UTC
yuzhe-han commented on this pull request. > + <div slot=slot2></div> +</shadow-host> + ``` +Some people would see this as a kind of *ugly* markup. +Shadow DOM v1 can't explain how `<summary>/<details>` elements can be implemented on the top of the current Web Components technology stack, given that `<details>` element doesn't need slot= attribute. +Blink has a special logic for some built-in elements to control node-to-slot mapping. + +#### Case 2: Can’t slot based on condition. +``` +<shadow-host num-to-show=”2”> + <div slot=”slot1”></div> + <div slot=”slot1”></div> + <div slot=”slot1”></div> +</shadow-host> + ``` +The second issue is that component creators can’t change the slotting behavior based on condition. A component that wants to display a subset of slottable based on a property can’t easily be done via declarative slotting. Thanks for the suggested example. Updated my example to be a better case. Also added an example implementation to showcase the new API. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/webcomponents/pull/866#discussion_r389204290
Received on Saturday, 7 March 2020 00:27:57 UTC