1
1
mirror of https://github.com/primer/css.git synced 2024-12-23 06:01:54 +03:00
css/modules/primer-buttons/lib/button-group.scss
2017-06-29 12:49:16 -07:00

80 lines
1.4 KiB
SCSS

// Button group
//
// A button group is a series of buttons laid out next to each other, all part
// of one visual button, but separated by rules to be separate.
.BtnGroup {
display: inline-block;
vertical-align: middle;
@include clearfix();
// Proper spacing for multiple button groups (a la, gollum editor)
+ .BtnGroup,
+ .btn {
margin-left: 5px;
}
}
.BtnGroup-item {
position: relative;
float: left;
border-right-width: 0;
border-radius: 0;
&:first-child {
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
&:last-child {
border-right-width: 1px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
&.selected,
&:focus,
&:active,
&:hover {
border-right-width: 1px;
+ .BtnGroup-item,
+ .BtnGroup-form .BtnGroup-item {
border-left-width: 0;
}
}
}
.BtnGroup-form {
float: left;
&:first-child .BtnGroup-item {
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
}
&:last-child .BtnGroup-item {
border-right-width: 1px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
.BtnGroup-item {
border-right-width: 0;
border-radius: 0;
}
&.selected,
&:focus,
&:active,
&:hover {
.BtnGroup-item {
border-right-width: 1px;
}
+ .BtnGroup-item,
+ .BtnGroup-form .BtnGroup-item {
border-left-width: 0;
}
}
}