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
.cl-badge {
    position: relative;
    vertical-align: middle;
    display: inline-block;
    z-index: 9;
 
    &__content {
        display: inline-flex;
        height: 24rpx;
        min-width: 12rpx;
        align-items: center;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
        font-size: 16rpx;
        font-weight: bold;
        color: #fff;
        position: absolute;
        top: -12rpx;
        right: -12rpx;
        border: 2rpx solid rgba(255, 255, 255, 0.8);
        border-radius: 32rpx;
        padding: 0 6rpx;
    }
 
    &.is-dot {
        .cl-badge__content {
            height: 14rpx;
            width: 14rpx;
            padding: 0;
            border-radius: 50%;
            top: -7rpx;
            right: -7rpx;
        }
    }
 
    @mixin set-color($type, $color) {
        &--#{$type} {
            .cl-badge__content {
                background-color: $color;
            }
 
            &.is-plain {
                .cl-badge__content {
                    background-color: #fff;
                    color: $color;
                    border: $cl-border-width solid currentColor;
                }
            }
        }
    }
 
    @include set-color(primary, $cl-color-primary);
    @include set-color(success, $cl-color-success);
    @include set-color(error, $cl-color-error);
    @include set-color(warning, $cl-color-warning);
    @include set-color(info, $cl-color-info);
}