Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 3 tasks
confettidc opened this issue Apr 25, 2022 · 1 comment
Open
1 of 3 tasks

Comments

@confettidc
Copy link

confettidc commented Apr 25, 2022

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.

@ndm2
Copy link
Collaborator

ndm2 commented Apr 25, 2022

I don't think I've ever used white, body or transparent for badges, or pretty much any other component, so I'm not sure whether the current behavior is correct/intentional.

Is there possibly a reason that those three colors aren't listed in the badge background colors docs, nor for any other component for that matter (with the exception of transparent for removing the background of cards)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants