2019-04-30 11:11:25 +08:00
|
|
|
|
.#{$ns}ButtonGroup {
|
|
|
|
|
position: relative;
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
|
2019-05-15 16:10:20 +08:00
|
|
|
|
> .#{$ns}Button {
|
2019-04-30 11:11:25 +08:00
|
|
|
|
position: relative;
|
|
|
|
|
flex: 0 1 auto;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-15 16:10:20 +08:00
|
|
|
|
@if $Button-borderWidth>0 {
|
|
|
|
|
> .#{$ns}Button {
|
2019-04-30 11:11:25 +08:00
|
|
|
|
@include hover {
|
|
|
|
|
z-index: 1;
|
|
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
|
2019-04-30 11:11:25 +08:00
|
|
|
|
&:focus,
|
|
|
|
|
&:active,
|
2019-06-09 22:30:59 +08:00
|
|
|
|
&.active,
|
|
|
|
|
&.is-active {
|
2019-04-30 11:11:25 +08:00
|
|
|
|
z-index: 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
|
2019-04-30 11:11:25 +08:00
|
|
|
|
.#{$ns}Button + .#{$ns}Button,
|
|
|
|
|
.#{$ns}Button + .#{$ns}ButtonGroup,
|
|
|
|
|
.#{$ns}ButtonGroup + .#{$ns}Button,
|
|
|
|
|
.#{$ns}ButtonGroup + .#{$ns}ButtonGroup {
|
|
|
|
|
margin-left: -$Button-borderWidth;
|
|
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
} @else if
|
|
|
|
|
(
|
|
|
|
|
variable-exists("ButtonGroup-divider-width") and
|
|
|
|
|
variable-exists("ButtonGroup-divider-color")
|
|
|
|
|
)
|
|
|
|
|
{
|
2019-04-30 11:11:25 +08:00
|
|
|
|
background-color: $ButtonGroup-divider-color;
|
2019-05-15 16:10:20 +08:00
|
|
|
|
|
|
|
|
|
> .#{$ns}Button + .#{$ns}Button {
|
2019-04-30 11:11:25 +08:00
|
|
|
|
margin-left: $ButtonGroup-divider-width;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{$ns}ButtonToolbar {
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.#{$ns}ButtonGroup {
|
2019-07-03 20:25:16 +08:00
|
|
|
|
margin-left: px2rem(5px);
|
|
|
|
|
margin-top: px2rem(5px);
|
2019-04-30 11:11:25 +08:00
|
|
|
|
width: auto;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{$ns}ButtonGroup {
|
|
|
|
|
> .#{$ns}Button:first-child {
|
|
|
|
|
margin-left: 0;
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-15 10:41:39 +08:00
|
|
|
|
// cxd的ButtonGroup的is-active和:active样式不一样,这里做个兼容
|
|
|
|
|
.#{$ns}Button--primary:not(:disabled):not(.is-disabled).is-active{
|
|
|
|
|
@if variable-exists("ButtonGroup--primary-isActive-color") {
|
|
|
|
|
color: $ButtonGroup--primary-isActive-color;
|
|
|
|
|
}
|
|
|
|
|
@if variable-exists("ButtonGroup--primary-isActive-bg") {
|
|
|
|
|
background-color: $ButtonGroup--primary-isActive-bg;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-15 16:10:20 +08:00
|
|
|
|
@if $Button-borderWidth>0 {
|
2019-04-30 11:11:25 +08:00
|
|
|
|
> .#{$ns}Button:not(:last-child),
|
|
|
|
|
> .#{$ns}ButtonGroup:not(:last-child) > .#{$ns}Button {
|
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .#{$ns}Button:not(:first-child),
|
|
|
|
|
> .#{$ns}ButtonGroup:not(:first-child) > .#{$ns}Button {
|
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{$ns}ButtonGroup--vertical {
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: flex-start;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
|
|
.#{$ns}Button,
|
|
|
|
|
.#{$ns}ButtonGroup {
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .#{$ns}Button + .#{$ns}Button,
|
|
|
|
|
> .#{$ns}Button + .#{$ns}ButtonGroup,
|
|
|
|
|
> .#{$ns}ButtonGroup + .#{$ns}Button,
|
|
|
|
|
> .#{$ns}ButtonGroup + .#{$ns}ButtonGroup {
|
|
|
|
|
margin-top: -$Button-borderWidth;
|
|
|
|
|
margin-left: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .#{$ns}Button:not(:last-child),
|
|
|
|
|
> .#{$ns}ButtonGroup:not(:last-child) > .#{$ns}Button {
|
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .#{$ns}Button:not(:first-child),
|
|
|
|
|
> .#{$ns}ButtonGroup:not(:first-child) > .btn {
|
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{$ns}ButtonGroupControl {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
|
|
|
|
|
> .#{$ns}ButtonGroup--sm {
|
|
|
|
|
margin-top: ($Form-input-height - $Button--sm-height) / 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .#{$ns}ButtonGroup--xs {
|
|
|
|
|
margin-top: ($Form-input-height - $Button--xs-height) / 2;
|
|
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
}
|