2022-04-11 11:13:16 +08:00
|
|
|
@import '../../style/themes/index';
|
|
|
|
@import '../../style/mixins/index';
|
|
|
|
@import './mixins.less';
|
|
|
|
|
|
|
|
@segmented-prefix-cls: ~'@{ant-prefix}-segmented';
|
|
|
|
|
2022-04-29 15:11:42 +08:00
|
|
|
@segmented-container-padding: 2px;
|
|
|
|
|
2022-04-11 11:13:16 +08:00
|
|
|
.@{segmented-prefix-cls} {
|
|
|
|
.reset-component();
|
2022-04-29 15:11:42 +08:00
|
|
|
display: inline-block;
|
|
|
|
padding: @segmented-container-padding;
|
2022-04-11 11:13:16 +08:00
|
|
|
color: @segmented-label-color;
|
|
|
|
background-color: @segmented-bg;
|
2022-05-05 14:09:27 +08:00
|
|
|
border-radius: @border-radius-base;
|
2022-04-11 11:13:16 +08:00
|
|
|
transition: all 0.3s @ease-in-out;
|
|
|
|
|
2022-04-29 15:11:42 +08:00
|
|
|
&-group {
|
|
|
|
position: relative;
|
|
|
|
display: flex;
|
|
|
|
align-items: stretch;
|
|
|
|
justify-items: flex-start;
|
|
|
|
width: 100%;
|
2022-04-11 11:13:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// block styles
|
|
|
|
&&-block {
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
|
|
|
|
&&-block &-item {
|
|
|
|
flex: 1;
|
|
|
|
min-width: 0;
|
|
|
|
}
|
|
|
|
|
2022-04-29 15:11:42 +08:00
|
|
|
// hover/focus styles
|
|
|
|
&:not(&-disabled) {
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
background-color: @segmented-hover-bg;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-04-11 11:13:16 +08:00
|
|
|
// item styles
|
|
|
|
&-item {
|
|
|
|
position: relative;
|
|
|
|
text-align: center;
|
|
|
|
cursor: pointer;
|
|
|
|
transition: color 0.3s @ease-in-out;
|
|
|
|
|
|
|
|
&-selected {
|
|
|
|
.segmented-item-selected();
|
|
|
|
color: @segmented-label-hover-color;
|
|
|
|
}
|
|
|
|
|
|
|
|
&:hover,
|
|
|
|
&:focus {
|
|
|
|
color: @segmented-label-hover-color;
|
|
|
|
}
|
|
|
|
|
|
|
|
&-label {
|
2022-04-29 15:11:42 +08:00
|
|
|
min-height: @input-height-base - @segmented-container-padding * 2;
|
|
|
|
padding: 0 @input-padding-horizontal-base;
|
|
|
|
line-height: @input-height-base - @segmented-container-padding * 2;
|
2022-04-11 11:13:16 +08:00
|
|
|
.segmented-text-ellipsis();
|
|
|
|
}
|
|
|
|
|
|
|
|
// syntactic sugar to add `icon` for Segmented Item
|
2022-04-28 19:39:52 +08:00
|
|
|
&-icon + * {
|
2022-05-05 14:09:27 +08:00
|
|
|
margin-left: @margin-sm / 2;
|
2022-04-11 11:13:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&-input {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 0;
|
|
|
|
height: 0;
|
|
|
|
opacity: 0;
|
|
|
|
pointer-events: none;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// size styles
|
|
|
|
&&-lg &-item-label {
|
2022-04-29 15:11:42 +08:00
|
|
|
min-height: @input-height-lg - @segmented-container-padding * 2;
|
|
|
|
padding: 0 @input-padding-horizontal-lg;
|
2022-04-11 11:13:16 +08:00
|
|
|
font-size: @font-size-lg;
|
2022-04-29 15:11:42 +08:00
|
|
|
line-height: @input-height-lg - @segmented-container-padding * 2;
|
2022-04-11 11:13:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
&&-sm &-item-label {
|
2022-04-29 15:11:42 +08:00
|
|
|
min-height: @input-height-sm - @segmented-container-padding * 2;
|
|
|
|
padding: 0 @input-padding-horizontal-sm;
|
|
|
|
line-height: @input-height-sm - @segmented-container-padding * 2;
|
2022-04-11 11:13:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// disabled styles
|
|
|
|
&-item-disabled {
|
|
|
|
.segmented-disabled-item();
|
|
|
|
}
|
|
|
|
|
|
|
|
// thumb styles
|
|
|
|
&-thumb {
|
|
|
|
.segmented-item-selected();
|
|
|
|
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
left: 0;
|
|
|
|
width: 0;
|
|
|
|
height: 100%;
|
|
|
|
padding: 4px 0;
|
|
|
|
}
|
|
|
|
|
2022-04-29 15:11:42 +08:00
|
|
|
// transition effect when `appear-active`
|
|
|
|
&-thumb-motion-appear-active {
|
2022-04-11 11:13:16 +08:00
|
|
|
transition: transform 0.3s @ease-in-out, width 0.3s @ease-in-out;
|
|
|
|
will-change: transform, width;
|
|
|
|
}
|
|
|
|
}
|
2022-04-23 16:53:07 +08:00
|
|
|
|
|
|
|
@import './rtl';
|