Warning Heavily draft
Linked to the discussion in https://github.com/twbs/bootstrap/pull/36597 and potentially addresses https://github.com/twbs/bootstrap/issues/36595. I've tried here to create a very simple PostCSS plugin to remove empty CSS vars.
Plugin repo: https://github.com/julien-deramond/postcss-drop-empty-css-vars Plugin code (very basic just to test the idea): https://github.com/julien-deramond/postcss-drop-empty-css-vars/blob/main/index.js
The plugin is deployed in 0.0.0 version
Running npm run css
with and without this plugin gives this diff:
2801d2800
< --bs-btn-font-family: ;
3506d3504
< --bs-dropdown-box-shadow: ;
3620d3617
< --bs-nav-link-font-weight: ;
3794d3790
< --bs-nav-link-font-weight: ;
4168d4163
< --bs-card-box-shadow: ;
4173,4175d4167
< --bs-card-cap-color: ;
< --bs-card-height: ;
< --bs-card-color: ;
4482,4483d4473
< --bs-breadcrumb-bg: ;
< --bs-breadcrumb-border-radius: ;
5191d5180
< --bs-toast-color: ;
5257d5245
< --bs-modal-color: ;
5271d5258
< --bs-modal-footer-bg: ;
5549d5535
< --bs-tooltip-margin: ;
6094d6079
< --bs-offcanvas-color: ;
/CC @mdo for thoughts