@celestia-island/hikari 0.43.2 → 0.43.3
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.
package/package.json
CHANGED
|
@@ -6,6 +6,13 @@
|
|
|
6
6
|
* layout engine, so the geometry contract is pinned as an scss-text
|
|
7
7
|
* assertion: the theme-row lead cell must carry an explicit size that
|
|
8
8
|
* fits the widest host lead mark, not just the mixin's generic box.
|
|
9
|
+
*
|
|
10
|
+
* The widened cell must stay scoped to the lead slot (2026-09-12 field
|
|
11
|
+
* report): shipped first as a bare `.s-theme-item-btn .hk-menu-item-icon`
|
|
12
|
+
* rule, it also matched the 自定义 row and every host row reusing
|
|
13
|
+
* s-theme-item-btn (chest's mode-extra DPI entry) — and mi.icon
|
|
14
|
+
* normalizes those cells' svg to the cell, so their 14px glyphs rendered
|
|
15
|
+
* 28px wide.
|
|
9
16
|
*/
|
|
10
17
|
import { describe, expect, it } from "vitest";
|
|
11
18
|
import { readFileSync } from "node:fs";
|
|
@@ -19,10 +26,18 @@ describe("HkThemeToggle row lead-cell contract", () => {
|
|
|
19
26
|
it("sizes the theme-row lead cell to fit a 28px swatch mark", () => {
|
|
20
27
|
const css = read("HkThemeToggle.scss");
|
|
21
28
|
const block = css.match(
|
|
22
|
-
/\.s-theme-item-btn \.hk-menu-item-icon\s*\{[^}]*\}/,
|
|
29
|
+
/\.s-theme-item-btn \.hk-menu-item-icon\.s-theme-item-lead\s*\{[^}]*\}/,
|
|
23
30
|
);
|
|
24
31
|
expect(block).not.toBeNull();
|
|
25
32
|
expect(block![0]).toContain("width: 28px");
|
|
26
33
|
expect(block![0]).toContain("height: 28px");
|
|
27
34
|
});
|
|
35
|
+
|
|
36
|
+
it("does not widen icon cells outside the leading slot", () => {
|
|
37
|
+
const css = read("HkThemeToggle.scss");
|
|
38
|
+
// A bare `.s-theme-item-btn .hk-menu-item-icon {` rule also hits the
|
|
39
|
+
// customize row and host mode-extra rows; the widened cell may only
|
|
40
|
+
// target the lead slot class.
|
|
41
|
+
expect(css).not.toMatch(/\.s-theme-item-btn \.hk-menu-item-icon\s*\{/);
|
|
42
|
+
});
|
|
28
43
|
});
|
|
@@ -188,15 +188,22 @@
|
|
|
188
188
|
@include mi.label;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
/* Leading
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
|
|
191
|
+
/* Leading slot glyphs share the spec's fixed icon cell — sized for the
|
|
192
|
+
* WIDEST lead mark hosts render there, not the generic 16px box: chest's
|
|
193
|
+
* three-dot palette swatch is 28px (3×8px dots + 2px gaps), and a mark
|
|
194
|
+
* wider than its cell bleeds symmetrically out of the cell into the row
|
|
195
|
+
* gap — at fractional zoom rounding the dots visually overlap the name
|
|
196
|
+
* (2026-09-11 field report). A uniform 28px cell keeps every row's name
|
|
197
|
+
* starting at the same x (swatch rows and icon rows stay aligned) and
|
|
198
|
+
* leaves the bleed zero room at any zoom.
|
|
199
|
+
*
|
|
200
|
+
* The widened cell is scoped to the LEAD slot only (2026-09-12 field
|
|
201
|
+
* report): the bare `.s-theme-item-btn .hk-menu-item-icon` this shipped
|
|
202
|
+
* as also matched the 自定义 row and every host row reusing
|
|
203
|
+
* s-theme-item-btn (chest's mode-extra DPI entry), where mi.icon
|
|
204
|
+
* normalizes the svg to the cell — their 14px glyphs rendered 28px
|
|
205
|
+
* wide. Rows without a leading slot keep the standard menu metrics. */
|
|
206
|
+
.s-theme-item-btn .hk-menu-item-icon.s-theme-item-lead {
|
|
200
207
|
@include mi.icon;
|
|
201
208
|
|
|
202
209
|
width: 28px;
|