-
Notifications
You must be signed in to change notification settings - Fork 59
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
Attach component-specific Sass/Css at the component level; allow for more customization via CSS variables #664
Merged
Conversation
This file contains 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
…more customization via CSS variables
cpsievert
commented
Jul 10, 2023
cpsievert
commented
Jul 10, 2023
cpsievert
force-pushed
the
componentize-scss
branch
from
July 10, 2023 19:39
62958c0
to
07c9032
Compare
cpsievert
force-pushed
the
componentize-scss
branch
from
July 10, 2023 19:41
07c9032
to
ce6cad0
Compare
…ndency. Also keep moving Sass-specific logic to CSS
This was referenced Jul 10, 2023
…oint for 'global' bslib rules
cpsievert
force-pushed
the
componentize-scss
branch
from
July 10, 2023 22:28
f9ad3ce
to
f3e3b15
Compare
gadenbuie
reviewed
Jul 11, 2023
gadenbuie
reviewed
Jul 11, 2023
gadenbuie
reviewed
Jul 11, 2023
gadenbuie
approved these changes
Jul 11, 2023
cpsievert
commented
Jul 11, 2023
cpsievert
commented
Jul 11, 2023
cpsievert
commented
Jul 11, 2023
cpsievert
commented
Jul 11, 2023
cpsievert
commented
Jul 11, 2023
cpsievert
commented
Jul 11, 2023
cpsievert
added a commit
that referenced
this pull request
Jul 11, 2023
…sn't create an empty card-body (i.e., card item)
cpsievert
added a commit
that referenced
this pull request
Jul 13, 2023
…whether compile Sass for components
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.
Currently,
bs_theme()
imports Sass files for bslib components (e.g., cards, sidebars, etc), which has a couple benefits:@extend
and placeholders that, in effect, modify Bootstrap.sass::sass()
calls (since sass may need to be re-compiled for each component).HTMLDependency()
of these components.However, there are downsides that outweigh those benefits:
This PR moves component-level Sass out of
bs_theme()
and into the relevant components. And since do might need to re-compile Sass in those situations, it follows the dynamically theme-able component model.Also, while we're here, I took the opportunity to reduce the amount of Sass specific calculations (by moving what we can to CSS), and more fully embrace CSS variables for customization. We'll still keep Sass around to leverage things like
mix()
andcolor-contrast()
, but once CSS has good support for these things, we could potentially remove the (run-time) Sass dependency for these components, and still allow them to be theme-able (by allowing defaults to derive from Bootstrap's CSS variables)