Skip to content

feat: expand gradient palette and improve macro gallery coverage - #605

Merged
jackgranatowski merged 4 commits into
mainfrom
claude/live-preview-tabs-audit-uxqijm
Jul 13, 2026
Merged

feat: expand gradient palette and improve macro gallery coverage#605
jackgranatowski merged 4 commits into
mainfrom
claude/live-preview-tabs-audit-uxqijm

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Expands the gradient palette from 4 to 6 variants and completely overhauls the macros gallery to showcase all 58 shipped macro classes with real, functional specimens instead of a bare text list.

Gradient palette changes:

  • GRADS array now includes secondary and action in addition to the existing primary, tertiary, brand, and surface
  • Updated in both sections.ts (preview) and skin.ts (preview CSS)

Macros gallery overhaul:

  • Replaced the minimal text-based class list with comprehensive, real-world specimens for every macro
  • Added sections for: prose/flow, truncation, equal height, aspect ratio, tabular numbers, links, drop shadows, scroll behaviors, content-visibility, overflow fade, scrims, text effects, corner scoop, overlap, and no-tap-highlight
  • Each macro now has a functional demo (not just a class name chip) to serve as a coverage floor for tests/preview-coverage.test.ts
  • Added LOREM_MACRO constant for consistent demo text across specimens
  • Improved sf-bento demo to showcase the featured/wide/tall span modifiers with labeled examples

Layout & styling fixes:

  • Added inline-size:100% to surface cards, border specimens, frame demos, and gradient swatches for proper responsive behavior
  • Added inline-size:100% to .sf-divider in core/layout.css for consistency
  • Updated .pv-grad styling to include inline-size:100%
  • Enhanced .pv-motion-tile comment to explain animation fill-mode behavior in static galleries

Type

  • feat
  • fix
  • docs
  • chore / tooling

Checklist

  • Conventional Commit messages (feat:, fix:, docs:, …) — enforced by commitlint
  • npm run lint:css passes (stylelint)
  • npm run build rebuilds dist/ (bundles are git-ignored; CI rebuilds and stamps headers)
  • npm test passes (unit + Playwright e2e)
  • Version references in sync if any version-related file changed (npm run check:version)
  • LLM guide reviewed/updated if core/*.css, optional/*.css, or token-registry.json changed (npm run check:llm-guide)
  • Generated artifacts regenerated, not hand-edited (npm run check:macros, check:registry, audit:check)
  • CHANGELOG.md updated under ## [Unreleased] (for user-facing changes)
  • Breaking changes include migration docs

Notes

The macros gallery now serves as the authoritative coverage floor for all shipped macro classes. Each specimen is a real, functional demo rather than a text reference — this ensures the gallery itself validates that every macro works as intended. The gzip size increased by 0.1 kB due to the expanded demo content.

https://claude.ai/code/session_0113XBTydmejAnYJt9CTyYRc

Summary by CodeRabbit

  • New Features

    • Expanded gradient previews with additional color families.
    • Added richer layout and macro utility demonstrations, including bento layouts, aspect-ratio examples, scrolling effects, text treatments, and interaction helpers.
    • Enhanced motion previews with continuously animated tiles.
  • Bug Fixes

    • Improved preview sizing so color samples, gradients, and aspect-ratio examples span the available width.
    • Updated dividers to consistently fill their container.
    • Corrected the displayed compressed-size badge value.

claude added 2 commits July 12, 2026 21:05
…aspect frames in the live-preview gallery

Audited every live-preview tab in the configurator by rendering it in a
real browser instead of just reading the generated markup. Several
specimens had zero visible pixels despite correct HTML/tokens:

- core/layout.css: `.sf-divider` collapsed to 0 inline-size inside a flex
  column (e.g. `.sf-stack`) because `<hr>` doesn't participate in flex
  stretch sizing the way block `<div>`s do — a real framework bug, not
  just a preview issue. Give it an explicit `inline-size: 100%`.
- preview/skin.ts: `.pv-grad` (gradient swatches) and the Motion tab's
  `.pv-motion-tile` had the same 0-width flex-stretch problem, plus the
  GRADS list only had 4 of the 6 solid-colour gradient tokens (missing
  --sf-gradient-secondary / --sf-gradient-action), so those two rendered
  `background-image: none`.
- preview/sections.ts: the Color tab's Surfaces demo and Borders demo,
  and the Layout tab's aspect-ratio Frame demo, all relied on flex
  stretch for their width and rendered as a collapsed circle / thin line
  / nothing at all — now given explicit inline-size.
- Motion tab's exit/fade-out/scale-down tiles play once and legitimately
  end at opacity:0 (correct real behaviour), which read as "broken" in a
  static gallery — force infinite alternate playback for the demo tiles
  only, unlayered so it beats @layer slashed.motion.

Verified visually tab-by-tab (Color, Type, Spacing, Borders, Shadows,
Effects, Motion, Layout, Components, Macros) before and after.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0113XBTydmejAnYJt9CTyYRc
…ng class names

The Macros tab only rendered .sf-surface--* and then dumped the other 47
macro classes (.sf-prose, .sf-scrim, .sf-corner-scoop, .sf-overlap,
.sf-overflow-fade, drop-shadows, line-clamp, etc.) as inert text chips —
never actually applied to an element. Replaced that with a real specimen
for every one of the 58 macro classes: prose/flow rhythm, truncation and
line-clamp on real copy, equal-height, aspect-ratio, tabular numbers,
links, alpha-following drop-shadows, scroll-shadow/snap, every
overflow-fade edge, scrim/surface-bg/text-protect over a token-driven
gradient backdrop, text-gradient, corner-scoop, and overlap.

Also fixed the Layout tab's bento grid, which rendered 5 uniform cells
and never exercised the .sf-bento-featured/-wide/-tall span modifiers
that are the whole point of a bento layout.

Two real usage bugs turned up while building this and got corrected in
the demo (not the framework, which behaves correctly):
- .sf-overlap pulls an element UP onto whatever precedes it; overlapping
  a card that follows requires .sf-overlap--down. The demo used the
  wrong variant and showed no overlap at all.
- .sf-overflow-fade's row used .sf-cluster (wraps by default), so the
  "overflowing" content just wrapped onto new lines instead of
  overflowing — fixed with an explicit nowrap row, plus a separate
  overflowing column for the top/bottom/block variants (a single-line
  row can't demonstrate a vertical fade).

Also bumped .sf-card's border-radius down in the corner-scoop demo — the
card's own default oversized radius nearly circularized a 6rem swatch,
making the scoop notch imperceptible.

Verified every new specimen renders correctly in a real browser
(scroll-shadow fade, scroll-snap sections, corner-scoop notches on all
4 corners, overlap actually overlapping, aspect-ratio boxes at their
real ratios) before committing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0113XBTydmejAnYJt9CTyYRc
@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jackgranatowski, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 672f194e-6b7a-4aad-98d8-f587cfb3226d

📥 Commits

Reviewing files that changed from the base of the PR and between 08834cf and 88a10b5.

📒 Files selected for processing (5)
  • configurator/src/lib/preview/catalog.ts
  • configurator/src/lib/preview/sections.ts
  • configurator/src/lib/preview/skin.ts
  • core/layout.css
  • tests/layout.spec.js
📝 Walkthrough

Walkthrough

The configurator preview now includes expanded gradients, full-width specimens, a modifier-based bento layout, and concrete macro utility examples. Preview motion remains animated, dividers span full width, and the optimal badge reports 19.5 kB gzip.

Changes

Configurator preview gallery

Layer / File(s) Summary
Preview gradients and sizing
configurator/src/lib/preview/sections.ts, configurator/src/lib/preview/skin.ts
Gradient families are expanded, and color, aspect-ratio, and gradient specimens receive full-width sizing.
Layout and macro specimens
configurator/src/lib/preview/sections.ts
The bento preview uses labeled span modifiers, while the macro preview renders concrete utility examples across multiple categories.
Motion and divider styling
configurator/src/lib/preview/skin.ts, core/layout.css
The motion tile is forced into infinite alternating playback, and .sf-divider receives inline-size: 100%.

Badge metadata

Layer / File(s) Summary
Gzip badge value
badges/badge-optimal.json
The displayed gzip size changes from 19.4 kB to 19.5 kB.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: codex

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main changes: broader gradient palette and expanded macro gallery coverage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/live-preview-tabs-audit-uxqijm

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added the codex label Jul 13, 2026
@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown

Greptile Summary

This PR expands the gradient palette preview from 4 to 6 variants (secondary and action are valid tokens in core/tokens.css) and replaces the bare class-name list in the macros gallery with functional, real-world specimens for all 58 shipped macro classes. One layout side-effect warrants attention: the new inline-size: 100% on .sf-divider bleeds into .sf-divider--vertical because the modifier doesn't reset it.

  • Gradient expansion (sections.ts, skin.ts): GRADS updated consistently in both files; both tokens exist and are documented.
  • Macros gallery (sections.ts): Every macro now has an actual rendered specimen rather than a text chip, serving as a coverage floor for tests/preview-coverage.test.ts; the bento demo is also improved with labeled span-modifier examples.
  • core/layout.css: inline-size: 100% added to .sf-divider for responsive consistency, but .sf-divider--vertical inherits it without a reset, which can disrupt flex-row layouts.

Confidence Score: 4/5

Safe to merge after the .sf-divider--vertical inline-size reset is addressed; all other changes are additive preview/gallery content with no production risk.

The inline-size:100% addition to .sf-divider in core/layout.css is a shipped framework change where .sf-divider--vertical inherits it without a compensating reset, changing the element flex-basis from auto to 100% of the container in every flex-row context. The rest of the PR is purely additive gallery and preview content with no production risk.

core/layout.css — the .sf-divider--vertical modifier needs an explicit inline-size:auto to isolate it from the new rule on the base class.

Important Files Changed

Filename Overview
core/layout.css Adds inline-size:100% to .sf-divider for responsive consistency, but the new property bleeds into .sf-divider--vertical (the modifier does not reset it), which can disrupt flex layouts in flex-row containers.
configurator/src/lib/preview/sections.ts Comprehensive macros gallery overhaul adding real functional specimens for all 58 macro classes, a LOREM_MACRO constant, improved bento demo with labeled span-modifier examples, and inline-size:100% on surface/border/frame specimens.
configurator/src/lib/preview/skin.ts Adds secondary and action to GRADS array (both tokens exist in core/tokens.css), adds inline-size:100% to .pv-grad, and adds animation overrides to .pv-motion-tile with a clear explanatory comment.
badges/badge-optimal.json Bumps the optimal badge gzip message from 19.4 kB to 19.5 kB to reflect the expanded demo content.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[".sf-divider (base)"] -->|inline-size:100% NEW| B[Horizontal divider OK]
    A -->|cascades into| C[".sf-divider--vertical"]
    C -->|no inline-size reset| D["inline-size:100% inherited"]
    D --> E[Flex row layout affected]
    style D fill:#ffcccc,stroke:#cc0000
    style B fill:#ccffcc,stroke:#009900
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A[".sf-divider (base)"] -->|inline-size:100% NEW| B[Horizontal divider OK]
    A -->|cascades into| C[".sf-divider--vertical"]
    C -->|no inline-size reset| D["inline-size:100% inherited"]
    D --> E[Flex row layout affected]
    style D fill:#ffcccc,stroke:#cc0000
    style B fill:#ccffcc,stroke:#009900
Loading

Comments Outside Diff (1)

  1. core/layout.css, line 51-57 (link)

    P1 Adding inline-size: 100% to .sf-divider bleeds into .sf-divider--vertical because the modifier never resets it. In a flex row container (the documented usage context for vertical dividers), the divider's flex-basis becomes 100% of the container's inline size. Flex shrinking will usually pull it back, but the inflated hypothetical main size changes how the flex algorithm distributes remaining space among siblings, and in a flex-wrap: nowrap row it can force the divider to crowd out adjacent items before shrinking. Adding inline-size: auto to the modifier restores the pre-PR behaviour.

Reviews (1): Last reviewed commit: "fix(preview): make the Macros tab render..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
configurator/src/lib/preview/sections.ts (1)

12-12: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

GRADS is duplicated in skin.ts (line 15) — extract a single shared source.

This list must stay identical to the GRADS in configurator/src/lib/preview/skin.ts, which generates the .pv-grad--{family} rules that these specimens rely on. If the two lists ever drift, a specimen renders with an undefined .pv-grad--{family} rule (blank), or a generated rule goes unused — silently. Export one constant and import it in both files.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@configurator/src/lib/preview/sections.ts` at line 12, Extract the GRADS list
into one shared exported constant, then update both the sections module and the
skin module to import and use that constant. Remove the duplicated local
definitions while preserving the existing list values and generated gradient
behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/layout.css`:
- Line 46: Override the inherited inline-size declaration in
.sf-divider--vertical so vertical dividers remain narrow rather than spanning
the container’s inline axis. Update the existing vertical-divider test with an
assertion that verifies the divider’s intended geometry.

---

Nitpick comments:
In `@configurator/src/lib/preview/sections.ts`:
- Line 12: Extract the GRADS list into one shared exported constant, then update
both the sections module and the skin module to import and use that constant.
Remove the duplicated local definitions while preserving the existing list
values and generated gradient behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8608531e-09cb-4600-a188-fa1ccecb3cb8

📥 Commits

Reviewing files that changed from the base of the PR and between 7371c3f and 08834cf.

📒 Files selected for processing (4)
  • badges/badge-optimal.json
  • configurator/src/lib/preview/sections.ts
  • configurator/src/lib/preview/skin.ts
  • core/layout.css

Comment thread core/layout.css
claude added 2 commits July 13, 2026 05:53
Review feedback on PR #605 (Greptile + CodeRabbit, both independently
caught the same issue):

- core/layout.css: the inline-size:100% just added to .sf-divider
  bled into .sf-divider--vertical, which doesn't reset it — a vertical
  divider (used inside a row flex container, e.g. .sf-cluster) would
  inflate its flex-basis to the full row width instead of staying a
  narrow rule. Reset it with inline-size:auto on the modifier. Verified
  in-browser: vertical divider is back to a 1px-wide rule; the
  horizontal divider still spans its container.
- GRADS was duplicated in sections.ts and skin.ts — the exact kind of
  drift that caused the blank-gradient bug fixed earlier in this PR.
  Extracted a single export from catalog.ts and imported it in both.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0113XBTydmejAnYJt9CTyYRc
CodeRabbit's review of the .sf-divider--vertical fix asked for a
regression test, since the existing suite only checked border sides,
not the inline-size bug that actually shipped. Adds two cases:
horizontal .sf-divider spans its container width, and
.sf-divider--vertical stays a narrow rule inside a flex row instead of
stretching to the row's full width.

Verified against the built dist/slashed.optimal.css bundle directly
(pre-installed chromium executable, since this sandbox lacks the
headless-shell binary the project's own Playwright config expects) —
all four assertions in this describe block pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0113XBTydmejAnYJt9CTyYRc
@jackgranatowski
jackgranatowski merged commit 87a3e4e into main Jul 13, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants