From b5fa2e266c8981ff94b6e153cfb467796cb274e6 Mon Sep 17 00:00:00 2001 From: Kiro Agent <244629292+kiro-agent@users.noreply.github.com> Date: Tue, 18 Aug 2026 09:35:03 +0000 Subject: [PATCH 1/2] fix(bricks): restore color-state swatches and class-dropdown hints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two regressions surfaced in the Bricks builder after framework changes: 1. Variable-picker swatches were missing for the `--sf-color-*--hover` and `--sf-color-*--active` tokens. The PHP color resolver emitted the semantic `hover`/`active` aliases with a SINGLE dash (`-hover`), but the framework tokens are BEM state modifiers with a DOUBLE dash (`--hover`). The builder-side swatch/variable lookups key off the real token name, so those entries never matched and rendered blank. Aliases now carry their exact separator (double dash for state modifiers, single dash for tonal steps). 2. Most class hints ("?" tooltips) disappeared from the class dropdown. gen-class-hints.js scraped section-heading comments out of the framework CSS, which stopped matching once the framework adopted its short `/* Label */` source-comment policy — so only the curated overrides survived, and renamed classes (sf-bento--row-*, is-* -> sf-is-*) went undocumented. The generator now reads the framework's machine-readable docs/api-index.json (same source as gen-variables-hints.js), which is robust to comment reformatting and tracks the real class names. Regenerated classes-hints.json grows from 63 to 303 entries. Tests: updated ColorResolverTest (correct --hover/--active naming + a regression guard) and rewrote gen-class-hints.test.js around buildClassHints. --- SLASHED-for-WP/data/classes-hints.json | 1316 ++++++++++++++--- .../includes/class-color-resolver.php | 39 +- scripts/gen-class-hints.js | 260 +--- tests-php/ColorResolverTest.php | 35 +- tests/gen-class-hints.test.js | 124 +- 5 files changed, 1304 insertions(+), 470 deletions(-) diff --git a/SLASHED-for-WP/data/classes-hints.json b/SLASHED-for-WP/data/classes-hints.json index 1942979e..74a1b145 100644 --- a/SLASHED-for-WP/data/classes-hints.json +++ b/SLASHED-for-WP/data/classes-hints.json @@ -1,254 +1,1214 @@ { + "sf-alternate": { + "description": "Zigzag / alternating two-column layout. Even children align image-left/text-right; odd children flip. Collapses to a single column below the breakpoint.", + "category": "Layout primitives" + }, + "sf-bento": { + "description": "Auto-fill bento grid for card dashboards. Children span 1 column by default; use span modifiers (sf-bento-wide, sf-bento-tall, sf-bento-full, sf-bento-featured) to break the grid.", + "category": "Layout primitives" + }, + "sf-bento--2": { + "description": "Bento grid variant with a 2-column base layout.", + "category": "Layout primitives" + }, + "sf-bento--3": { + "description": "Bento grid variant with a 3-column base layout.", + "category": "Layout primitives" + }, + "sf-bento--6": { + "description": "Bento grid variant with a 6-column base layout.", + "category": "Layout primitives" + }, + "sf-bento--row-compact": { + "description": "Bento grid variant with shorter default row height.", + "category": "Layout primitives" + }, + "sf-bento--row-tall": { + "description": "Bento grid variant with taller default row height.", + "category": "Layout primitives" + }, + "sf-bento-featured": { + "description": "Span modifier for a bento item: takes up 2×2 cells (featured hero placement).", + "category": "Layout primitives" + }, + "sf-bento-full": { + "description": "Span modifier for a bento item: stretches across all columns (full-width banner).", + "category": "Layout primitives" + }, + "sf-bento-tall": { + "description": "Span modifier for a bento item: doubles the row height (tall card).", + "category": "Layout primitives" + }, + "sf-bento-wide": { + "description": "Span modifier for a bento item: spans 2 columns (wide card).", + "category": "Layout primitives" + }, + "sf-bg-layer": { + "description": "Background layer — absolutely-positioned cover media that sits behind a parent's content. The parent is auto-promoted to a positioned, isolated stacking context via :has(), so .sf-bg-layer composes natively under .sf-scrim (background → scrim gradient → content). Works as a bare or as a wrapper with a nested > img / > video / > picture.", + "category": "Layout primitives" + }, + "sf-box": { + "description": "Minimal padding container that applies --sf-component-pad on all sides. The simplest layout primitive for adding breathing room.", + "category": "Layout primitives" + }, + "sf-breakout": { + "description": "Breaks a child element out of a parent sf-content-grid, spanning full bleed (or a named grid area) regardless of the parent column. Useful for full-width sections inside constrained prose.", + "category": "Layout primitives" + }, + "sf-btn": { + "description": "Interactive call-to-action button. Apply to