antd-mobile
Version:
基于 React 的移动设计规范实现
115 lines (104 loc) • 2.5 kB
text/less
@import '../../style/mixins';
@import '../../style/themes/default';
@buttonPrefixCls: am-button;
.@{buttonPrefixCls} {
position: relative;
display: inline-block;
outline: 0 none;
-webkit-appearance: none;
width: 100%;
padding: 0;
.box-sizing();
text-align: center;
font-size: @button-font-size;
height: @button-height;
line-height: @button-height;
border: 0 none;
.border-radius(@radius-md);
&:after {
position: absolute;
left: 0;
top: 0;
width: 200%;
height: 200%;
content: " ";
.border-radius(@radius-md * 2);
-webkit-transform: scale(.5);
transform: scale(.5);
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
.box-sizing();
}
// default
color: @color-text-base;
background-color: @fill-base;
&:after {
border: @border-width-sm solid @border-color-base;
}
// &:active, // uc browser not work normal
&&-touchFeedback {
background-color: @fill-tap;
}
&-primary {
color: @color-text-base-inverse;
background-color: @brand-primary;
&:after {
border: @border-width-sm solid @brand-primary;
}
// &:active, // uc browser not work normal
&.@{buttonPrefixCls}-touchFeedback {
background-color: @brand-primary-tap;
}
}
&-ghost {
color: @color-link;
background-color: transparent;
&:after {
border: @border-width-md solid @tabs-color;
}
// &:active, // uc browser not work normal
&.@{buttonPrefixCls}-touchFeedback {
color: @color-text-base-inverse;
background-color: @brand-primary-tap;
&:after {
border: @border-width-sm solid @brand-primary;
}
}
}
&-disabled {
&:disabled {
color: @color-text-disabled;
background-color: @fill-disabled;
&:after {
border: 0;
}
}
}
&-inline {
width: auto;
padding: 0 @h-spacing-lg;
}
&-small {
font-size: @button-font-size-sm;
height: @button-height-sm;
line-height: @button-height-sm;
.border-radius(@radius-md);
padding: 0 @h-spacing-sm;
}
&-warning {
color: @brand-warning;
background-color: @fill-base;
&:after {
border: @border-width-sm solid #f88b88;
}
// &:active, // uc browser not work normal
&.@{buttonPrefixCls}-touchFeedback {
background-color: #fdcccb;
}
}
// To ensure that a space will be placed between character and `Icon`.
> .anticon + span,
> span + .anticon {
margin-left: 0.5em;
}
}