Skip to content

feat(layout): add .sf-place-center primitive + clarify the centring story - #651

Merged
jackgranatowski merged 3 commits into
mainfrom
claude/full-bleed-div-section-owa86g
Jul 24, 2026
Merged

feat(layout): add .sf-place-center primitive + clarify the centring story#651
jackgranatowski merged 3 commits into
mainfrom
claude/full-bleed-div-section-owa86g

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Resolves the centring-ergonomics gap surfaced while clarifying .sf-center. Two related parts:

1. New primitive: .sf-place-center (core/layout.css)

Every centring path in SLASHED forced you to adopt a specific primitive — .sf-cluster--center (wrap row), .sf-stack--center (column), .sf-imposter (absolute), .sf-cover__center (full-height). There was no way to just centre a plain element's content on both axes without inheriting that primitive's semantics, so people reached for a generic .center that doesn't exist here.

.sf-place-center { display: grid; place-items: center; }

It's the framework's named form of the community display:grid; place-items:center idiom (cf. Tailwind's place-items-center), and pairs with .sf-center by name and behaviour: .sf-center centres itself (a max-width wrapper), .sf-place-center centres its content. Purely additive — no rename, no breaking change.

2. Docs: clarify .sf-center is a primitive, not a .center utility (docs/layout.md)

New "Centring" section: states that centring is expressed on a primitive, maps each intent to the right one (now including .sf-place-center for the plain-box case), and spells out the .sf-center gotchas (centres itself, needs a block-level element).

Includes annotation (token-annotations.json), demo coverage card + cov-data entry, layout.md primitives table, behaviour tests, CHANGELOG, and regenerated API artifacts (api-index, classes.md, registry.json, llms.txt, configurator data).

Type

  • fix
  • feat
  • docs
  • chore / tooling

Checklist

  • Conventional Commit messages — enforced by commitlint
  • npm run lint:css passes (stylelint)
  • npm run build rebuilds dist/
  • npm test passes (unit + Playwright e2e) — 132 unit, layout + demo-visual e2e green locally
  • Version references in sync — N/A, no version-related file changed
  • LLM guide reviewed — core/*.css touched; check:llm-guide green, llms.txt regenerated
  • Generated artifacts regenerated, not hand-edited — check:registry / audit:check green
  • CHANGELOG.md updated under ## Unreleased
  • Breaking changes include migration docs — none (purely additive)

Notes

New public class is PUBLIC-tier, layout kind, shipped in both bundles. Demo gains one live preview card; tests/coverage.test.js (class ↔ demo ↔ api-index parity) stays green.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added .sf-place-center, a layout utility that centers content horizontally and vertically.
    • Clarified when to use .sf-place-center versus .sf-center.
  • Documentation

    • Updated layout guidance, class references, API indexes, and changelog entries.
  • Tests

    • Added coverage confirming two-axis centering behavior.

.sf-center collides with the utility-framework convention where `.center`
centres an element's content. SLASHED is BEM-first and ships no generic
centring utility: .sf-center is the Every-Layout Center primitive that centres
*itself*. Add a "Centring" section mapping each centring intent to its
primitive/modifier (cluster--center, stack--center, imposter, cover__center,
center--intrinsic, …) and spelling out that .sf-center centres itself, needs a
block-level element, and when to pick it over .sf-container.

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

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 70098825-6c5a-4130-ae2d-898a58e8f8a9

📥 Commits

Reviewing files that changed from the base of the PR and between a4278f2 and bbc909a.

⛔ Files ignored due to path filters (1)
  • configurator/src/data/classes.generated.json is excluded by !**/*.generated.*
📒 Files selected for processing (11)
  • CHANGELOG.md
  • core/layout.css
  • demo/index.html
  • docs/api-index.json
  • docs/api-index.md
  • docs/classes.md
  • docs/layout.md
  • docs/registry.json
  • docs/token-annotations.json
  • llms.txt
  • tests/layout.spec.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/layout.md

📝 Walkthrough

Walkthrough

Adds .sf-place-center, validates its two-axis content centring, updates coverage and generated indexes, and documents how it differs from .sf-center.

Changes

Centring primitive

Layer / File(s) Summary
Primitive implementation and validation
core/layout.css, tests/layout.spec.js
Defines .sf-place-center with grid and place-items: center, with computed-style and visual-centering tests.

Coverage and generated indexes

Layer / File(s) Summary
Coverage and generated indexes
demo/index.html, docs/api-index.*, docs/classes.md, docs/registry.json, docs/token-annotations.json, llms.txt
Adds .sf-place-center to the demo coverage data and generated class metadata, registries, counts, and references.

Centring guidance

Layer / File(s) Summary
Centring guidance
docs/layout.md, CHANGELOG.md
Documents .sf-place-center, clarifies .sf-center wrapper and intrinsic-centering behavior, and maps common centring intents to relevant primitives and modifiers.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

Suggested labels: codex

Suggested reviewers: claude

🚥 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 summarizes the main additive change: adding .sf-place-center and clarifying centring documentation.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/full-bleed-div-section-owa86g

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 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: 3

🤖 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 `@docs/layout.md`:
- Around line 170-172: Correct the grammar in the `.sf-center` documentation
paragraph by replacing “There a `.center` class” with “A `.center` class” or
“There, a `.center` class,” without changing the surrounding explanation.
- Around line 168-175: Update the comparative reference to avoid the
unregistered `.center` class, or add `.center` to docs/ref-allowlist.json with a
reason documenting that it is an intentional non-SLASHED utility-framework
reference. Preserve the explanation distinguishing generic child-centering
utilities from the `.sf-center` Center primitive.
- Around line 193-195: Update the sizing explanation in the `.sf-center`
documentation to specifically describe flex-row stretch behavior, avoiding the
absolute claim that all flex/grid items are sized by their parent. Preserve the
note that `.sf-grid-flex--center` does not stretch its children and retain the
existing `content-box` and `--sf-center-max` explanation.
🪄 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: 4bbc0035-ed30-49a5-b847-300d1ce8b968

📥 Commits

Reviewing files that changed from the base of the PR and between 22be5bb and d4ab1c5.

📒 Files selected for processing (1)
  • docs/layout.md

Comment thread docs/layout.md Outdated
Comment thread docs/layout.md Outdated
Comment thread docs/layout.md Outdated
…izing note

Two valid CodeRabbit nits on the new "Centring" section:
- "There a `.center` class" → "There, a `.center` class".
- The "sized by its parent" clause over-claimed (implied all flex/grid items
  stretch). Rephrase to say the parent's layout takes over sizing/alignment so
  .sf-center's own width/margin model no longer drives the result.

Left `.center` as-is (not allowlisted): check:doc-refs only scans `.sf-*`
classes and `--sf-*` tokens (CLASS_REF_RE = /\.sf-.../), so a bare `.center`
comparative mention is never flagged — CI check:doc-refs is green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LywrnXafVz2rVBNF4TuDbi
@coderabbitai coderabbitai Bot removed the codex label Jul 24, 2026
Every centring path in SLASHED forced you to adopt a specific primitive —
.sf-cluster--center (wrap row), .sf-stack--center (column), .sf-imposter
(absolute), .sf-cover__center (full-height). There was no way to just centre a
plain element's content on both axes without inheriting that primitive's
semantics, so people reached for a generic `.center` that doesn't exist here.

Add .sf-place-center (`display: grid; place-items: center`) — the framework's
named form of the community grid-place-items-center idiom (cf. Tailwind's
place-items-center). It pairs with .sf-center by name and behaviour: .sf-center
centres ITSELF (a max-width wrapper), .sf-place-center centres its CONTENT.

Every-Layout parallel: the "Center" primitive is horizontal self-centring
(our .sf-center); centring one thing in a box has no named primitive there
either — everyone falls back to grid + place-items. This gives it a name.

Includes: annotation, demo coverage card + cov-data entry, layout.md primitives
table + Centring section, behaviour tests, CHANGELOG, and regenerated API
artifacts. Purely additive — no rename, no breaking change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LywrnXafVz2rVBNF4TuDbi
@jackgranatowski jackgranatowski changed the title docs(layout): clarify .sf-center is a primitive, not a .center utility feat(layout): add .sf-place-center primitive + clarify the centring story Jul 24, 2026
@jackgranatowski

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot added the codex label Jul 24, 2026
@jackgranatowski
jackgranatowski merged commit 2bc33b2 into main Jul 24, 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