antd-mobile
Version:
基于 React 的移动设计规范实现
173 lines (158 loc) • 3.45 kB
text/less
@import '../../style/themes/default';
@import "../../style/mixins";
@stepperPrefixCls: am-stepper;
.iconfont-mixin() {
display: inline-block;
font-style: normal;
vertical-align: baseline;
text-align: center;
text-transform: none;
text-rendering: auto;
&:before {
display: block;
font-family: "anticon" ;
}
}
.@{stepperPrefixCls} {
position: relative;
margin: 0;
padding: 4px 0;
display: inline-block;
box-sizing: content-box;
width: @button-height-sm * 2 + 6;
height: @button-height-sm;
font-size: @font-size-base;
line-height: @button-height-sm;
vertical-align: middle;
overflow: hidden;
&-handler-wrap {
position: absolute;
width: 100%;
}
&-handler,
&-handler-up-inner,
&-handler-down-inner {
width: @button-height-sm;
height: @button-height-sm;
line-height: @button-height-sm;
}
&-handler {
text-align: center;
border: @border-width-md solid @input-color-icon;
border-radius: @radius-md;
overflow: hidden;
color: @color-text-base;
position: absolute;
display: inline-block;
box-sizing: content-box;
&:active {
z-index: 2;
}
&-up:active,
&-down:active {
background: @fill-tap;
}
}
&-handler-up {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
&-handler-down {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
&-handler-up-inner,
&-handler-down-inner {
.iconfont-mixin();
user-select: none;
right: 4px;
color: @color-text-base;
}
&-input-wrap {
display: none;
width: 100%;
height: @button-height-sm;
line-height: @button-height-sm;
text-align: center;
overflow: hidden;
}
&-input {
display: none;
width: @button-height-sm * 2;
font-size: @font-size-subhead;
color: @color-text-base;
text-align: center;
border: 0;
padding: 0;
background: none;
vertical-align: middle;
&[disabled] {
opacity: 1;
color: @color-text-base;
}
}
&.showNumber {
width: @button-height-sm * 2 + 112;
.@{stepperPrefixCls}-input-wrap {
display: inline-block;
}
.@{stepperPrefixCls}-input {
display: inline-block;
}
.@{stepperPrefixCls}-handler-up {
border-top-left-radius: @radius-md;
border-bottom-left-radius: @radius-md;
}
.@{stepperPrefixCls}-handler-down {
border-top-right-radius: @radius-md;
border-bottom-right-radius: @radius-md;
border-right: @border-width-md solid @input-color-icon;
}
.@{stepperPrefixCls}-handler-down-disabled {
right: -2px;
}
}
&-handler-up {
cursor: pointer;
right: 0;
&-inner {
&:before {
text-align: center;
content: "\E63E";
}
}
}
&-handler-down {
cursor: pointer;
left: 0;
&-inner {
&:before {
text-align: center;
content: "\E63B";
}
}
}
&-handler-down-disabled,
&-handler-up-disabled {
opacity: @opacity-disabled;
&:active,
&:active {
background: none;
}
}
&-disabled {
.@{stepperPrefixCls}-handler-down,
.@{stepperPrefixCls}-handler-up {
opacity: @opacity-disabled;
background: none;
}
}
&-disabled {
.@{stepperPrefixCls}-handler {
opacity: @opacity-disabled;
}
.@{stepperPrefixCls}-input-wrap {
opacity: @opacity-disabled;
}
}
}