@celestia-island/hikari 0.55.88 → 0.55.90
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
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { afterEach, describe, expect, it } from "vitest";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
2
5
|
import { createApp, defineComponent, h } from "vue";
|
|
3
6
|
|
|
4
7
|
import HkIconButton from "./HkIconButton";
|
|
@@ -118,3 +121,33 @@ describe("HkIconButton", () => {
|
|
|
118
121
|
expect(propAndSlot.querySelector(".hk-icon")).toBeNull();
|
|
119
122
|
});
|
|
120
123
|
});
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Static pin for the header-chrome glyph step (user report 2026-09-29:
|
|
127
|
+
* the search / refresh / filter glyphs in the top-right clusters read
|
|
128
|
+
* visibly smaller than HkThemeToggle's sun beside them). The `.svg` rule
|
|
129
|
+
* in HkIconButton.scss forces ANY slotted glyph to
|
|
130
|
+
* `--hi-icon-button-icon-size`, so the 28 step must map that var to the
|
|
131
|
+
* sm token (16px — the theme toggle's own glyph size). happy-dom has no
|
|
132
|
+
* cascade here that a DOM test could measure, so — tokenInventory style —
|
|
133
|
+
* the declarations themselves are the contract; a deliberate remap is
|
|
134
|
+
* expected to update this file.
|
|
135
|
+
*/
|
|
136
|
+
describe("HkIconButton glyph step", () => {
|
|
137
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
138
|
+
const vars = readFileSync(join(here, "HkIconButtonVars.scss"), "utf8");
|
|
139
|
+
|
|
140
|
+
it("maps the 28 header step to the sm glyph (16px), matching the theme toggle", () => {
|
|
141
|
+
const block = vars.slice(vars.indexOf(".hk-icon-button-28"), vars.indexOf(".hk-icon-button-32"));
|
|
142
|
+
expect(block).toContain("--hi-icon-button-size: 28px;");
|
|
143
|
+
expect(block).toContain("--hi-icon-button-icon-size: var(--hi-icon-size-sm);");
|
|
144
|
+
expect(block).not.toContain("var(--hi-icon-size-xs)");
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
it("keeps the dense steps (16/24) on the xs glyph", () => {
|
|
148
|
+
const block16 = vars.slice(vars.indexOf(".hk-icon-button-16"), vars.indexOf(".hk-icon-button-24"));
|
|
149
|
+
const block24 = vars.slice(vars.indexOf(".hk-icon-button-24"), vars.indexOf(".hk-icon-button-28"));
|
|
150
|
+
expect(block16).toContain("var(--hi-icon-size-xs)");
|
|
151
|
+
expect(block24).toContain("var(--hi-icon-size-xs)");
|
|
152
|
+
});
|
|
153
|
+
});
|
|
@@ -74,7 +74,15 @@
|
|
|
74
74
|
|
|
75
75
|
.hk-icon-button-28 {
|
|
76
76
|
--hi-icon-button-size: 28px;
|
|
77
|
-
|
|
77
|
+
/* The header-chrome step carries the sm glyph (16px): its consumers are
|
|
78
|
+
* the header clusters — global search, the pages' refresh, the filter
|
|
79
|
+
* trigger — whose visual sibling is HkThemeToggle's own trigger buttons
|
|
80
|
+
* (28px boxes with direct 16px lucide glyphs). The xs mapping (12px)
|
|
81
|
+
* rendered those glyphs visibly smaller than the sun beside them
|
|
82
|
+
* (user report 2026-09-29: 不像一个尺寸的图标按钮) — the `.svg` rule
|
|
83
|
+
* in HkIconButton.scss forces ANY slotted glyph to this var, so the
|
|
84
|
+
* slot's size-16 attribute never reached the screen. */
|
|
85
|
+
--hi-icon-button-icon-size: var(--hi-icon-size-sm);
|
|
78
86
|
}
|
|
79
87
|
|
|
80
88
|
.hk-icon-button-32 {
|