[BSv5] Fix SCSS functions import issue, and replace darken() #1388
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.
This PR:
functions
first! For details, see the design note below.darken()
by other functions, getting some guidance from:darken()
documentation , which describes suitable replacementsFollowup:
functions
import fixIs this fix really necessary?
Without the import fix included in this PR, use of Bootstrap
functions
can result in bogus errors like the following:when in fact the argument is a color.
Learn more
For details concerning the need to import
functions.scss
first, see the Bootstrap migration guide under New _maps.scssDesign choice: double import vs. inlining many imports
In this PR, I'm proposing to
@import "functions"
before our variable overrides, and then import the full Bootstrap suite of SCSS. This will result in the "functions" file being loaded twice, but according to the Sass@import
documentation:The _functions.scss file doesn't contain any style rules, so we should be ok. The alternative would be to inline all of the 40+ imports in https://github.com/twbs/bootstrap/blob/main/scss/bootstrap.scss, which would be a significant maintenance overhead, one that I think that we can avoid (until proven otherwise).