Skip to content
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

Providing shadow part styles to template #45

Open
tpluscode opened this issue Aug 18, 2020 · 3 comments
Open

Providing shadow part styles to template #45

tpluscode opened this issue Aug 18, 2020 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@tpluscode
Copy link

I would like to add some example styles customised using Shadow Parts exposed by my element.

So far I failed to do that. I cannot add a style to the document itself because API viewer's shadow root blocks them. I tried to put them inside the template[data-target=host] but that break the demo completely.

How about providing a new template where a style can be provided?

<api-viewer>
  <template data-element="my-element" data-target="style">
    <style>
      my-element::part(foo) { color: red }
    </style>
  </template>
</api-viewer>
@web-padawan web-padawan added the enhancement New feature or request label Aug 20, 2020
@web-padawan
Copy link
Collaborator

Thanks for the issue. This seems to be a nice addition 👍 Will get back to api-viewer soon and implement it.

@web-padawan web-padawan self-assigned this Aug 20, 2020
@tpluscode
Copy link
Author

Ah, hey. I found my way around this by putting a style tag inside template[data-target=prefix]. This works well enough so maybe just some more docs around the available template targets would nice? I found that there are a bunch that the element expects

@web-padawan
Copy link
Collaborator

That's a valid point. So adding another one is kinda unnecessary 🤔
I agree those templates need more documentation.

@web-padawan web-padawan added the documentation Improvements or additions to documentation label Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants