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
.cl-checkbox {
    display: inline-flex;
    align-items: center;
    height: $cl-height;
    margin-right: 60rpx;
    position: relative;
 
    &__input {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        position: relative;
        box-sizing: border-box;
        border: $cl-border-width solid $cl-border-color;
        border-radius: $cl-checkbox-radius;
        height: $cl-checkbox-size;
        width: $cl-checkbox-size;
 
        text {
            font-size: 22rpx;
            position: absolute;
        }
    }
 
    &__label {
        line-height: 1;
        font-size: 28rpx;
        margin-left: 16rpx;
        flex: 1;
        display: -webkit-box;
        overflow: hidden;
        text-overflow: ellipsis;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1;
    }
 
    &.is-checked {
        .cl-checkbox__input {
            background-color: $cl-color-primary;
            border-color: $cl-color-primary;
            color: #fff;
        }
 
        &.is-text {
            .cl-checkbox__label {
                color: $cl-color-primary;
            }
        }
    }
 
    &.is-disabled {
        .cl-checkbox__input {
            background-color: $cl-color-disabled-bg;
            border-color: transparent;
            color: $cl-color-disabled;
        }
 
        .cl-checkbox__label {
            color: $cl-color-disabled;
        }
    }
 
    &.is-text {
        .cl-checkbox__input {
            display: none;
        }
 
        .cl-checkbox__label {
            margin-left: 0;
        }
    }
 
    &.is-border {
        border-radius: $cl-border-radius;
        padding: 0 20rpx;
        margin: 0 20rpx 20rpx 0;
        border: $cl-border-width solid $cl-border-color;
        box-sizing: border-box;
        line-height: normal;
 
        &.is-checked {
            color: $cl-color-primary;
            border-color: $cl-color-primary;
 
            .cl-checkbox__label {
                color: $cl-color-primary;
            }
        }
    }
 
    &.is-bg {
        &.is-checked {
            background-color: $cl-color-primary;
 
            .cl-checkbox__label {
                color: #fff;
            }
        }
    }
 
    &.is-fill {
        margin-right: 0;
        width: 100%;
    }
 
    &.is-round {
        border-radius: $cl-checkbox-size;
 
        .cl-checkbox__input {
            border-radius: 100%;
        }
    }
}
 
/* #ifdef MP */
cl-checkbox {
    display: inline-flex;
}
 
.cl-checkbox-group {
    &.is-fill {
        cl-checkbox {
            display: inline;
        }
    }
}
/* #endif */