photon icon indicating copy to clipboard operation
photon copied to clipboard

button-group: no border-radius when containing only one button

Open developit opened this issue 10 years ago • 3 comments

Placing a single <button> into a button-group causes it to render without any border-radius.

Here's my current fix:

.btn-group > .btn:first-child:last-child {
    border-radius: 4px;
}

developit avatar Oct 19 '15 02:10 developit

Or change:

  > .btn:first-child {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  > .btn:last-child {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }

  > .btn:not(:first-child):not(:last-child) {
    border-radius: 0;
  }

to:

  > .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  > .btn:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }

Also has the added benefit of being 2 selectors, not 3.

Pen with updated code: http://codepen.io/KevinMartin/pen/KdZPLJ

kevinmartin avatar Oct 19 '15 17:10 kevinmartin

Ill make a PR now

kevinmartin avatar Oct 19 '15 17:10 kevinmartin

Ah good call.

developit avatar Oct 19 '15 18:10 developit