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
  • #36087
Closed
Open
Issue created Mar 30, 2022 by Julien Déramond@julien-deramondContributor3 of 3 checklist items completed3/3 checklist items

Border color & inputs work differently with CSS vars

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

Using border color utility classes with inputs works differently since the adding of CSS vars for border colors (see https://github.com/twbs/bootstrap/commit/de0dfca9a1749990319cdfcbb7f1584df09d7091).

This issue was Initially spotted by @louismaximepiton.

Before

  1. Go to https://getbootstrap.com/docs/5.1/forms/form-control/
  2. Add .border-danger to the first input in the page
  3. Result: the border is now red
Capture d’écran 2022-03-30 à 13 24 40

Now (main branch)

  1. Go to https://twbs-bootstrap.netlify.app/docs/5.1/forms/form-control/
  2. Add .border-danger to the first input in the page
  3. Result: the border stays gray
Capture d’écran 2022-03-30 à 13 26 04

because .border-danger value is --bs-border-color: rgba(--var(--bs-danger-rgb), var(--bs-border-opacity)); and .form-control border: 1px solid #ced4da;. .form-control border doesn't use the CSS var so doesn't change the color.

  1. Add .border as well
  2. Result: the border is now red
Capture d’écran 2022-03-30 à 13 24 40

because by adding .border the border will use the color defined in the CSS var and will override the border color specific to the form control.

Is it expected?

I'm not sure this is an issue to fix or if it is expected. But if it is expected, we should maybe mention it in the Migration page because some projects could observe a regression since adding a .border was not mandatory before.

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

Windows, macOS

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

Firefox

What version of Bootstrap are you using?

v5.2.0 (current main branch)

Assignee
Assign to
Time tracking