wangzhibo
4 天以前 10595d8632f959d0954d1939243196f4eed02372
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// Mixins
@mixin button-color($type, $color) {
    &.cl-button--#{$type} {
        background-color: $color;
        border-color: $color;
 
        .cl-button__text,
        .cl-button__icon,
        .cl-loading {
            color: #fff;
        }
 
        &[disabled],
        &.is-disabled {
            background-color: $color;
        }
 
        &.is-plain {
            background-color: #fff;
 
            .cl-button__text,
            .cl-button__icon {
                color: rgba($color, 0.8);
            }
            &.is-border {
                border-color: rgba($color, 0.8);
            }
        }
 
        &.button-hover {
            &:not(.is-loading) {
                background-color: rgba($color, 0.8);
                &.is-plain {
                    .cl-button__text,
                    .cl-button__icon {
                        color: #fff;
                    }
                }
            }
        }
    }
}
 
// Styles
.cl-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    white-space: nowrap;
    margin: 0;
    background-color: #fff;
    overflow: visible;
    vertical-align: middle;
    font-size: $cl-font-size;
    border-radius: $cl-button-radius;
    height: $cl-height;
    padding: $cl-button-padding;
    position: relative;
 
    &__text {
        line-height: 1;
        letter-spacing: 1rpx;
    }
 
    &__icon {
        display: flex;
        align-items: center;
        height: 100%;
        line-height: 1;
        margin-right: 10rpx;
 
        image {
            height: 50rpx;
            width: 50rpx;
        }
    }
 
    &::after {
        display: none;
        border-width: 0;
    }
 
    &.button-hover {
        background-color: #f6f7fa;
    }
 
    &--large {
        height: 80rpx;
        padding: 0rpx 38rpx;
        font-size: 30rpx;
    }
 
    &--small {
        font-size: 24rpx;
        height: 48rpx;
        padding: 0rpx 22rpx;
        border-radius: 8rpx;
    }
 
    &.is-border {
        border: $cl-border-width solid $cl-border-color;
    }
 
    &.is-round {
        border-radius: $cl-height !important;
    }
 
    &.is-loading {
        opacity: 0.5;
 
        .cl-loading {
            margin-right: 12rpx;
        }
    }
 
    &.is-fill {
        width: 100%;
    }
 
    &.is-disabled {
        opacity: 0.5;
    }
 
    &.is-bold {
        font-weight: bold;
    }
 
    // Colors
    @include button-color(primary, $cl-color-primary);
    @include button-color(success, $cl-color-success);
    @include button-color(error, $cl-color-error);
    @include button-color(warning, $cl-color-warning);
    @include button-color(info, $cl-color-info);
}
 
// Adjacent selectors
.cl-button + .cl-button,
cl-button + cl-button {
    margin-left: 20rpx;
}