@uniweb/theming 1.2.1 → 1.3.0
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 +1 -1
- package/src/css-generator.js +7 -2
package/package.json
CHANGED
package/src/css-generator.js
CHANGED
|
@@ -473,7 +473,7 @@ function generateFontCSS(fontRoles = {}, fonts = {}, base = '/') {
|
|
|
473
473
|
// --- Apply font families to elements ---
|
|
474
474
|
// Defining --font-* on :root is not enough — something must set `font-family`
|
|
475
475
|
// on rendered elements, the same way colors get an application rule
|
|
476
|
-
// ([id^="section-"] { background-color: var(--section) }). The processor has
|
|
476
|
+
// ([id^="section-"]:not([data-uw-background="self"]) { background-color: var(--section) }). The processor has
|
|
477
477
|
// already resolved which roles apply (`role.apply`): a built-in role applies
|
|
478
478
|
// only when the site set it (don't stomp a foundation's own typography with
|
|
479
479
|
// system-ui); a foundation-owned/redefined role applies always via its
|
|
@@ -590,7 +590,12 @@ export function generateThemeCSS(config = {}, options = {}) {
|
|
|
590
590
|
const lightColorVars = colorVars.light || {}
|
|
591
591
|
const defaultTokens = { ...DEFAULT_CONTEXT_TOKENS.light, ...(contexts.light || {}), ...lightColorVars }
|
|
592
592
|
const defaultVars = generateVarDeclarations(defaultTokens)
|
|
593
|
-
|
|
593
|
+
// ⭐ A section type that declares `background: 'self'` paints everything behind its content, its
|
|
594
|
+
// context's surface included: the runtime marks its wrapper `data-uw-background="self"`, and this
|
|
595
|
+
// rule leaves it unpainted, so a panel narrower than its section sits on the page's own surface.
|
|
596
|
+
// ⛔ Until 2026-11-06 the rule painted every wrapper, so `'self'` covered the author's background
|
|
597
|
+
// layer and not the surface, and a panel foundation cleared the band with a rule of its own.
|
|
598
|
+
sections.push(`/* Default Semantic Tokens */\n:root {\n${defaultVars}\n}\n\n/* Section backgrounds — applied once, resolves via context tokens */\n[id^="section-"]:not([data-uw-background="self"]) {\n background-color: var(--section);\n}`)
|
|
594
599
|
|
|
595
600
|
// 4. Context classes
|
|
596
601
|
const contextCSS = [
|