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

Remove `color` property from `badge` class

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/jonwolski/fix/badge-default-colors into v4-dev Aug 17, 2017
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: jonwolski

I suggest removing color: #FFF from the badge class, because it is provided by the badge-<modifier> classes along with a background-color, whereas there is no corresponding background-color provided on the badge class itself.

Background

According to the documentation:

[badge] Requires one of the contextual, color modifier classes for color and background-color.

That is, color and background color should be provided by a modifier class, rather than the badge class itself.

For example:

<span class='badge badge-primary'>4</span>

rather than

<span class='badge'>4</span>

In general, providing a color property without also providing a background-color should be avoided. [W3 QA tips]

In this context, this is a problem only if someone creates a badge without providing a modifier. Such an omition may be difficult to trouble-shoot, because this will most likely yield white text on a white background.

W3 QA tips

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/jonwolski/fix/badge-default-colors