feat: let skins theme every protected control through skin.css and shared host tokens

App-DOM protected parts keep only hide/off-screen/disable guards; host-owned recovery capsule, skin-load banner and authorization dialog read one sanitized --skin-host-* token set with per-part overrides (--skin-recovery-*, --skin-load-recovery-*, --skin-permission-*) via the new host-control-tokens module.
This commit is contained in:
OddTurtleHead committed 2026-11-15 17:03:07 +08:00
1 parent 93d221c3ef
commit c1187d12d2
19 files changed
+1094 -422

No files matched your search

+4 -4
View File
@@ -31,10 +31,10 @@ const CSS = `
.cap {
position: fixed; inset: auto auto 12px 12px; margin: 0;
display: flex; gap: 4px; padding: 4px; border: 0; pointer-events: auto;
background: var(--ws-recovery-background, #fff);
color: var(--ws-recovery-foreground, #31524f);
background: var(--ws-control-background, #fff);
color: var(--ws-control-foreground, #31524f);
}
.cap button { min-height: var(--ws-recovery-hit, 28px); padding: 0 8px; }
.cap button { min-height: var(--ws-control-hit, 28px); padding: 0 8px; }
`;
try {
const layer = createHostOwnedLayer("recovery", CSS);
@@ -113,7 +113,7 @@ try {
binding.dispose();
results.push({
...snap("disposed"),
leftoverAccent: control.style.getPropertyValue("--ws-recovery-accent"),
leftoverAccent: control.style.getPropertyValue("--ws-control-accent"),
});
output.textContent = JSON.stringify({ results, changes });
} catch (error) {
+7
View File
@@ -92,6 +92,13 @@ test("host chrome renders recovery and authorization in a closed-shadow top laye
assert.match(hostChromeService, /export function activeHostSlot/);
assert.match(hostChromeService, /HOST_SLOTTABLE_PART_IDS\.has\(part\)/);
assert.match(hostChromeService, /isThirdPartySkinActive\(\)/);
// Host-owned controls share one sanitized token reader; no per-control palette copy.
assert.match(hostChrome, /bindHostControlTheme/);
assert.match(hostChrome, /--ws-control-background/);
assert.match(recoveryNotice, /SKIN_LOAD_RECOVERY_CONTROL_DEFAULTS/);
assert.match(recoveryNotice, /--ws-control-background/);
assert.match(authorization, /PERMISSION_CONTROL_DEFAULTS/);
assert.match(authorization, /--ws-control-background/);
// Authorization: showModal() inside the same host-owned mechanism.
assert.match(authorization, /createHostOwnedLayer\('authorization'/);