fix(build): add :host support#170
Merged
mlmoravek merged 5 commits intooruga-ui:mainfrom Jun 16, 2025
Merged
Conversation
Member
|
Have a look on the newest bulma v1.0.4 and this included PR I think we can use $variables-host from bulma inside the theme instead of adding a new one. This should be the solution :) |
Contributor
Author
Nice find! That's perfect. I checked the open PRs and issues in Bulma but didn't dig through the recently merged stuff, so I didn't see this. With this PR we can solve for all use cases, even no-dark-mode/web-components. Let me do another version... |
Contributor
Author
|
@mlmoravek have another look. It's working well in local testing. |
:host support
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.
While fixing #168 I broke the docs. The docs display our components inside web components so it's essential that $enable-hosts functions and appends
:hostto everywhere bulma uses:root. If_root.scssdoesn't have@use "bulma/sass";then we don't extend all usages of:root. Strangely some usage does get extended, which makes no sense but is beside the point. The trouble is if we bring that@useback as it was before then we'll be bringing dark mode back with it for users of the separate install method like me.My solution is to split_root.scssinto a second file called_host.scss, which will contain the$enable-hostlogic and the tricky@useto support it. This file then gets included into.bulma-build.scsswhich is used in the combined method but not the separate method. This will solve for the docs, which need web components but don't care about dark mode, and users like myself, who need to avoid dark mode but don't care about web components. The only problem will be if we have users who need to use bulma without dark mode inside of a web component, but that's an edge case on an edge case, which i think will be fine.Update: Turns out Bulma 1.0.4 has exactly what we need (jgthms/bulma#3906). New solution removes our
$enable-hostvariable and replaces it with$theme-bulma-variables-hostwhich mirrors$variables-hostin Bulma.:hostis enabled by default so functionally everything should remain the same for our users._root.scsshas also been modified to use this value.