connors / photon

The fastest way to build beautiful Electron apps using simple HTML and CSS
photonkit.com
MIT License
10.01k stars 580 forks source link

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

Open developit opened 8 years ago

developit commented 8 years ago

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;
}
kevinmartin commented 8 years ago

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 commented 8 years ago

Ill make a PR now

developit commented 8 years ago

Ah good call.