-
zhangwei
2025-06-18 9143fcdfc8b0c934d17523d6ab9fd27f316f24c5
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
.el-form-item__label {
  font-weight: 700;
}
 
.el-breadcrumb__inner,
.el-breadcrumb__inner a {
  font-weight: 400 !important;
}
 
.el-dropdown-menu {
  padding: 0 !important;
}
 
.is-dark {
  z-index: 9999 !important;
}
 
/* 重置 el-button 中 icon 的 margin */
.reset-margin [class*="el-icon"] + span {
  margin-left: 2px !important;
}
 
/* 自定义 popover 的类名 */
.pure-popper {
  padding: 0 !important;
}
 
/* nprogress 适配 element-plus 的主题色 */
#nprogress {
  & .bar {
    background-color: var(--el-color-primary) !important;
  }
 
  & .peg {
    box-shadow:
      0 0 10px var(--el-color-primary),
      0 0 5px var(--el-color-primary) !important;
  }
 
  & .spinner-icon {
    border-top-color: var(--el-color-primary);
    border-left-color: var(--el-color-primary);
  }
}
 
.pure-dialog {
  .el-dialog__header.show-close {
    padding-right: 16px;
  }
 
  .el-dialog__headerbtn {
    top: 16px;
    right: 12px;
    width: 24px;
    height: 24px;
  }
 
  .pure-dialog-svg {
    color: var(--el-color-info);
  }
 
  .el-dialog__footer {
    padding-top: 0;
  }
}
 
/* 全局覆盖element-plus的el-tour、el-dialog、el-drawer、el-message-box、el-notification组件右上角关闭图标和el-upload上传文件列表右侧关闭图标的样式,表现更鲜明 */
.el-dialog__headerbtn,
.el-message-box__headerbtn {
  &:hover {
    .el-dialog__close {
      color: var(--el-color-info) !important;
    }
  }
}
 
.el-icon {
  &.el-tour__close,
  &.el-dialog__close,
  &.el-drawer__close,
  &.el-message-box__close,
  &.el-notification__closeBtn,
  .el-upload-list__item.is-ready &.el-icon--close {
    width: 24px;
    height: 24px;
    outline: none;
    border-radius: 4px;
    transition:
      background-color 0.2s,
      color 0.2s;
 
    &:hover {
      color: rgb(0 0 0 / 88%) !important;
      text-decoration: none;
      background-color: rgb(0 0 0 / 6%);
 
      .pure-dialog-svg {
        color: rgb(0 0 0 / 88%) !important;
      }
    }
  }
}
 
/* 克隆并自定义 ElMessage 样式,不会影响 ElMessage 原本样式,在 src/utils/message.ts 中调用自定义样式 ElMessage 方法即可,整体暗色风格在 src/style/dark.scss 文件进行了适配 */
.pure-message {
  background: #fff !important;
  border-width: 0 !important;
  box-shadow:
    0 3px 6px -4px #0000001f,
    0 6px 16px #00000014,
    0 9px 28px 8px #0000000d !important;
 
  & .el-message__content {
    color: #000000d9 !important;
    pointer-events: all !important;
    background-image: initial !important;
  }
 
  & .el-message__closeBtn {
    outline: none;
    border-radius: 4px;
    transition:
      background-color 0.2s,
      color 0.2s;
 
    &:hover {
      background-color: rgb(0 0 0 / 6%);
    }
  }
}
 
/* 自定义菜单搜索样式 */
.pure-search-dialog {
  @media screen and (width > 760px) and (width <= 940px) {
    .el-input__inner {
      font-size: 12px;
    }
  }
 
  @media screen and (width <= 470px) {
    .el-input__inner {
      font-size: 12px;
    }
  }
 
  .el-dialog__header {
    display: none;
  }
 
  .el-input__inner {
    font-size: 1.2em;
  }
 
  .el-dialog__footer {
    width: calc(100% + 32px);
    padding: 10px 20px;
    margin: auto -16px -16px;
    box-shadow:
      0 -1px 0 0 #e0e3e8,
      0 -3px 6px 0 rgb(69 98 155 / 12%);
  }
}
 
/* 仿 el-scrollbar 滚动条样式,支持大多数浏览器,如Chrome、Edge、Firefox、Safari等。整体暗色风格在 src/style/dark.scss 文件进行了适配 */
.pure-scrollbar {
  scrollbar-color: rgb(221 222 224) transparent; /* 滑块颜色、轨道颜色 */
 
  /* Firefox */
  scrollbar-width: thin; /* 可选值为 'auto', 'thin', 'none' */
  ::-webkit-scrollbar {
    width: 6px; /* 滚动条宽度 */
  }
 
  /* 滚动条轨道 */
  ::-webkit-scrollbar-track {
    background: transparent; /* 轨道颜色 */
  }
 
  /* 滚动条滑块 */
  ::-webkit-scrollbar-thumb {
    background-color: rgb(221 222 224);
    border-radius: 4px;
  }
 
  /* 滚动条滑块:hover状态 */
  ::-webkit-scrollbar-thumb:hover {
    background: rgb(199 201 203); /* 滑块hover颜色 */
  }
}