Chalarangelo/mini.css

Small and large buttons look wrong when in a button group

aeons opened this issue · 4 comments

aeons commented
  • Framework Version:
    3.0.0-alpha.3
  • Flavor used:
    Default
  • Operating System/Browser:
    Mac, Firefox, Safari and Chrome
  • Code to reproduce:
<div class="button-group">
  <button>Horses</button>
  <button>are</button>
  <button>neat</button>
</div>

<div class="button-group">
  <button class="small">Horses</button>
  <button class="small">are</button>
  <button class="small">neat</button>
</div>
  • Screenshots:

screen shot 2018-05-17 at 20 25 30

  • Bug description:
    Buttons in a button group do not behave properly when they have either the class small or large.
  • Additional information (Optional):

This is quite an interesting issue, I'll see if I can figure it out before the next release.

.button-group elements were never designed to work with .small and .large buttons. If you really want to make them compatible with that, you would have to tweak the _input_control.scss file to produce a selector with higher specificity or somehow get the mixins output before the .button-group rules in your final CSS (essentially, if you swap them in your CSS file, so that .small and .large come before .button-group, it will all work as they have the same specificity).

I will not be implementing this in the framework itself, as it will add quite a lot of overhead with the selectors, but swapping the order of selectors in the CSS should work just fine.

aeons commented

Cool, maybe a short note in the docs would make it clear that you should probably only use button-group with regular buttons?

Yup, I will add it soon!