Skip to content

Commit dcdefa9

Browse files
committed
chore: Help / Settings / Select / RippleButton 样式嵌套化
把 Help / Settings / Select / RippleButton 四个文件的 style 块从平铺 CSS 改写为 SCSS 嵌套形式:父-子选择器用 & 引用,状态变体(&:hover / &.active / &.primary)下嵌;行注释从 /* */ 改为 //;保持视觉与行为完全一致,构建产物大小不变。Popup.vue 的样式较多,留下个 patch 再处理。将版本号提升到 1.3.1。
1 parent 73be6cf commit dcdefa9

5 files changed

Lines changed: 297 additions & 323 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stackprism",
33
"private": true,
4-
"version": "1.3.0",
4+
"version": "1.3.1",
55
"type": "module",
66
"description": "StackPrism 用于检测网页前端、后端、CDN、SaaS、广告营销、统计、登录、支付、网站程序和主题模板线索。",
77
"scripts": {

src/ui/components/RippleButton.vue

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,44 +66,44 @@
6666

6767
<style lang="scss" scoped>
6868
.sp-rb {
69-
position: relative;
70-
overflow: hidden;
7169
isolation: isolate;
70+
overflow: hidden;
71+
position: relative;
72+
73+
&--primary .sp-rb-ripple {
74+
background: #ffffff;
75+
opacity: 0.28;
76+
}
7277
}
7378
7479
.sp-rb-content {
75-
position: relative;
76-
z-index: 1;
77-
display: inline-flex;
7880
align-items: center;
81+
display: inline-flex;
7982
gap: 6px;
83+
position: relative;
84+
z-index: 1;
8085
}
8186
8287
.sp-rb-ripples {
83-
position: absolute;
8488
inset: 0;
8589
pointer-events: none;
90+
position: absolute;
8691
z-index: 0;
8792
}
8893
8994
.sp-rb-ripple {
90-
position: absolute;
91-
border-radius: 50%;
95+
animation: sp-rb-spread 420ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
9296
background: currentColor;
97+
border-radius: 50%;
9398
opacity: 0.18;
99+
position: absolute;
94100
transform: scale(0);
95-
animation: sp-rb-spread 420ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
96-
}
97-
98-
.sp-rb--primary .sp-rb-ripple {
99-
background: #ffffff;
100-
opacity: 0.28;
101101
}
102102
103103
@keyframes sp-rb-spread {
104104
to {
105-
transform: scale(1);
106105
opacity: 0;
106+
transform: scale(1);
107107
}
108108
}
109109

src/ui/components/Select.vue

Lines changed: 47 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,15 @@
248248
display: block;
249249
position: relative;
250250
width: 100%;
251+
252+
&.open .sp-select-trigger {
253+
border-color: var(--accent);
254+
outline: none;
255+
}
256+
257+
&.open .sp-select-chevron {
258+
color: var(--accent);
259+
}
251260
}
252261
253262
.sp-select-trigger {
@@ -269,20 +278,23 @@
269278
border-color 0.15s ease,
270279
color 0.15s ease;
271280
width: 100%;
272-
}
273281
274-
.sp-select-trigger:hover:not(:disabled):not(.disabled),
275-
.sp-select.open .sp-select-trigger,
276-
.sp-select-trigger:focus-visible,
277-
.sp-select-trigger:focus-within {
278-
border-color: var(--accent);
279-
outline: none;
280-
}
282+
&:hover:not(:disabled):not(.disabled),
283+
&:focus-visible,
284+
&:focus-within {
285+
border-color: var(--accent);
286+
outline: none;
287+
}
281288
282-
.sp-select-trigger:disabled,
283-
.sp-select-trigger.disabled {
284-
cursor: not-allowed;
285-
opacity: 0.6;
289+
&:hover:not(:disabled):not(.disabled) .sp-select-chevron {
290+
color: var(--accent);
291+
}
292+
293+
&:disabled,
294+
&.disabled {
295+
cursor: not-allowed;
296+
opacity: 0.6;
297+
}
286298
}
287299
288300
.sp-select-input-wrap {
@@ -299,10 +311,10 @@
299311
min-width: 0;
300312
outline: none;
301313
padding: 7px 0 7px 10px;
302-
}
303314
304-
.sp-select-input::placeholder {
305-
color: var(--muted);
315+
&::placeholder {
316+
color: var(--muted);
317+
}
306318
}
307319
308320
.sp-chevron-btn {
@@ -316,10 +328,10 @@
316328
justify-content: center;
317329
padding: 0;
318330
width: 24px;
319-
}
320331
321-
.sp-chevron-btn:disabled {
322-
cursor: not-allowed;
332+
&:disabled {
333+
cursor: not-allowed;
334+
}
323335
}
324336
325337
.sp-clear-btn,
@@ -339,12 +351,11 @@
339351
background 0.15s ease,
340352
color 0.15s ease;
341353
width: 18px;
342-
}
343354
344-
.sp-clear-btn:hover,
345-
.sp-clear-btn-input:hover {
346-
background: var(--accent-soft);
347-
color: var(--accent);
355+
&:hover {
356+
background: var(--accent-soft);
357+
color: var(--accent);
358+
}
348359
}
349360
350361
.sp-select-value {
@@ -353,10 +364,10 @@
353364
overflow: hidden;
354365
text-overflow: ellipsis;
355366
white-space: nowrap;
356-
}
357367
358-
.sp-select-value.placeholder {
359-
color: var(--muted);
368+
&.placeholder {
369+
color: var(--muted);
370+
}
360371
}
361372
362373
.sp-select-chevron {
@@ -365,15 +376,10 @@
365376
transition:
366377
color 0.15s ease,
367378
transform 0.2s ease;
368-
}
369379
370-
.sp-select-chevron.flipped {
371-
transform: rotate(180deg);
372-
}
373-
374-
.sp-select.open .sp-select-chevron,
375-
.sp-select-trigger:hover:not(:disabled):not(.disabled) .sp-select-chevron {
376-
color: var(--accent);
380+
&.flipped {
381+
transform: rotate(180deg);
382+
}
377383
}
378384
379385
.sp-select-list {
@@ -406,15 +412,15 @@
406412
transition:
407413
background 0.12s ease,
408414
color 0.12s ease;
409-
}
410415
411-
.sp-select-option.focused {
412-
background: var(--accent-soft);
413-
}
416+
&.focused {
417+
background: var(--accent-soft);
418+
}
414419
415-
.sp-select-option.selected {
416-
color: var(--accent);
417-
font-weight: 500;
420+
&.selected {
421+
color: var(--accent);
422+
font-weight: 500;
423+
}
418424
}
419425
420426
.sp-fade-enter-from,

0 commit comments

Comments
 (0)