feat(global-styles): new addGlobalStyleToComponents extras option. Opt-out of new globalStyle behaviour#6292
Merged
christian-bromann merged 1 commit intomainfrom Jun 13, 2025
Conversation
…ig option to "opt-out" of new globalStyle behaviour
Contributor
Author
|
@christian-bromann lemme know if you think this config option's name / location / default etc makes sense to you. |
Member
christian-bromann
left a comment
There was a problem hiding this comment.
Makes sense to me, mind adding a PR to the docs to include it here: https://stenciljs.com/docs/config-extras
Contributor
Author
|
done 🙂 |
christian-bromann
added a commit
to stenciljs/site
that referenced
this pull request
Jun 13, 2025
* Update extras.md * Update extras.md * Update extras.md * Update extras.md * Update styling.md * Update extras.md * we invented the language! * we invented the language! * Update versioned_docs/version-v4.33/components/styling.md * Update versioned_docs/version-v4.33/components/styling.md * Update styling.md * Update styling.md * Update extras.md * Update extras.md * Update extras.md * Update styling.md * Update styling.md * Update styling.md --------- Co-authored-by: Christian Bromann <git@bromann.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What is the current behavior?
The new behaviour added via #6268 is probably desirable for a lot of users and use-cases; sharing globalStyle across all components.
For some users however, this new behaviour might be undesirable if (for example):
my-menu > my-link-item::part(icon)is not an option via traditional ::slotted(...) selectors atmGitHub Issue Number: N/A
What is the new behavior?
An escape hatch for users wanting to opt-out of the behaviour:
config.extras.addGlobalStyleToComponentswhich defaults totrueDocumentation
stenciljs/site#1532
Does this introduce a breaking change?
Testing
Other information