zhangxiao
2024-08-20 e47b788ff5f5c699c682999c95da17eb284ca21d
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
@mixin border-bottom-1px($color) {
    position: relative;
    &::after {
        position: absolute;
        box-sizing: border-box;
        content: " ";
        pointer-events: none;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 1px;
        background-color: $color;
        @media (-webkit-min-device-pixel-ratio: 2) {
            transform: scaleY(0.5);
        }
    }
}
 
@mixin border-top-1px($color) {
    position: relative;
    &::after {
        position: absolute;
        box-sizing: border-box;
        content: " ";
        pointer-events: none;
        right: 0;
        top: 0;
        left: 0;
        width: 100%;
        height: 1px;
        background-color: $color;
        @media (-webkit-min-device-pixel-ratio: 2) {
            transform: scaleY(0.5);
        }
    }
}
 
@mixin border($color, $radius) {
    position: relative;
    &::after {
        position: absolute;
        box-sizing: border-box;
        content: " ";
        pointer-events: none;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 200%;
        height: 200%;
        position: absolute;
        top: 0;
        left: 0;
        border: 1px solid red;
        border-radius: 4px;
        -webkit-transform: scale(0.5, 0.5);
        transform: scale(0.5, 0.5);
        transform-origin: top left;
        -webkit-transform-origin: top left;
        border-radius: $radius;
        @media (-webkit-min-device-pixel-ratio: 2) {
            transform: scaleY(0.5);
        }
    }
}
 
@mixin text-overflow() {
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}
 
@mixin text-overflow-line($line-number: 2) {
    display: -webkit-box !important;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: $line-number;
    /*! autoprefixer: ignore next */
    -webkit-box-orient: vertical;
}
 
@mixin flex-center($direction: row) {
    display: flex;
    flex-direction: $direction;
    align-items: center;
    justify-content: center;
}
 
// fix定位到页面底部
@mixin fix-bottom($height) {
    position: fixed;
    bottom: calc(constant(safe-area-inset-bottom) + $height);
    bottom: calc(env(safe-area-inset-bottom) + $height);
}
 
@mixin scroll-y($width: 4) {
    &::-webkit-scrollbar {
        width: #{$width}px;
    }
 
    &::-webkit-scrollbar-thumb {
        border-radius: 5px;
        background: rgb(var(--gray-6));
    }
 
    &::-webkit-scrollbar-track {
        background: transparent;
    }
}
 
@mixin scroll-x($height: 4) {
    &::-webkit-scrollbar {
        height: #{$height}px;
    }
    &::-webkit-scrollbar-thumb {
        border-radius: 5px;
        background: rgb(var(--gray-6));
    }
 
    &::-webkit-scrollbar-track {
        background: transparent;
    }
}