Problem/Motivation
There is an issue with current Bootstrap 5 upstream. When they introduced CSS Variables (the tokens overridable at runtime), they turned many (or all?) Sass Variables (the tokens, overridable at buildtime) into CSS variables.
Bootstrap 5.3 has 393 CSS Variables, and we have implemented al of them with UI skins: https://git.drupalcode.org/project/ui_suite_bootstrap/-/blob/5.0.x/ui_su...
It is a mess. CSS Variables is a public API with a distinct purpose, and need to be focused and clean. That's why we have:
- conflicting colors and "colors rgb"
- misleading variables (they don't do what may be expected, or not as much as expected)
For comparison, Material Design Web 2 has only 36 variables and all of them are clear and useful: https://git.drupalcode.org/project/ui_suite_material/-/blob/2.0.x/ui_sui...
Proposed resolution
Can we remove all CSS variable which are confusing, useless or misleading?
Remaining tasks
We don't know yet if those variables to remove are 20, or 200. We need to do an analysis first.
Maybe, it would be better to act upstream first: https://github.com/twbs/bootstrap/issues
API changes
Unfortunately, it is a breaking change. If someone has overridden a variable we will remove, the value will not be applied anymore.
Issue fork ui_suite_bootstrap-3389752
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3389752-reduce-the-number
changes, plain diff MR !203
Comments
Comment #2
grimreaperPostponed until UI Skins API is improved in the related issue #3403793: From one CSS variable plugin generate derivatives.
Comment #3
thejimbirch commentedFollowing.
We had the need for
--bs-nav-link-font-sizetoday.Comment #4
grimreaperComment #5
grimreaperComment #6
grimreaperBack to active now that there is a MR to test in UI Skins.
Comment #7
grimreaperBetter title
Comment #8
grimreaperComment #10
grimreaper17 less variables with just simple hex_to_rgb conversion.
Comment #11
grimreaper4 less variables.
393 -> 372
Comment #12
grimreaperComment #13
grimreaperComment #14
grimreaperComment #15
grimreaperComment #16
grimreaperComment #18
grimreaperDiscussed with @pdureau.
Closing as it is an upstream problem. This needs to be simplified directly into the Bootstrap library.
Providing such derivative system with UI Skins will open a pandora box.
We can't reproduce PHP side, CSS and SASS functions.