Skip to content

feat: add .sf-width-* content-width utility classes and rename .sf-is-skeleton to .sf-is-shimmer - #650

Merged
jackgranatowski merged 5 commits into
mainfrom
claude/session-n8kqqf
Jul 23, 2026
Merged

feat: add .sf-width-* content-width utility classes and rename .sf-is-skeleton to .sf-is-shimmer#650
jackgranatowski merged 5 commits into
mainfrom
claude/session-n8kqqf

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds 14 new content-width utility classes (.sf-width-10 through .sf-width-full) that constrain elements to fractions of the --sf-content-width token and centre them in normal flow. It also renames the .sf-is-skeleton state class to .sf-is-shimmer to avoid naming collision with the planned .sf-skeleton component (roadmap item #384).

The new utilities ship from optional/utilities.css and are opt-in. The rename is a breaking change documented in migration.md.

Type

  • feat

Changes

New utilities:

  • .sf-width-10, .sf-width-20, …, .sf-width-90 — constrain to 10%–90% of content width
  • .sf-width-auto, .sf-width-fit, .sf-width-full, .sf-width-max, .sf-width-min — CSS width keywords
  • All centre via margin-inline: auto and shrink below the cap on narrower parents

Breaking rename:

  • .sf-is-skeleton.sf-is-shimmer (shimmer animation state for loading placeholders)
  • Updated in core/states.css, demo, tests, and all generated docs

Generated artifacts updated:

  • docs/api-index.json — class count: 312 → 326; utility count: 33 → 47
  • docs/api-index.md, docs/classes.md, docs/registry.json — counts and listings
  • configurator/src/data/classes.generated.json — new utilities and renamed state
  • llms.txt — new machine-readable LLM reference (generated by new scripts/gen-llms-txt.js)

Version sync:

  • llms.txt added to scripts/version-synced-files.js and scripts/artifacts.json
  • scripts/version-sync.js and scripts/check-version-sync.js updated to handle llms.txt header

Checklist

  • Conventional Commit messages
  • npm run lint:css passes
  • npm run build rebuilds dist/
  • npm test passes (unit + Playwright e2e)
  • Version references in sync (npm run check:version)
  • Generated artifacts regenerated (npm run docs)
  • CHANGELOG.md updated (implied by feature + breaking change)
  • Breaking changes documented in docs/migration.md

Notes

The new llms.txt file is a distilled, machine-generated reference of SLASHED's complete token and class vocabulary, sized to fit into AI coding assistant context windows (Claude Code, Cursor, Windsurf, etc.). It is regenerated by npm run docs and version-stamped alongside other artifacts. The .sf-is-skeleton.sf-is-shimmer rename resolves the naming collision documented in roadmap #384 and #575.

https://claude.ai/code/session_017x2JYaWJoPoHWNCEhDA7NR

Summary by CodeRabbit

  • New Features

    • Added content-width utilities for fractional widths and full, auto, fit, minimum, and maximum sizing.
    • Added a complete machine-readable reference covering the current token and class vocabulary.
  • Breaking Changes

    • Renamed the loading placeholder state from .sf-is-skeleton to .sf-is-shimmer. Update existing markup accordingly; behavior remains unchanged.
  • Documentation

    • Updated API references, migration guidance, examples, and class listings to reflect the new shimmer state and width utilities.
  • Bug Fixes

    • Improved version synchronization and validation for the generated reference file.

claude added 3 commits July 22, 2026 21:23
Resolve the naming collision between the shipped shimmer *state*
(.sf-is-skeleton, applicable to any element) and the planned .sf-skeleton
*component* (roadmap / #384 item 8). Renaming the state to .sf-is-shimmer
reserves "skeleton" for the component alone, preserves the framework's
state/component axis separation (.sf-is-* = state, .sf-* = structural), and
makes the class name mirror its driving token, --sf-animation-shimmer.

Shipped ahead of the component so this one breaking rename stays out of the
otherwise purely additive .sf-skeleton release. Behaviour, tokens, and markup
support are unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017x2JYaWJoPoHWNCEhDA7NR
…531)

Opt-in helpers to constrain an element to a fraction of the content column
(--sf-content-width) with auto-centering, a common quick-constraint on
marketing layouts:

- .sf-width-10 … .sf-width-90 — max-inline-size: calc(--sf-content-width *
  fraction) with inline-size:100% + margin-inline:auto, so the element shrinks
  on narrow parents and centres in normal flow.
- Keyword variants .sf-width-full / -auto / -fit / -min / -max mapping to
  100%-uncapped / auto / fit-content / min-content / max-content.

Logical properties throughout; driven entirely by the existing
--sf-content-width token (no new tokens). Documented in the LLM guide and
covered in the demo gallery.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017x2JYaWJoPoHWNCEhDA7NR
Add scripts/gen-llms-txt.js, wired into the npm run docs pipeline, producing a
compact llms.txt — the complete, current-version SLASHED token and class
vocabulary distilled for AI coding assistants (Claude Code, Cursor, Windsurf…)
so they use real --sf-*/.sf-* names instead of hallucinating them.

Derived entirely from docs/api-index.json (itself generated + CI-gated),
core/layers.css (cascade order) and package.json (version), so it cannot drift:

- Registered in scripts/artifacts.json — check-artifacts stages it on source
  change and CI --check fails on any staleness.
- Version header treated like docs/llm-guide.md: added to VERSION_SYNCED_FILES,
  re-stamped by version-sync, asserted by check-version-sync, and git-added by
  the release sync-main job (with matching fixture + failure-case tests).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017x2JYaWJoPoHWNCEhDA7NR
@coderabbitai

coderabbitai Bot commented Jul 22, 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: 50 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: 0b988c2c-8eec-4f85-a9b5-b6c7b9a97230

📥 Commits

Reviewing files that changed from the base of the PR and between 28e331c and 4fc269e.

📒 Files selected for processing (4)
  • demo/index.html
  • scripts/check-version-sync.js
  • scripts/version-sync.js
  • tests/check-version-sync.test.js
📝 Walkthrough

Walkthrough

This PR renames the shimmer state class, adds content-width utilities, generates llms.txt from API metadata, and extends version synchronization, release staging, documentation, demos, and tests for the updated public surface.

Changes

Public CSS surface

Layer / File(s) Summary
Rename the shimmer state
core/states.css, demo/index.html, tests/*, docs/*
The loading placeholder state is renamed from .sf-is-skeleton to .sf-is-shimmer across implementation, examples, tests, registries, and migration guidance.
Add content-width utilities
optional/utilities.css, demo/index.html, docs/*
Fractional and keyword .sf-width-* utilities are added with API metadata, registry entries, documentation, and demo coverage.

Documentation generation and synchronization

Layer / File(s) Summary
Generate the machine-readable reference
scripts/gen-llms-txt.js, package.json, scripts/artifacts.json, llms.txt
The documentation workflow generates llms.txt from package metadata, API entries, and cascade-layer declarations.
Synchronize and validate llms.txt
scripts/version-*.js, scripts/check-version-sync.js, tests/*, .github/workflows/release.yml
Version propagation, drift checks, release staging, and fixtures now include llms.txt.

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

Possibly related issues

Possibly related PRs

Suggested labels: codex

Suggested reviewers: claude, kiro-agent

🚥 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 captures the two main changes: new .sf-width-* utilities and the .sf-is-skeleton to .sf-is-shimmer rename.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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/session-n8kqqf

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.

@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown

Greptile Summary

This PR ships 14 new .sf-width-* content-width utility classes in optional/utilities.css and renames the .sf-is-skeleton state class to .sf-is-shimmer in core/states.css. It also introduces a new llms.txt machine-readable vocabulary reference, wired into the existing version-sync and artifact-check infrastructure.

  • New utilities.sf-width-10 through .sf-width-90 correctly pair inline-size: 100% + max-inline-size: calc(…) + margin-inline: auto to cap and centre elements; five keyword variants (auto, fit, full, min, max) map to bare CSS width keywords but the three intrinsic-sizing ones (fit, min, max) are missing margin-inline: auto — leaving them left-aligned in normal flow contrary to the block comment and PR description.
  • Breaking renamesf-is-skeletonsf-is-shimmer is updated consistently across CSS, tests, demo, configurator data, and all generated docs; migration notes are clear and complete.
  • llms.txt + tooling — the new generator, version-sync hook, CI check, and unit tests are well-structured and self-consistent; llms.txt is correctly registered in artifacts.json so the CI drift gate covers it.

Confidence Score: 4/5

Safe to merge after confirming the intended centering behaviour of the keyword width variants.

The rename, tooling, and version-sync additions are all well-constructed and consistently applied. The one real concern is the three intrinsic-sizing keyword variants (.sf-width-fit, .sf-width-min, .sf-width-max) — they don't apply margin-inline: auto, so they sit left-aligned in normal block flow while both the block comment and the PR description say all .sf-width-* classes centre. This is a present behavioural gap on newly shipped classes; correcting it before release avoids a follow-up breaking change or a confusing asymmetry in the API.

optional/utilities.css — specifically the five keyword-width rules at the end of the new block.

Important Files Changed

Filename Overview
optional/utilities.css Adds 14 new .sf-width-* utility classes; percentage variants (10–90) correctly apply margin-inline:auto, but the three intrinsic-sizing keyword variants (fit, min, max) are missing it — left-aligned in normal block flow contrary to the PR description and block comment.
core/states.css Renames .sf-is-skeleton → .sf-is-shimmer; CSS rules, comment, and selector structure all updated consistently.
scripts/gen-llms-txt.js New script generates llms.txt from api-index.json and package.json; reads layer order directly from layers.css; output is version-stamped and wired into npm run docs.
scripts/version-sync.js Adds llms.txt header-only re-stamp to the sync loop; registered in VERSION_SYNCED_FILES and covered by the write-set guard at the bottom of the script.
scripts/check-version-sync.js Adds check #6 for llms.txt header version; pattern and error messages consistent with existing checks.
.github/workflows/release.yml Adds llms.txt to the sync-main job's git add list, keeping it committed alongside other version artifacts on every release.
tests/states-full.spec.js Replaces .sf-is-skeleton with .sf-is-shimmer in the shimmer test; no other test changes required.
tests/check-version-sync.test.js Adds fixture setup and two failure-case tests (mismatched header, missing header) for the new llms.txt version check.
tests/version-sync.test.js Adds llms.txt fixture and asserts the header is bumped and old version is absent after version-sync runs.
docs/migration.md New section documents the .sf-is-skeleton → .sf-is-shimmer breaking rename, with rationale and a one-line migration instruction.
scripts/artifacts.json Registers llms.txt as a build output so the CI artifacts-drift check gates on it.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["npm run docs"] --> B["gen-llms-txt.js\n(reads api-index.json + package.json)"]
    B --> C["llms.txt\n(version-stamped)"]
    A --> D["gen-api-index.js\n(reads core/ + optional/)"]
    D --> E["docs/api-index.json"]
    E --> B

    C --> F["version-sync.js\n(re-stamps header only)"]
    F --> C

    G["npm run check:version"] --> H["check-version-sync.js\ncheck 6: llms.txt header == package.json"]
    H --> C

    I["release.yml sync-main job"] --> J["git add llms.txt"]
    J --> K["commit to main"]

    subgraph CSS_Changes
        L[".sf-is-skeleton"] -->|renamed| M[".sf-is-shimmer"]
        N["optional/utilities.css"] -->|new block| O[".sf-width-10 to .sf-width-90 + keyword variants"]
    end
Loading

Reviews (1): Last reviewed commit: "feat(docs): generate distilled llms.txt ..." | Re-trigger Greptile

Comment thread optional/utilities.css
Comment on lines +247 to +250
.sf-width-auto { inline-size: auto; }
.sf-width-fit { inline-size: fit-content; }
.sf-width-min { inline-size: min-content; }
.sf-width-max { inline-size: max-content; }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Keyword variants lack margin-inline: auto, but the PR description says "All centre via margin-inline: auto"

.sf-width-fit, .sf-width-min, and .sf-width-max produce intrinsically-sized elements that are narrower than their containing block, so without margin-inline: auto they will be left-aligned in normal flow — contrary to the stated behaviour. A developer who reaches for .sf-width-fit expecting the same centering behaviour as .sf-width-50 will find it pinned to the start edge.

.sf-width-auto and .sf-width-full are unaffected (both fill the container in block flow, so centering is a no-op), but the three intrinsic-sizing keywords genuinely need the declaration to honour the "centre in normal flow" contract documented in the block comment and PR description.

Suggested change
.sf-width-auto { inline-size: auto; }
.sf-width-fit { inline-size: fit-content; }
.sf-width-min { inline-size: min-content; }
.sf-width-max { inline-size: max-content; }
.sf-width-full { inline-size: 100%; max-inline-size: none; }
.sf-width-auto { inline-size: auto; }
.sf-width-fit { inline-size: fit-content; margin-inline: auto; }
.sf-width-min { inline-size: min-content; margin-inline: auto; }
.sf-width-max { inline-size: max-content; margin-inline: auto; }

# Conflicts:
#	demo/index.html
#	docs/api-index.json
#	docs/api-index.md
#	docs/classes.md
#	docs/registry.json
@coderabbitai coderabbitai Bot added the codex label Jul 23, 2026

@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: 2

🤖 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 `@demo/index.html`:
- Around line 4034-4035: In the documentation for `.sf-is-shimmer`, update the
parenthetical predecessor class from `.sf-is-shimmer` to `.sf-is-skeleton`,
leaving the current class name and all other description text unchanged.

In `@scripts/version-sync.js`:
- Around line 94-98: The llms.txt version patterns are unanchored and can match
prose instead of the header. Update the expressions in scripts/version-sync.js
lines 94-98 and scripts/check-version-sync.js lines 93-97 to match the complete
heading line, enabling multiline matching for the checker; add a regression case
in tests/check-version-sync.test.js lines 119-133 where the version text appears
only in prose and is rejected.
🪄 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: ee590aba-d909-4e22-a8bd-60049c519d73

📥 Commits

Reviewing files that changed from the base of the PR and between 9f472c7 and 28e331c.

⛔ Files ignored due to path filters (1)
  • configurator/src/data/classes.generated.json is excluded by !**/*.generated.*
📒 Files selected for processing (25)
  • .github/workflows/release.yml
  • core/states.css
  • demo/index.html
  • docs/api-audit-checklist.md
  • docs/api-index.json
  • docs/api-index.md
  • docs/classes.md
  • docs/llm-guide.md
  • docs/migration.md
  • docs/registry.json
  • docs/roadmap.md
  • docs/states.md
  • docs/token-annotations.json
  • llms.txt
  • optional/utilities.css
  • package.json
  • scripts/artifacts.json
  • scripts/check-version-sync.js
  • scripts/gen-llms-txt.js
  • scripts/version-sync.js
  • scripts/version-synced-files.js
  • tests/check-version-sync.test.js
  • tests/demo-visual.spec.js
  • tests/states-full.spec.js
  • tests/version-sync.test.js

Comment thread demo/index.html Outdated
Comment thread scripts/version-sync.js
…t version regex

- demo/index.html: the .sf-is-shimmer coverage card said it was renamed from
  '.sf-is-shimmer' (a broad find/replace had rewritten the historical name);
  restore the correct predecessor '.sf-is-skeleton', matching token-annotations.
- scripts/version-sync.js + check-version-sync.js: line-anchor (multiline) the
  llms.txt '# SLASHED vX.Y.Z' header match so a '# SLASHED v…' string appearing
  inline in prose can't be stamped or accepted as the heading.
- tests/check-version-sync.test.js: add a regression case where the version
  appears only inline in prose and must be rejected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017x2JYaWJoPoHWNCEhDA7NR
@jackgranatowski
jackgranatowski merged commit 15e4854 into main Jul 23, 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