快乐的昕的电脑
2025-11-24 6fa86a03230c06b2bc5cfbf4023f5232cd89a1ca
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
@import './design-tokens.scss';
 
/**
 * 响应式断点
 */
@mixin respond($target) {
  @if $target == compact {
    @media (max-width: $screen-compact) {
      @content;
    }
  } @else if $target == wide {
    @media (min-width: $screen-wide) {
      @content;
    }
  }
}
 
/**
 * 通用文本溢出
 */
@mixin text-ellipsis($lines: 1) {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: $lines;
  -webkit-box-orient: vertical;
}
 
/**
 * 平滑字体与抗锯齿
 */
@mixin smooth-font {
  font-family: $font-family-base;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
 
/**
 * 滚动容器
 */
@mixin scroll-y {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
 
  &::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
 
  &::-webkit-scrollbar-thumb {
    background-color: rgba(27, 36, 51, 0.25);
    border-radius: $radius-sm;
  }
}
 
/**
 * 焦点高亮,提升可操作性
 */
@mixin focus-ring {
  outline: none;
  box-shadow: 0 0 0 2px rgba(27, 127, 233, 0.2);
}
 
/**
 * Flex 工具
 */
@mixin flex-center($direction: row, $gap: $spacing-sm) {
  display: flex;
  flex-direction: $direction;
  align-items: center;
  justify-content: center;
  gap: $gap;
}