@celestia-island/hikari 0.55.104 → 0.55.105
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
|
@@ -45,6 +45,13 @@
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
.hk-board3d-fallback {
|
|
48
|
+
// Self-carried contrast chip: in transparent-backdrop mode the root
|
|
49
|
+
// paints nothing, so the note cannot lean on the old surface fill.
|
|
50
|
+
background: rgb(var(--color-surface) / 0.9);
|
|
51
|
+
border-radius: var(--radius-md, 8px);
|
|
52
|
+
padding: 6px 12px;
|
|
53
|
+
margin: auto;
|
|
54
|
+
width: fit-content;
|
|
48
55
|
position: absolute;
|
|
49
56
|
inset: 0;
|
|
50
57
|
display: flex;
|
|
@@ -1376,4 +1376,25 @@ describe("HkBoard3D transparent background", () => {
|
|
|
1376
1376
|
expect(rendererOf().alpha).toBe(true);
|
|
1377
1377
|
expect(rendererOf().clearAlpha).toBe(0);
|
|
1378
1378
|
});
|
|
1379
|
+
|
|
1380
|
+
it("drops the container's own surface paint in transparent mode", async () => {
|
|
1381
|
+
const { container } = mountBoard(
|
|
1382
|
+
{ minimap: false, transparentBackground: true },
|
|
1383
|
+
{},
|
|
1384
|
+
);
|
|
1385
|
+
await nextTick();
|
|
1386
|
+
const root = container.querySelector(".hk-board3d") as HTMLElement;
|
|
1387
|
+
// The stylesheet paints --color-surface on .hk-board3d; an inline
|
|
1388
|
+
// transparent style must win, or a page-colored rectangle sits
|
|
1389
|
+
// behind the alpha-0 canvas (user report 2026-10-01: the scene
|
|
1390
|
+
// background differs from the page background).
|
|
1391
|
+
expect(root.style.background).toContain("transparent");
|
|
1392
|
+
});
|
|
1393
|
+
|
|
1394
|
+
it("keeps the stylesheet surface paint when the backdrop is opaque", async () => {
|
|
1395
|
+
const { container } = mountBoard({ minimap: false }, {});
|
|
1396
|
+
await nextTick();
|
|
1397
|
+
const root = container.querySelector(".hk-board3d") as HTMLElement;
|
|
1398
|
+
expect(root.style.background).toBe("");
|
|
1399
|
+
});
|
|
1379
1400
|
});
|
|
@@ -1134,7 +1134,16 @@ export default defineComponent({
|
|
|
1134
1134
|
});
|
|
1135
1135
|
|
|
1136
1136
|
return () => (
|
|
1137
|
-
<div
|
|
1137
|
+
<div
|
|
1138
|
+
class="hk-board3d"
|
|
1139
|
+
// The transparent-backdrop mode clears the CANVAS to alpha 0, but
|
|
1140
|
+
// the container's own surface paint would still sit behind it —
|
|
1141
|
+
// a page-colored rectangle where the page's backdrop should show.
|
|
1142
|
+
// An inline style wins over the stylesheet without a specificity
|
|
1143
|
+
// war with consumer classes.
|
|
1144
|
+
style={props.transparentBackground ? { background: "transparent" } : undefined}
|
|
1145
|
+
ref={containerRef}
|
|
1146
|
+
>
|
|
1138
1147
|
<canvas ref={canvasRef} class="hk-board3d-canvas" />
|
|
1139
1148
|
{failed.value ? (
|
|
1140
1149
|
slots.fallback ? (
|