fix: append_styles in an effect to make them available on mount#16509
fix: append_styles in an effect to make them available on mount#16509paoloricciuti merged 2 commits intomainfrom
append_styles in an effect to make them available on mount#16509Conversation
🦋 Changeset detectedLatest commit: e006ac5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
I think that was the intent: svelte/packages/svelte/src/compiler/phases/2-analyze/index.js Lines 503 to 504 in 39ee7cf It looks like we forgot to handle the case where -inject_styles: options.css === 'injected' || options.customElement,
+inject_styles: options.css === 'injected' || !!options.customElementOptions || !!options.customElement, |
|
Yeah it looks like, not at the desk right now so please don't merge, I'll fix this too when I'm back home (unless you beat me to it). I would probably extract |
|
pushed a change, will hold off on merging until you've had a chance to review |
Looks perfect to me |
Closes #16472
Small technicality...I'm pretty sure the actual reproduction doesn't work anyway...but that was not working even before. The reason is that the reproduction is missing css inject. However this got me thinking...given that the style tag is meant to be inside the custom element shouldn't we always inject when building a custom element?
Before submitting the PR, please make sure you do the following
feat:,fix:,chore:, ordocs:.packages/svelte/src, add a changeset (npx changeset).Tests and linting
pnpm testand lint the project withpnpm lint