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

New feature: outline badges #23886

Closed
wants to merge 1 commit into from

Conversation

andresgalante
Copy link
Collaborator

@andresgalante andresgalante commented Sep 8, 2017

This PR closes #23882

It adds outlined badges and they look like this:

screen shot 2017-09-08 at 9 56 24 am

screen shot 2017-09-08 at 9 57 18 am

Do you think it's worth adding the same hover animation to badges as in btns for consistency?

@andresgalante andresgalante changed the title adds outline badges New feature: outline badges Sep 8, 2017
@XhmikosR
Copy link
Member

@andresgalante: maybe change the light badge to use a darker background?

As for the animation, personally I'd add it, but let's wait for @mdo to chime in.

@fdabek1
Copy link

fdabek1 commented May 9, 2018

Is there any progress on getting this integrated? Currently I am using the button classes to get around this:

<span class="badge btn btn-outline-primary">Primary</span>

@XhmikosR XhmikosR requested a review from mdo May 9, 2018 15:35
@ocarreterom
Copy link

Should not it have the same size for normal and outline?
Buttons have it:
captura de pantalla 2018-05-24 a las 10 28 29

@killswitch-GUI
Copy link

This is awesome: bump!

@royklutman
Copy link
Contributor

Is there any update on this? Would love to see this merged.

@MartijnCuppens
Copy link
Member

I would love this feature!

I think it's better adding the same hover animation to badges as in .btns for consistency. Also as @ocarreterom mentioned, it would be nice if the normal and outline variants have the same size.

@MartijnCuppens
Copy link
Member

I've made another PR which takes care of the focus state of default linked badges (#27136), this PR also adds the transition.

Copy link
Member

@mdo mdo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall. One thing though is this might need to update our print styles to somehow account for the colored borders. Perhaps a :not() selector? See https://github.com/twbs/bootstrap/blob/v4-dev/scss/_print.scss#L103-L105.

@ysds
Copy link
Member

ysds commented Sep 18, 2018

Now, we can make a outlined badge by utility classes. Please reconsider the necessity of new specific classes.

<span class="badge text-primary border border-primary">Primary outlined</span>
<span class="badge text-secondary border border-secondary">Secondary outlined</span>

I think badges should have flexibility to allow various custom colors. Not only theme colors defined in Bootstrap. Please see #27149 or #27136 (comment) for more details.

@mdo
Copy link
Member

mdo commented Sep 18, 2018

@ysds Yeah, there are discussions here and elsewhere around how to rollback badges in v5. Do we take that stance now, or do we keep adding and improving until then?

Some things on my mind around badges:

  • If we don't have hover styles, we should just be using utilities (e.g., <span class="bg-primary rounded">...</span>).
  • Utilities are great, but at some point we're passing CSS weight onto page weight. At a certain scale, it's better to have component classes vs utilities repeated heavily.
  • Ideally anyone can take .badge and pass their own background-color via inline style or class. This is possible now, and would remain regardless of any future changes.
  • We need to be better, with badges and beyond, at saying no to things and having limitations in the core that can easily scale up.

Writing all that out, it feels like we say no to this in v4.x given their future in v5.x?

@mdo
Copy link
Member

mdo commented Dec 17, 2018

Punting on this for now given recent conversation around scaling back badge functionality for utilities and better differentiation from buttons in v5. (Adding to our v5 planning doc.)

@mdo mdo closed this Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants