Skip to content

Badge cannot remove 'bg-secondary' class after adding other bootstrap classes #368

@confettidc

Description

@confettidc

This is a (multiple allowed):

  • bug

  • enhancement

  • feature-discussion (RFC)

  • BootstrapUI Version: 4.0.0

  • Bootstrap Framework Version: 5.1

  • jQuery: 3.4.1

  • Platform and Target: Nginx, CakePHP 4.2.6

What you did

I try use "bg-white" class instead of "bg-secondary" but seems the default class cannot be replaced:
<?php echo $this->Html->badge('xxx', ['class' => 'text-primary border-primary bg-white']); ?>

"bg-white" is one of default class defined in bootstrap:
https://getbootstrap.com/docs/5.1/utilities/background/#background-color

Expected Behavior

"bg-secondary" class should be removed, e.g.
<span class="text-primary border-primary bg-white badge">xxx</span>

Actual Behavior

"bg-secondary" class not removed, e.g.
<span class="text-primary border-primary bg-white badge bg-secondary">xxx</span>

Before you open an issue, please check if a similar issue already exists or has been closed before.

P.S. Remember, an issue is not the place to ask questions. You can use Stack Overflow
for that or join the #cakephp channel on irc.freenode.net, where we will be more
than happy to help answer your questions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions