2019-04-30 11:11:25 +08:00
|
|
|
|
.#{$ns}ButtonGroup {
|
2019-12-06 09:58:08 +08:00
|
|
|
|
position: relative;
|
|
|
|
|
display: inline-flex;
|
|
|
|
|
vertical-align: middle;
|
|
|
|
|
|
|
|
|
|
> .#{$ns}Button {
|
2019-04-30 11:11:25 +08:00
|
|
|
|
position: relative;
|
2019-12-06 09:58:08 +08:00
|
|
|
|
flex: 0 1 auto;
|
2022-05-18 10:03:56 +08:00
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
white-space: nowrap;
|
2019-12-06 09:58:08 +08:00
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2023-03-15 20:32:45 +08:00
|
|
|
|
> .#{$ns}Button,
|
|
|
|
|
.#{$ns}Badge {
|
2020-12-21 10:08:40 +08:00
|
|
|
|
@include hover {
|
|
|
|
|
z-index: 1;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
2020-12-21 10:08:40 +08:00
|
|
|
|
&:focus,
|
|
|
|
|
&:active,
|
|
|
|
|
&.active,
|
|
|
|
|
&.is-active {
|
|
|
|
|
z-index: 1;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
|
}
|
2020-10-19 10:44:09 +08:00
|
|
|
|
|
2023-03-10 10:06:53 +08:00
|
|
|
|
.#{$ns}Badge {
|
|
|
|
|
.#{$ns}Badge-text,
|
|
|
|
|
.#{$ns}Badge-dot,
|
|
|
|
|
.#{$ns}Badge-ribbon,
|
|
|
|
|
.#{$ns}Badge-dot {
|
|
|
|
|
z-index: 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-21 10:08:40 +08:00
|
|
|
|
.#{$ns}Button + .#{$ns}Button,
|
|
|
|
|
.#{$ns}Button + .#{$ns}ButtonGroup,
|
2023-03-15 20:32:45 +08:00
|
|
|
|
.#{$ns}Button + .#{$ns}Badge,
|
2020-12-21 10:08:40 +08:00
|
|
|
|
.#{$ns}ButtonGroup + .#{$ns}Button,
|
2023-03-15 20:32:45 +08:00
|
|
|
|
.#{$ns}ButtonGroup + .#{$ns}ButtonGroup,
|
|
|
|
|
.#{$ns}Badge + .#{$ns}Badge,
|
|
|
|
|
.#{$ns}Badge + .#{$ns}Button {
|
2022-11-11 15:40:46 +08:00
|
|
|
|
margin-left: calc(var(--ButtonGroup-borderWidth) * -1);
|
2020-12-21 10:08:40 +08:00
|
|
|
|
}
|
|
|
|
|
|
2020-10-19 10:44:09 +08:00
|
|
|
|
&--block {
|
|
|
|
|
display: block;
|
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{$ns}ButtonToolbar {
|
2019-12-06 09:58:08 +08:00
|
|
|
|
display: inline-flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.#{$ns}ButtonGroup {
|
2021-04-08 23:19:23 +08:00
|
|
|
|
margin-left: var(--gap-xs);
|
|
|
|
|
margin-top: var(--gap-xs);
|
2019-12-06 09:58:08 +08:00
|
|
|
|
width: auto;
|
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{$ns}ButtonGroup {
|
2023-03-15 20:32:45 +08:00
|
|
|
|
> .#{$ns}Button:first-child,
|
|
|
|
|
> .#{$ns}Badge .#{$ns}Button {
|
2019-12-06 09:58:08 +08:00
|
|
|
|
margin-left: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// cxd的ButtonGroup的is-active和:active样式不一样,这里做个兼容
|
2021-04-28 17:02:00 +08:00
|
|
|
|
.#{$ns}Button--primary.is-active {
|
2020-12-21 10:08:40 +08:00
|
|
|
|
color: var(--ButtonGroup--primary-isActive-color);
|
|
|
|
|
background: var(--ButtonGroup--primary-isActive-bg);
|
2019-12-06 09:58:08 +08:00
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2020-12-21 10:08:40 +08:00
|
|
|
|
> .#{$ns}Button:not(:last-child),
|
2023-03-15 20:32:45 +08:00
|
|
|
|
> .#{$ns}ButtonGroup:not(:last-child) > .#{$ns}Button,
|
|
|
|
|
> .#{$ns}Badge:not(:last-child) > .#{$ns}Button {
|
2020-12-21 10:08:40 +08:00
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2020-12-21 10:08:40 +08:00
|
|
|
|
> .#{$ns}Button:not(:first-child),
|
2023-03-15 20:32:45 +08:00
|
|
|
|
> .#{$ns}ButtonGroup:not(:first-child) > .#{$ns}Button,
|
|
|
|
|
> .#{$ns}Badge:not(:first-child) > .#{$ns}Button {
|
2020-12-21 10:08:40 +08:00
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
|
border-bottom-left-radius: 0;
|
2019-12-06 09:58:08 +08:00
|
|
|
|
}
|
2022-03-02 12:10:33 +08:00
|
|
|
|
|
|
|
|
|
> .#{$ns}ButtonGroup:last-child > .#{$ns}Button:not(:last-child) {
|
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
|
}
|
2019-12-06 09:58:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.#{$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,
|
2023-03-15 20:32:45 +08:00
|
|
|
|
> .#{$ns}Button + .#{$ns}Badge,
|
2019-12-06 09:58:08 +08:00
|
|
|
|
> .#{$ns}ButtonGroup + .#{$ns}Button,
|
2023-03-15 20:32:45 +08:00
|
|
|
|
> .#{$ns}ButtonGroup + .#{$ns}ButtonGroup,
|
|
|
|
|
> .#{$ns}Badge + .#{$ns}Badge,
|
|
|
|
|
> .#{$ns}Badge + .#{$ns}Button {
|
2022-11-11 15:40:46 +08:00
|
|
|
|
margin-top: calc(var(--ButtonGroup-borderWidth) * -1);
|
2019-12-06 09:58:08 +08:00
|
|
|
|
margin-left: 0;
|
|
|
|
|
}
|
|
|
|
|
> .#{$ns}Button:not(:last-child),
|
2023-03-15 20:32:45 +08:00
|
|
|
|
> .#{$ns}ButtonGroup:not(:last-child) > .#{$ns}Button,
|
|
|
|
|
> .#{$ns}Badge:not(:last-child) > .#{$ns}Button {
|
2019-12-06 09:58:08 +08:00
|
|
|
|
border-bottom-left-radius: 0;
|
|
|
|
|
border-bottom-right-radius: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .#{$ns}Button:not(:first-child),
|
2023-03-15 20:32:45 +08:00
|
|
|
|
> .#{$ns}ButtonGroup:not(:first-child) > .btn,
|
|
|
|
|
> .#{$ns}Badge:not(:first-child) > .btn {
|
2019-12-06 09:58:08 +08:00
|
|
|
|
border-top-left-radius: 0;
|
|
|
|
|
border-top-right-radius: 0;
|
|
|
|
|
}
|
2022-03-02 12:10:33 +08:00
|
|
|
|
|
|
|
|
|
/* 修正头尾的圆角 */
|
|
|
|
|
> .#{$ns}Button:first-child,
|
2023-03-15 20:32:45 +08:00
|
|
|
|
> .#{$ns}ButtonGroup:first-child > .#{$ns}Button:first-child,
|
|
|
|
|
> .#{$ns}Badge:first-child > .#{$ns}Button:first-child {
|
|
|
|
|
border-top-right-radius: var(--borders-radius-3);
|
2022-03-02 12:10:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
> .#{$ns}Button:last-child,
|
2023-03-15 20:32:45 +08:00
|
|
|
|
> .#{$ns}ButtonGroup:last-child > .#{$ns}Button:last-child,
|
|
|
|
|
> .#{$ns}Badge:last-child > .#{$ns}Button:last-child {
|
|
|
|
|
border-bottom-left-radius: var(--borders-radius-3);
|
2022-03-02 12:10:33 +08:00
|
|
|
|
}
|
2019-04-30 11:11:25 +08:00
|
|
|
|
}
|
|
|
|
|
|
2021-08-10 13:55:39 +08:00
|
|
|
|
.#{$ns}ButtonGroup--tiled {
|
|
|
|
|
display: flex;
|
2019-04-30 11:11:25 +08:00
|
|
|
|
|
2021-08-10 13:55:39 +08:00
|
|
|
|
.#{$ns}Button,
|
|
|
|
|
.#{$ns}ButtonGroup {
|
|
|
|
|
flex-grow: 1;
|
|
|
|
|
text-align: center;
|
2019-12-06 09:58:08 +08:00
|
|
|
|
}
|
2019-05-15 16:10:20 +08:00
|
|
|
|
}
|