Library styles in custom element component and discarded in instantiated component #10344
Unanswered
FilipJakab
asked this question in
Q&A
Replies: 1 comment 2 replies
-
This is expected because Svelte's |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the bug
I am doing a PoC with custom elements in Svelte. It involves single component marked as custom element that uses
photoviewer
library to preview images.Library's directions are to add
@use 'photoviewer'
into styles:Which resulted in following style output:
As you can see, all acutal class names of the library are missing and only the svelte style's "hash" remained.
When I try same component with the last style configuration mentioned inside
App.svelte
(as standard component, not as custom element)it works...
Reproduction
https://github.com/FilipJakab/image-viewer
Just run
npm i
andnpm run dev
App runs on port
5173
where there are 2image-viewer
instances, first insideApp.svelte
as a regular component and second as custom element inindex.html
.Clicking on the first one initiates library and opens image's preview, while the second image does instantiate the library but without styles...
Logs
No response
System Info
Beta Was this translation helpful? Give feedback.
All reactions