mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 03:52:50 +08:00
feat: add host chrome theming and a skin-proof recovery layer
Allow skins to theme host chrome through a second scope and explicit visibleParts. Official and built-in skins stay decoration-free by default. Harden the CSS compiler so skins cannot hide the document root, push protected controls off-screen, or target the host layer with sibling selectors. Move recovery and authorization UI into a closed Shadow DOM on the top layer, so a third-party skin cannot block the built-in skin reset.
This commit is contained in:
1 parent
33ba062686
commit
f8d61d22ef
45 files changed
+3535
-558
No files matched your search
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"hiddenParts": ["host.plugins.launcher"],
|
||||
"visibleParts": ["host.watermark", "host.hint", "host.voice-status-decoration"],
|
||||
"icons": {
|
||||
"language.trigger": "assets/icons/language.png",
|
||||
"skin.trigger": "assets/icons/skin.png",
|
||||
"host.plugins.launcher": "assets/icons/apps.png",
|
||||
"home.toolbar.settings": "assets/icons/settings.png",
|
||||
"voice.performance": "assets/icons/status.png"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"schemaVersion": 3,
|
||||
"packageType": "open-skin",
|
||||
"id": "community.host-chrome-demo",
|
||||
"name": "Host Chrome Demo",
|
||||
"version": "1.0.0",
|
||||
"author": "WebSpeak Project",
|
||||
"license": "AGPL-3.0-only",
|
||||
"description": "Minimal open skin demonstrating host chrome theming, declarative hiding and bitmap icon overrides.",
|
||||
"entry": "skin.css",
|
||||
"chrome": "chrome.json",
|
||||
"minAppVersion": "0.3.0"
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
/* Host chrome demo — v3 open skin (schemaVersion 3).
|
||||
Every selector uses :root, [data-ws-page] or [data-ws-part].
|
||||
Host-only selectors are compiled into :root[data-ws-host-skin="…"]. */
|
||||
|
||||
:root {
|
||||
--skin-accent: #1d4f9c;
|
||||
--skin-panel: #ffffff;
|
||||
--skin-border: #c9c9c9;
|
||||
--skin-text: #141414;
|
||||
}
|
||||
|
||||
[data-ws-page] {
|
||||
color-scheme: light;
|
||||
font-family: Tahoma, "Segoe UI", "Microsoft YaHei", sans-serif;
|
||||
font-size: 12px;
|
||||
color: #141414;
|
||||
}
|
||||
|
||||
[data-ws-part="home.header"] ,
|
||||
[data-ws-part="voice.header"] {
|
||||
background: linear-gradient(180deg, #fbfbfb, #e9e9e9);
|
||||
border-bottom: 1px solid var(--skin-border);
|
||||
}
|
||||
|
||||
[data-ws-part="voice.audio-dock"] {
|
||||
border-top: 1px solid var(--skin-border);
|
||||
background: #f7f9fb;
|
||||
}
|
||||
|
||||
/* --- Host chrome (outside .ws-skin-root) --- */
|
||||
[data-ws-part="host.plugins.launcher"] {
|
||||
background: #1d4f9c;
|
||||
color: #ffffff;
|
||||
border: 1px solid #163c78;
|
||||
border-radius: 3px;
|
||||
padding: 7px 12px;
|
||||
font-size: 12px;
|
||||
font-weight: 600;
|
||||
letter-spacing: .02em;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
[data-ws-part="host.plugins.launcher"]:hover {
|
||||
background: #2a63bb;
|
||||
}
|
||||
|
||||
[data-ws-part="host.plugins.overlay"] {
|
||||
border: 2px solid #1d4f9c;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
[data-ws-part="host.watermark"] {
|
||||
color: #1d4f9c;
|
||||
opacity: .12;
|
||||
font-family: Tahoma, sans-serif;
|
||||
}
|
||||
|
||||
[data-ws-part="host.hint"] {
|
||||
color: #1d4f9c;
|
||||
border-left: 2px solid #1d4f9c;
|
||||
padding-left: 6px;
|
||||
}
|
||||
|
||||
[data-ws-part="host.voice-status-decoration"] {
|
||||
opacity: .45;
|
||||
}
|
||||
|
||||
/* Icon slots can also be addressed directly from CSS. */
|
||||
[data-ws-part="host.plugins.launcher"] [data-ws-icon-slot="host.plugins.launcher"] {
|
||||
background-color: transparent;
|
||||
}
|
||||
Reference in new issue
Block a user