fix(sw): preserve theme token inheritance across viewer components
This commit is contained in:
1 parent
40c5b89814
commit
41e963a12a
17 files changed
+445
-21
No files matched your search
@@ -2,9 +2,13 @@
|
||||
SW-only tokens. They never touch @hm-design/ui tokens or global selectors. */
|
||||
|
||||
/* Tokens, typography and the control reset are shared by the full header and <SWTheme>,
|
||||
which scopes standalone sub-components without a consumer class. */
|
||||
.hm-sw-header,
|
||||
.hm-sw-theme {
|
||||
which scopes standalone sub-components without a consumer class.
|
||||
Token defaults are declared only on the OUTERMOST SW scope (2026-10-20): a nested scope root (viewer menu,
|
||||
More menu, panel, footer command line inside a header / footer / <SWTheme>) inherits the tokens instead of
|
||||
resetting them, so a token set through `style` (or the consumer's own class) on the outermost scope reaches
|
||||
every SW element inside it. Same specificity as before (0,1,0); the same rule is used in sw-viewer.css and
|
||||
sw-footer.css. */
|
||||
:is(.hm-sw-header, .hm-sw-theme):not(:where(.hm-sw-header, .hm-sw-theme) *) {
|
||||
/* Size */
|
||||
--hm-sw-header-height: 49px;
|
||||
--hm-sw-header-bar-height: 48px;
|
||||
@@ -171,7 +175,11 @@
|
||||
--hm-sw-header-input-hover-border-color: rgba(212, 203, 189, 0.25);
|
||||
--hm-sw-header-input-editing-background: #0f0d0a;
|
||||
--hm-sw-header-input-editing-border-color: rgba(212, 203, 189, 0.3);
|
||||
}
|
||||
|
||||
/* Every SW scope root (nested ones too) applies the typography from the inherited tokens. */
|
||||
.hm-sw-header,
|
||||
.hm-sw-theme {
|
||||
color: var(--hm-sw-header-text-color);
|
||||
font-family: var(--hm-sw-header-font-family);
|
||||
font-size: var(--hm-sw-header-font-size);
|
||||
|
||||
Reference in new issue
Block a user