[Draft] Add $enable-host
to generate a different bootstrap.css for web components
#38056
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.
Another possibility to tackle #36688 (Closes #36688)
The principle here is to offer a
$enable-host
Scss var (false
by default). This var is associated with aroot
mixin allowing to switch between:root
and:host
::root
when$enable-host
isfalse
(default):host
when$enable-host
istrue
I've added some unit tests to check this behavior.
It differs from #37162 which suggests to use
:root, :host
that is not really useful for all folks and projects.The disadvantage here is that it's only available via Sass compilation. But maybe we can consider that this usage with web components is an "expert mode".
We also talked about a
bootstrap.*.host.*.css
with @vprothais but I'm a bit afraid of what it could imply in combination with the regularbootstrap.*.css*
filessite/content/docs/5.3/customize/css-variables.md
modifications (if any needed)$enable-host
set totrue
) in different use cases amongst Use:host
in selectors to better support web components #36688 (comment)$enable-host
in the documentation and explain the impacts for web componentsThoughts??