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
:
-
:root
when$enable-host
isfalse
(default) -
:host
when$enable-host
istrue
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.md
modifications (if any needed) -
Test this new file (with $enable-host
set totrue
) in different use cases amongst https://github.com/twbs/bootstrap/issues/36688#issuecomment-1422236483 -
Add $enable-host
in the documentation and explain the impacts for web components
Thoughts??