Warning Heavily draft
Another possibility to tackle https://github.com/twbs/bootstrap/issues/36688 (Closes #36688)
The principle here is to offer a $enable-host Scss var (false by default). This var is associated with a root mixin allowing to switch between :root and :host:
-
:rootwhen$enable-hostisfalse(default) -
:hostwhen$enable-hostistrue
I've added some unit tests to check this behavior.
It differs from https://github.com/twbs/bootstrap/pull/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 regular bootstrap.*.css* files
-
Handle site/content/docs/5.3/customize/css-variables.mdmodifications (if any needed) -
Test this new file (with $enable-hostset totrue) in different use cases amongst https://github.com/twbs/bootstrap/issues/36688#issuecomment-1422236483 -
Add $enable-hostin the documentation and explain the impacts for web components
Thoughts??