antd-mobile
Version:
基于 React 的移动设计规范实现
125 lines (104 loc) • 2.29 kB
text/less
@import '../../style/themes/default';
@import '../../style/mixins';
@sliderPrefixCls: am-slider;
.borderBox() {
box-sizing: border-box;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0); // remove tap highlight color for mobile safari
}
.@{sliderPrefixCls} {
position: relative;
margin: 32px 0;
&-rail {
position: absolute;
width: 100%;
background-color: @border-color-base;
height: 4px;
box-sizing: border-box;
}
&-wrapper {
padding: 0 32px;
}
&-track {
position: absolute;
left: 0;
height: 4px;
border-radius: @radius-xs;
background-color: @brand-primary;
}
&-handle {
position: absolute;
margin-left: -24px;
margin-top: -24px;
width: 44px;
height: 44px;
cursor: pointer;
border-radius: @radius-circle;
border: @border-width-lg solid @brand-primary;
background-color: @fill-base;
box-sizing: border-box;
&:focus {
background-color: tint(@brand-primary, 20%);
}
&:active {
background-color: tint(@brand-primary, 20%);
box-shadow: 0 0 5px tint(@brand-primary, 20%);
}
}
&-mark {
position: absolute;
top: 40px;
left: 0;
width: 100%;
font-size: @font-size-caption-sm;
}
&-mark-text {
position: absolute;
display: inline-block;
vertical-align: middle;
text-align: center;
cursor: pointer;
color: @color-text-base;
&-active {
opacity: @opacity-disabled;
}
}
&-step {
position: absolute;
width: 100%;
height: 8px;
background: transparent;
}
&-dot {
position: absolute;
bottom: -10px;
margin-left: -8px;
width: 24px;
height: 24px;
border: @border-width-lg solid @border-color-base;
background-color: @fill-base;
cursor: pointer;
border-radius: @radius-circle;
vertical-align: middle;
&:first-child {
margin-left: -8px;
}
&:last-child {
margin-left: -8px;
}
&-active {
border-color: @brand-primary;
}
}
&-disabled {
opacity: @opacity-disabled;
.@{sliderPrefixCls}-track {
height: 4px;
}
.@{sliderPrefixCls}-handle,
.@{sliderPrefixCls}-mark-text,
.@{sliderPrefixCls}-dot {
cursor: not-allowed;
box-shadow: none;
}
}
}