| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- @import '../style/var';
- .van-button {
- display: inline-block;
- position: relative;
- padding: 0;
- height: @button-default-height;
- line-height: @button-default-line-height;
- font-size: @button-default-font-size;
- border-radius: @button-border-radius;
- text-align: center;
- box-sizing: border-box;
- -webkit-appearance: none;
- -webkit-text-size-adjust: 100%;
- &::before {
- content: " ";
- position: absolute;
- top: 50%;
- left: 50%;
- opacity: 0;
- width: 100%;
- height: 100%;
- border: inherit;
- border-color: @black;
- background-color: @black;
- border-radius: inherit; /* inherit parent's border radius */
- transform: translate(-50%, -50%);
- }
- &:active::before {
- opacity: .1;
- }
- &--loading,
- &--disabled {
- &::before {
- display: none;
- }
- }
- &--default {
- color: @button-default-color;
- background-color: @button-default-background-color;
- border: @button-border-width solid @button-default-border-color;
- }
- &--primary {
- color: @button-primary-color;
- background-color: @button-primary-background-color;
- border: @button-border-width solid @button-primary-border-color;
- }
- &--info {
- color: @button-info-color;
- background-color: @button-info-background-color;
- border: @button-border-width solid @button-info-border-color;
- }
- &--danger {
- color: @button-danger-color;
- background-color: @button-danger-background-color;
- border: @button-border-width solid @button-danger-border-color;
- }
- &--warning {
- color: @button-warning-color;
- background-color: @button-warning-background-color;
- border: @button-border-width solid @button-warning-border-color;
- }
- &--plain {
- background-color: @button-plain-background-color;
- &.van-button--primary {
- color: @button-primary-background-color;
- }
- &.van-button--info {
- color: @button-info-background-color;
- }
- &.van-button--danger {
- color: @button-danger-background-color;
- }
- &.van-button--warning {
- color: @button-warning-background-color;
- }
- }
- &--large {
- width: 100%;
- height: @button-large-height;
- line-height: @button-large-line-height;
- }
- &--normal {
- padding: 0 15px;
- font-size: @button-normal-font-size;
- }
- &--small {
- padding: 0 8px;
- height: @button-small-height;
- min-width: @button-small-min-width;
- font-size: @button-small-font-size;
- line-height: @button-small-line-height;
- }
- &--loading {
- .van-loading {
- display: inline-block;
- }
- }
- &--mini {
- display: inline-block;
- height: @button-mini-height;
- min-width: @button-mini-min-width;
- font-size: @button-mini-font-size;
- line-height: @button-mini-line-height;
- & + .van-button--mini {
- margin-left: 5px;
- }
- }
- &--block {
- width: 100%;
- display: block;
- }
- &--bottom-action {
- border: 0;
- width: 100%;
- height: 50px;
- font-size: 16px;
- line-height: 50px;
- border-radius: 0;
- color: @button-bottom-action-default-color;
- background-color: @button-bottom-action-default-background-color;
- &.van-button--primary {
- background-color: @button-bottom-action-primary-background-color;
- }
- }
- &--disabled {
- opacity: @button-disabled-opacity;
- }
- &--round {
- border-radius: @button-round-border-radius;
- }
- &--square {
- border-radius: 0;
- }
- &__loading-text {
- margin-left: 5px;
- display: inline-block;
- vertical-align: middle;
- }
- &--hairline {
- border-width: 0;
- &::after {
- border-color: inherit;
- border-radius: @button-border-radius * 2;
- }
- &.van-button--round::after {
- border-radius: @button-round-border-radius;
- }
-
- &.van-button--square::after {
- border-radius: 0;
- }
- }
- }
|