@xingwangzhe/stalux 1.34.0 → 1.35.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,27 +17,26 @@
17
17
  text-align: center;
18
18
  margin: 0 0 1.5rem 0;
19
19
  font-size: 2rem;
20
- background: linear-gradient(90deg, var(--white-90p), rgba(var(--waline-accent-rgb), 0.9));
21
- -webkit-background-clip: text;
22
- -webkit-text-fill-color: transparent;
20
+ background: linear-gradient(90deg, var(--white-90p), rgb(var(--waline-accent-rgb) / 0.9));
21
+ color: transparent;
23
22
  background-clip: text;
24
23
  }
25
24
 
26
25
  /* Waline根元素自定义 */
27
26
  .wl-panel {
28
- background-color: rgba(17, 17, 17, 0.3);
27
+ background-color: rgb(17 17 17 / 0.3);
29
28
  border-radius: 12px;
30
29
  padding: 1rem;
31
- border: 1px solid rgba(255, 255, 255, 0.1);
30
+ border: 1px solid rgb(255 255 255 / 0.1);
32
31
  margin-bottom: 1.5rem;
33
32
  }
34
33
 
35
34
  /* 修改输入框样式 */
36
35
  .wl-editor,
37
36
  .wl-input {
38
- background-color: rgba(17, 17, 17, 0.5) !important;
37
+ background-color: rgb(17 17 17 / 0.5) !important;
39
38
  color: var(--white-90p) !important;
40
- border: 1px solid rgba(100, 100, 100, 0.3) !important;
39
+ border: 1px solid rgb(100 100 100 / 0.3) !important;
41
40
  border-radius: 8px;
42
41
  transition:
43
42
  background-color 200ms ease,
@@ -49,8 +48,8 @@
49
48
  /* 输入框焦点状态 */
50
49
  .wl-editor:focus,
51
50
  .wl-input:focus {
52
- border-color: rgba(var(--waline-accent-rgb), 0.5) !important;
53
- box-shadow: 0 0 5px rgba(var(--waline-accent-rgb), 0.3) !important;
51
+ border-color: rgb(var(--waline-accent-rgb) / 0.5) !important;
52
+ box-shadow: 0 0 5px rgb(var(--waline-accent-rgb) / 0.3) !important;
54
53
  outline: none;
55
54
  }
56
55
 
@@ -70,7 +69,7 @@
70
69
  }
71
70
  .wl-btn {
72
71
  cursor: pointer;
73
- background: rgba(var(--waline-accent-rgb), 0.6) !important;
72
+ background: rgb(var(--waline-accent-rgb) / 0.6) !important;
74
73
  color: var(--white-full) !important;
75
74
  border: none !important;
76
75
  border-radius: 6px;
@@ -83,18 +82,18 @@
83
82
  }
84
83
  @media (hover: hover) and (pointer: fine) {
85
84
  .wl-btn:hover {
86
- background: rgba(var(--waline-accent-rgb), 0.7) !important;
85
+ background: rgb(var(--waline-accent-rgb) / 0.7) !important;
87
86
  transform: none;
88
87
  box-shadow: none !important;
89
88
  }
90
89
  }
91
90
 
92
91
  .wl-btn.primary {
93
- background: rgba(var(--waline-accent-rgb), 0.6) !important;
92
+ background: rgb(var(--waline-accent-rgb) / 0.6) !important;
94
93
  }
95
94
  @media (hover: hover) and (pointer: fine) {
96
95
  .wl-btn.primary:hover {
97
- background: rgba(var(--waline-accent-rgb), 0.7) !important;
96
+ background: rgb(var(--waline-accent-rgb) / 0.7) !important;
98
97
  transform: none;
99
98
  box-shadow: none !important;
100
99
  }
@@ -108,11 +107,11 @@
108
107
 
109
108
  /* 评论卡片样式 */
110
109
  .wl-card {
111
- background-color: rgba(17, 17, 17, 0.05) !important;
110
+ background-color: rgb(17 17 17 / 0.05) !important;
112
111
  border-radius: 12px;
113
112
  padding: 1.2rem;
114
113
  margin-top: 1.2rem;
115
- border: 1px solid rgba(70, 70, 70, 0.2) !important;
114
+ border: 1px solid rgb(70 70 70 / 0.2) !important;
116
115
  transition:
117
116
  background-color 200ms ease,
118
117
  border-color 200ms ease,
@@ -122,14 +121,14 @@
122
121
  @media (hover: hover) and (pointer: fine) {
123
122
  .wl-card:hover {
124
123
  transform: none;
125
- box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
126
- border-color: rgba(var(--waline-accent-rgb), 0.3) !important;
124
+ box-shadow: 0 10px 24px rgb(0 0 0 / 0.08);
125
+ border-color: rgb(var(--waline-accent-rgb) / 0.3) !important;
127
126
  }
128
127
  }
129
128
 
130
129
  /* 修改用户名样式 */
131
130
  .wl-nick {
132
- color: rgba(var(--waline-accent-rgb), 0.95) !important;
131
+ color: rgb(var(--waline-accent-rgb) / 0.95) !important;
133
132
  font-weight: 600;
134
133
  transition:
135
134
  background-color 180ms ease,
@@ -138,7 +137,7 @@
138
137
  }
139
138
  @media (hover: hover) and (pointer: fine) {
140
139
  .wl-nick:hover {
141
- color: rgba(var(--waline-accent-rgb), 1) !important;
140
+ color: rgb(var(--waline-accent-rgb) / 1) !important;
142
141
  }
143
142
  }
144
143
 
@@ -147,7 +146,7 @@
147
146
  color: var(--white-90p);
148
147
  line-height: 1.7;
149
148
  margin: 0.8rem 0;
150
- word-break: break-word;
149
+ overflow-wrap: anywhere;
151
150
  }
152
151
 
153
152
  /* 回复按钮样式 */
@@ -168,10 +167,10 @@
168
167
  /* 表情面板样式 */
169
168
  .wl-emoji-popup,
170
169
  .wl-gif-popup {
171
- background-color: rgba(25, 25, 25, 0.95) !important;
172
- border: 1px solid rgba(70, 70, 70, 0.3) !important;
170
+ background-color: rgb(25 25 25 / 0.95) !important;
171
+ border: 1px solid rgb(70 70 70 / 0.3) !important;
173
172
  border-radius: 10px;
174
- box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
173
+ box-shadow: 0 8px 24px rgb(0 0 0 / 0.2);
175
174
  backdrop-filter: blur(10px);
176
175
  }
177
176
 
@@ -185,7 +184,7 @@
185
184
  }
186
185
  @media (hover: hover) and (pointer: fine) {
187
186
  .wl-emoji-popup button:hover {
188
- background-color: rgba(var(--waline-accent-rgb), 0.2);
187
+ background-color: rgb(var(--waline-accent-rgb) / 0.2);
189
188
  transform: scale(1.05);
190
189
  }
191
190
  }
@@ -193,11 +192,11 @@
193
192
  /* 文章评价反应区域 */
194
193
  .wl-reaction {
195
194
  text-align: center;
196
- background-color: rgba(17, 17, 17, 0.3);
195
+ background-color: rgb(17 17 17 / 0.3);
197
196
  border-radius: 12px;
198
197
  padding: 1rem;
199
198
  margin-bottom: 1.5rem;
200
- border: 1px solid rgba(70, 70, 70, 0.2);
199
+ border: 1px solid rgb(70 70 70 / 0.2);
201
200
  }
202
201
 
203
202
  .wl-reaction-title {
@@ -214,7 +213,7 @@
214
213
 
215
214
  .wl-reaction-item {
216
215
  cursor: pointer;
217
- background-color: rgba(30, 30, 30, 0.5) !important;
216
+ background-color: rgb(30 30 30 / 0.5) !important;
218
217
  border-radius: 8px;
219
218
  margin: 5px;
220
219
  transition:
@@ -222,14 +221,14 @@
222
221
  border-color 200ms ease,
223
222
  box-shadow 200ms ease,
224
223
  color 200ms ease;
225
- border: 1px solid rgba(70, 70, 70, 0.2) !important;
224
+ border: 1px solid rgb(70 70 70 / 0.2) !important;
226
225
  }
227
226
  @media (hover: hover) and (pointer: fine) {
228
227
  .wl-reaction-item:hover {
229
228
  transform: none;
230
- box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
231
- background-color: rgba(40, 40, 40, 0.8) !important;
232
- border-color: rgba(var(--waline-accent-rgb), 0.3) !important;
229
+ box-shadow: 0 5px 10px rgb(0 0 0 / 0.2);
230
+ background-color: rgb(40 40 40 / 0.8) !important;
231
+ border-color: rgb(var(--waline-accent-rgb) / 0.3) !important;
233
232
  }
234
233
  }
235
234
 
@@ -249,7 +248,7 @@
249
248
  .wl-reaction-votes {
250
249
  font-size: 0.8rem;
251
250
  padding: 5px 0;
252
- background-color: rgba(var(--waline-accent-rgb), 0.7);
251
+ background-color: rgb(var(--waline-accent-rgb) / 0.7);
253
252
  color: var(--white-full);
254
253
  }
255
254
 
@@ -258,7 +257,7 @@
258
257
  display: flex;
259
258
  align-items: center;
260
259
  margin-bottom: 1.2rem;
261
- border-bottom: 1px solid rgba(70, 70, 70, 0.3);
260
+ border-bottom: 1px solid rgb(70 70 70 / 0.3);
262
261
  padding-bottom: 0.8rem;
263
262
  justify-content: space-between;
264
263
  }
@@ -289,7 +288,7 @@
289
288
  }
290
289
 
291
290
  .wl-sort li.active {
292
- color: rgba(var(--waline-accent-rgb), 1);
291
+ color: rgb(var(--waline-accent-rgb) / 1);
293
292
  font-weight: 500;
294
293
  }
295
294
 
@@ -300,9 +299,9 @@
300
299
  }
301
300
 
302
301
  .wl-page button {
303
- background: rgba(30, 30, 30, 0.5) !important;
302
+ background: rgb(30 30 30 / 0.5) !important;
304
303
  color: var(--white-80p) !important;
305
- border: 1px solid rgba(70, 70, 70, 0.3) !important;
304
+ border: 1px solid rgb(70 70 70 / 0.3) !important;
306
305
  border-radius: 6px;
307
306
  margin: 0 5px;
308
307
  padding: 5px 10px;
@@ -313,14 +312,14 @@
313
312
  }
314
313
  @media (hover: hover) and (pointer: fine) {
315
314
  .wl-page button:hover:not(:disabled) {
316
- background: rgba(var(--waline-accent-rgb), 0.7) !important;
315
+ background: rgb(var(--waline-accent-rgb) / 0.7) !important;
317
316
  color: var(--white-full) !important;
318
317
  transform: none;
319
318
  }
320
319
  }
321
320
 
322
321
  .wl-page button.active {
323
- background: rgba(var(--waline-accent-rgb), 0.8) !important;
322
+ background: rgb(var(--waline-accent-rgb) / 0.8) !important;
324
323
  color: var(--white-full) !important;
325
324
  }
326
325
 
@@ -333,7 +332,7 @@
333
332
  }
334
333
 
335
334
  .wl-power a {
336
- color: rgba(var(--waline-accent-rgb), 0.9);
335
+ color: rgb(var(--waline-accent-rgb) / 0.9);
337
336
  text-decoration: none;
338
337
  transition:
339
338
  background-color 180ms ease,
@@ -342,7 +341,7 @@
342
341
  }
343
342
  @media (hover: hover) and (pointer: fine) {
344
343
  .wl-power a:hover {
345
- color: rgba(var(--waline-accent-rgb), 1);
344
+ color: rgb(var(--waline-accent-rgb) / 1);
346
345
  text-decoration: underline;
347
346
  }
348
347
  }
@@ -375,14 +374,14 @@
375
374
 
376
375
  /* 降低选中文本高亮程度,移除外边框 */
377
376
  .waline-comment-container *::selection {
378
- background: rgba(var(--waline-accent-rgb), 0.25);
377
+ background: rgb(var(--waline-accent-rgb) / 0.25);
379
378
  color: inherit;
380
379
  border: none;
381
380
  outline: none;
382
381
  }
383
382
 
384
383
  .waline-comment-container *::-moz-selection {
385
- background: rgba(var(--waline-accent-rgb), 0.25);
384
+ background: rgb(var(--waline-accent-rgb) / 0.25);
386
385
  color: inherit;
387
386
  border: none;
388
387
  outline: none;
@@ -425,7 +424,7 @@
425
424
 
426
425
  .wl-children .wl-card {
427
426
  margin-left: 0;
428
- border-left: 3px solid rgba(var(--waline-accent-rgb), 0.4);
427
+ border-left: 3px solid rgb(var(--waline-accent-rgb) / 0.4);
429
428
  padding-left: 0.8rem;
430
429
  }
431
430
  }
@@ -466,12 +465,12 @@
466
465
  .wl-children .wl-card {
467
466
  width: 100%;
468
467
  margin-left: 0;
469
- border-left: 3px solid rgba(var(--waline-accent-rgb), 0.4);
468
+ border-left: 3px solid rgb(var(--waline-accent-rgb) / 0.4);
470
469
  padding-left: 0.6rem;
471
470
  }
472
471
 
473
472
  .wl-children .wl-children .wl-card {
474
- border-left: 3px solid rgba(var(--waline-accent-rgb), 0.3);
473
+ border-left: 3px solid rgb(var(--waline-accent-rgb) / 0.3);
475
474
  padding-left: 0.6rem;
476
475
  }
477
476
 
@@ -1,3 +1,5 @@
1
+ import { productionStyleName } from "./style-name.ts";
2
+
1
3
  const ACCENT_COLOR_PATTERN = /^#[\da-fA-F]{6}$/;
2
4
 
3
5
  const ACCENT_OPACITIES = [90, 85, 80, 70, 60, 50, 40, 30, 20] as const;
@@ -12,13 +14,14 @@ export function getAccentColorStyle(accentColor = "#EAB308"): string {
12
14
  const red = Number.parseInt(hex.slice(0, 2), 16);
13
15
  const green = Number.parseInt(hex.slice(2, 4), 16);
14
16
  const blue = Number.parseInt(hex.slice(4, 6), 16);
15
- const rgb = `${red}, ${green}, ${blue}`;
17
+ const rgb = `${red} ${green} ${blue}`;
16
18
 
17
19
  return [
18
20
  `--stalux-accent-color: ${accentColor.toLowerCase()}`,
19
21
  `--stalux-accent-rgb: ${rgb}`,
20
22
  ...ACCENT_OPACITIES.map(
21
- (opacity) => `--accent-${opacity}p: rgba(${rgb}, ${opacity / 100})`,
23
+ (opacity) =>
24
+ `${productionStyleName(`--accent-${opacity}p`)}: rgb(${red} ${green} ${blue} / ${opacity / 100})`,
22
25
  ),
23
26
  ].join("; ");
24
27
  }
@@ -0,0 +1,15 @@
1
+ import { styleNameIn } from "../internal/style-name-lookup.ts";
2
+ import { styleNames } from "../internal/style-names.generated.ts";
3
+
4
+ declare const __STALUX_COMPACT_STYLES__: boolean;
5
+
6
+ /** Resolve dynamically assembled theme names without changing development output. */
7
+ export function productionStyleName(name: string): string {
8
+ if (typeof __STALUX_COMPACT_STYLES__ === "undefined" || !__STALUX_COMPACT_STYLES__) return name;
9
+ return (
10
+ styleNameIn(styleNames.classes, name) ??
11
+ styleNameIn(styleNames.variables, name) ??
12
+ styleNameIn(styleNames.animations, name) ??
13
+ name
14
+ );
15
+ }
@@ -1,4 +1,5 @@
1
1
  import { getRouteKind, type RouteKind } from "./public-routes";
2
+ import { productionStyleName } from "./style-name.ts";
2
3
 
3
4
  export { getRouteKind, type RouteKind };
4
5
 
@@ -47,7 +48,7 @@ function createRouteAnimation(name: string, backName = `${name}-back`): RouteAni
47
48
  forwards: {
48
49
  old: exitAnimation,
49
50
  new: {
50
- name: `stalux-${name}`,
51
+ name: productionStyleName(`stalux-${name}`),
51
52
  duration: "0.22s",
52
53
  easing,
53
54
  fillMode: "both",
@@ -56,7 +57,7 @@ function createRouteAnimation(name: string, backName = `${name}-back`): RouteAni
56
57
  backwards: {
57
58
  old: exitAnimation,
58
59
  new: {
59
- name: `stalux-${backName}`,
60
+ name: productionStyleName(`stalux-${backName}`),
60
61
  duration: "0.22s",
61
62
  easing,
62
63
  fillMode: "both",
@@ -90,7 +91,7 @@ function createSidebarAnimation(
90
91
  backwards: boolean,
91
92
  ): TransitionAnimation {
92
93
  return {
93
- name: `stalux-sidebar-${side}-${backwards ? "back-" : ""}${phase}`,
94
+ name: productionStyleName(`stalux-sidebar-${side}-${backwards ? "back-" : ""}${phase}`),
94
95
  duration: "0.22s",
95
96
  easing,
96
97
  fillMode: "both",