Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !36738

[DRAFT] Use postcss-drop-empty-css-vars to remove empty CSS variables

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Julien Déramond requested to merge main-jd-postcss-drop-empty-css-vars into main Jul 14, 2022
  • Overview 3
  • Commits 1
  • Pipelines 0
  • Changes 3

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

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: main-jd-postcss-drop-empty-css-vars