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

Styles are not applied inside a custom element #481

Open
trusz opened this issue Oct 20, 2023 · 0 comments
Open

Styles are not applied inside a custom element #481

trusz opened this issue Oct 20, 2023 · 0 comments

Comments

@trusz
Copy link

trusz commented Oct 20, 2023

Hi there!

So far I like the library!
I have came across, a hopfuly small, styling issue.

In case the svelvet component is inside a custom element, in a shadow DOM the :root styles are not applied and the css variables cannot be used.

Here is a reproduction on stackblitz: https://stackblitz.com/edit/svelvet-v7-b7kwdt?file=src%2Fcomponents%2Fsvelvet-comp.svelte

I've played around a bit and I think the problem can be solved if you add :host to rules where you have :root.

So something like:

:root, :host{
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant