[BSv5] Fix SCSS functions import issue, and replace darken()#1388
Merged
chalin merged 1 commit intogoogle:mainfrom Feb 1, 2023
Merged
[BSv5] Fix SCSS functions import issue, and replace darken()#1388chalin merged 1 commit intogoogle:mainfrom
chalin merged 1 commit intogoogle:mainfrom
Conversation
chalin
commented
Feb 1, 2023
| @@ -1,3 +1,5 @@ | |||
| @import "../vendor/bootstrap/scss/functions"; | |||
Collaborator
Author
There was a problem hiding this comment.
See the opening comment of this PR for a design rationale.
chalin
commented
Feb 1, 2023
| $td-box-colors: $dark, $primary, $secondary, $info, $gray-600, $success, $warning, $dark, $danger, $primary, $secondary, $info !default; | ||
|
|
||
| $link-color: darken($blue, 15%) !default; | ||
| $link-color: adjust-color($blue, $lightness: -15%) !default; |
Collaborator
Author
There was a problem hiding this comment.
While I followed BS's upgrade path and generally replaced darken() by shade-color(), in this case the resulting color didn't look as good, so I opted for a call to adjust-color() --matching the previous color exactly.
Collaborator
|
Makes sense to me! I don't see any obvious (or easy to maintain) alternative to this approach. |
LisaFC
approved these changes
Feb 1, 2023
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.
This PR:
functionsfirst! For details, see the design note below.darken()by other functions, getting some guidance from:darken()documentation , which describes suitable replacementsFollowup:
functionsimport fixIs this fix really necessary?
Without the import fix included in this PR, use of Bootstrap
functionscan 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.scssfirst, 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@importdocumentation: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).