@uniweb/theming 1.3.0 → 1.3.2

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniweb/theming",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "Theming utilities for the Uniweb platform — shade generation, CSS generation, theme processing",
5
5
  "type": "module",
6
6
  "exports": {
@@ -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-"]:not([data-uw-background="self"]) { background-color: var(--section) }). The processor has
476
+ // ([id^="section-"] { 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
@@ -593,9 +593,19 @@ export function generateThemeCSS(config = {}, options = {}) {
593
593
  // ⭐ A section type that declares `background: 'self'` paints everything behind its content, its
594
594
  // context's surface included: the runtime marks its wrapper `data-uw-background="self"`, and this
595
595
  // rule leaves it unpainted, so a panel narrower than its section sits on the page's own surface.
596
+ // ⭐ The exclusion weighs nothing (`:where`), so the rule stays (0,1,0), as it was before it had
597
+ // one: a foundation's own rule for its sections (`.canvas-plain section`, a class beside the id)
598
+ // still wins. Sites get this file from the runtime at their next publish, foundation unchanged.
596
599
  // ⛔ 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}`)
600
+ // layer and not the surface, and a panel foundation cleared the band with a rule of its own. For
601
+ // part of that day the exclusion was a plain `:not([…])`, (0,2,0), which beat those rules.
602
+ sections.push(`/* Default Semantic Tokens */\n:root {\n${defaultVars}\n}\n\n/* Section backgrounds — applied once, resolves via context tokens */\n[id^="section-"]:not(:where([data-uw-background="self"])) {\n background-color: var(--section);\n}`)
603
+
604
+ // ⭐ The section a header lies over (`underHeader`, marked by the runtime) clears it by
605
+ // `--uw-header-height`: what the browser measured, else the header type's declared height, on a
606
+ // page where a header box lies over it, and nothing on one where the layout drew no header. A
607
+ // rule, since only the rendered page holds that answer, so the first paint pads by what is there.
608
+ sections.push(`/* The section under the header clears it — by nothing where no header lies over it */\n[data-uw-under-header] {\n --uw-header-height: 0px;\n}\n:root:has([data-uw-header="over"]) [data-uw-under-header] {\n --uw-header-height: var(--uw-header-measured, var(--uw-header-declared, 0px));\n}`)
599
609
 
600
610
  // 4. Context classes
601
611
  const contextCSS = [