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
  • Issues
  • #37270
Closed
Open
Issue created Oct 06, 2022 by Administrator@rootContributor3 of 3 checklist items completed3/3 checklist items

.btn background removed in :active state

Created by: roblevintennis

Prerequisites

  • I have searched for duplicate or closed issues
  • I have validated any HTML to avoid common problems
  • I have read the contributing guidelines

Describe the issue

Issue

It appears the latest 5.2.2 is implemented so that if you have a .btn with no variant e.g. .btn-VARIANT, and you click or make that button :active, it's background color will be removed. It appears this is because the --bs-btn-active-bg css variable is not getting defined: image

This becomes an issue especially if you have custom background styles you're using alongside .btn e.g. white text color that is !important with a color background that is not important since they'll get removed leaving you with a blank all white button (see test case below)

Secondary issues

The same sort of undefined css variable thing is happening for var(--bs-btn-active-border-color) as well. It doesn't affect my particular use case but maybe/probably should be addressed as well?

Cause

I believe this is do to a recent addition of this line:

:not(.btn-check) + &:active introduced here

Reduced test cases

I've forked the button stackblitz to reproduce this here: https://stackblitz.com/edit/s8s493?file=index.html

Just toggle the :active state either manually by clicking the button or via devtools

Chrome image

Safari image

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Chrome, Safari

What version of Bootstrap are you using?

v5.2.2

Assignee
Assign to
Time tracking