Problem/Motivation
Updating Bootstrap library requires copying the new variables from node_modules/bootstrap/scss/_variables.scss to scss/bootstrap-variables.scss which can be avoided.
Steps to reproduce
Given I have
Vartheme_bs4installed with Bootstrap4.6.1,
And I already created a subtheme and changed the values of some variables inscss/bootstrap-variables.scss,
When I upgrade Bootstrap to4.6.2and try to compile scss files,
Then I get an error that$transition-collapse-widthvariable is undefined and that's because we are trying to compile the new Bootstrap scss files -which use this new variable- without adding it toscss/bootstrap-variables.scss.
Proposed resolution
Import Bootstrap variables from node_modules/bootstrap/scss/_variables.scss right after importing scss/bootstrap-variables.scss and remove non-customized variables from scss/bootstrap-variables.scss, this will allow any new variables to be used when compiling scss files, and will still allow us to customize variables by adding the variable name and its custom value to scss/bootstrap-variables.scss.
Thanks to "!default" keyword used with all variables in Bootstrap, we can import the file with the custom values before the original variables file.
For additional info please refer to this article and this question.
Remaining tasks
- ✅ File an issue about this project
- ✅ Addition/Change/Update/Fix to this project
- ✅ Testing to ensure no regression
- ➖ Automated unit/functional testing coverage
- ➖ Developer Documentation support on feature change/addition
- ➖ User Guide Documentation support on feature change/addition
- ✅ Accessibility and Readability
- ✅ Code review from 1 Varbase core team member
- ✅ Full testing and approval
- ✅ Credit contributors
- ✅ Review with the product owner
- ✅ Update Release Notes and Update Helper on new feature change/addition
- ✅ Release varbase-9.0.11, vartheme_bs4-9.0.21
Varbase update type
- ✅ No Update
- ➖ Optional Update
- ➖ Forced Update
- ➖ Forced Update if Unchanged
User interface changes
- N/A
API changes
- N/A
Data model changes
- N/A
Release notes snippet
- Issue #3311233 by RedwanJamous: Changed the way of using Bootstrap 4 variables
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | 3311233-10.patch | 213.46 KB | rajab natshah |
| #2 | 3311233-1.patch | 99.88 KB | redwan jamous |
Comments
Comment #2
redwan jamous commentedComment #3
rajab natshahComment #4
rajab natshahComment #5
rajab natshahLinked to #3321160: Allow override Bootstrap 5 variables
Comment #6
rajab natshahThe Varbase Technical Team agreed to switch to the new better way for Bootstrap 4 and Bootstrap 5
Comment #7
rajab natshahThanks to @Abdullah Yassin for the link and logic for Partials
Doing that for sure
Comment #8
rajab natshahThe patch fix dose not apply, Please create a new MR for this issue, with many thanks.
Comment #9
rajab natshahOnly having
$enable-responsive-font-sizes: true;To changes for https://github.com/twbs/bootstrap/blob/v4.6.2/scss/_variables.scss
Comment #10
rajab natshahComment #12
rajab natshahComment #14
rajab natshahComment #15
rajab natshahComment #16
rajab natshahComment #17
rajab natshah✅ Released vartheme_bs4-9.0.21
Comment #18
rajab natshah✅ Released varbase-9.0.11