8000 Targeted Slots - passing and mixing attributes and styles to component, access the slotted element from inside the component by lukaszpolowczyk · Pull Request #68 · sveltejs/rfcs · GitHub
[go: up one dir, main page]

Skip to content
8000

Targeted Slots - passing and mixing attributes and styles to component, access the slotted element from inside the component #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 20 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update 0000-targeted-slots.md
Minor additions - `<svelte:target>`.
Minor additions - style order method.
Formatting fix in one place.
  • Loading branch information
lukaszpolowczyk authored Sep 10, 2022
commit f0cfaf402587e60b1eb78e5983d4f7ef3dbc5551
6 changes: 4 additions & 2 deletions text/0000-targeted-slots.md
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,8 @@ What part of attributes and special attributes can be easily handled with this A

---

The issue of the order in which CSS classes are overridden isn't certain either, as it depends on which component is initialized first, or something like that.... It's also for the SvelteJS engine specialis.
The issue of the order in which CSS classes are overridden isn't certain either, as it depends on which component is initialized first, or something like that.... It's also for the SvelteJS engine specialis.
This can be solved, it seems to me, by double using .hashParent.hashParent from Parent to override .hashChild from Child. I think such a method is used somewhere in Svelte.

---

Expand Down Expand Up @@ -678,6 +679,7 @@ Then you have to rely on the `targeted:name` `slot`, `slot:subname` attributes t

Using `<target/>` or simple `<slot/>`, instead of `<svelte:element targeted:name/>`.
The first introduces an unnecessary new basic tag. The second can be confusing.
There is an option with `<svelte:target targeted:name/>`. I don't know if it's worth it.

The `<svelte:element/>` better reflects a situation where attributes from two elements are combined.

Expand Down Expand Up @@ -733,7 +735,7 @@ But it is not necessary, because it is possible to pass data through `Child` par

---

If we adopt the syntax `pass:val="val", it could also be used instead of the object in `targeted:name={ {val} }`.
If we adopt the syntax `pass:val="val"`, it could also be used instead of the object in `targeted:name={ {val} }`.

```svelte
<!-- Parent.svelte -->
Expand Down
0