Skip to content

[Draft] Add $enable-host to generate a different bootstrap.css for web components #38056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

julien-deramond
Copy link
Member

@julien-deramond julien-deramond commented Feb 14, 2023

Warning
Heavily draft

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 a root mixin allowing to switch between :root and :host:

  • :root when $enable-host is false (default)
  • :host when $enable-host is true

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 regular bootstrap.*.css* files

Thoughts??

@julien-deramond julien-deramond force-pushed the main-jd-add-enable-host-to-handle-web-components branch from 2492c66 to c5ea93a Compare February 14, 2023 18:07
@lominming
Copy link

This would be super useful for my use-case. I am trying to figure out the best way to tackle this right now. Ideally I have a way to hoist all the variables out to :host.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use :host in selectors to better support web components
2 participants