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
  • !35399

Convert pagination component to CSS variables

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Mark Otto requested to merge css-vars-pagination into main Nov 25, 2021
  • Overview 4
  • Commits 3
  • Pipelines 0
  • Changes 3

This PR represents a potential shift in how we're using CSS variables for our components. In previous cases like #34600, I've been creating new CSS variables for each state-property pairing (e.g., --bs-btn-color, --bs-btn-hover-color, and --bs-btn-active-color). This matches our Sass-based customization of variables for almost every property and state, but it does create bloat in the component base class.

In contrast, this PR only sets the essential variables on the base class and uses CSS variable reassignment as needed to modify those properties for each state with their Sass variables. For example, --bs-pagination-color is set on .pagination and then overridden on .page-link:hover using the same --bs-pagination-color variable with a new value.

I think this approach makes more sense and can steer us toward more CSS variable re-use (e.g., --bs-pagination-bg: var(--bs-body-bg)), steering us away from too much Sass variable re-use that led to complicated customization issues.

Updated to use the same method we're using elsewhere, all in on the base class.

/cc @twbs/css-review


  • Revert to all CSS vars on base class
  • Update documentation
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: css-vars-pagination