docs: differentiate identical/vague API descriptions - #670
Conversation
The 14 .sf-width-* utility classes all inherited the same section-banner
description in the generated API index (the only exact-duplicate group in
the whole surface). Give each its own precise annotation: the -10…-90
fractions each state their percentage cap, and the keyword variants
(full/auto/fit/min/max) describe their specific CSS width behaviour.
Also unify the 30 ramp lightness aliases (superlight/xlight/lighter/
darker/xdark/superdark across primary/secondary/tertiary/action/neutral)
so every one names its numeric equivalent (e.g. -darker → -600), matching
the format the -lighter/-superdark entries already used. Mapping verified
against core/tokens.css; base has no such aliases.
Edits are in the hand-authored docs/token-annotations.json; all generated
artifacts (api-index.{json,md}, llms.txt, configurator data, vscode custom
data) regenerated via npm run docs. check:annotations, check:doc-refs,
check:llm-guide, check:registry, audit:check, check:dead-knobs all pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017dNWVwVRAS8Sn1qqKzTRqZ
A deeper pass for under-differentiated descriptions found that the six --sf-color-*-tint tokens resolve to var(--sf-color-*-a5) (same 5% alpha value) but never said so. Append "— alias of --sf-color-*-a5" to each, consistent with the ramp lightness aliases, so the alias relationship is explicit in the index. Verified nothing else collapses: after the sf-width and lightness-alias fixes, no sibling group shares a non-differentiating description — every remaining shared-template group (alpha %, heading sub-properties, on-color text, source-dark counterparts) already carries its own differentiator per entry. The 163 other single-var alias tokens are intentional semantic knobs that document their own default (e.g. "Defaults to --sf-radius-m") and are correctly left as-is. Regenerated via npm run docs; check:annotations, check:doc-refs, check:registry, audit:check all pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017dNWVwVRAS8Sn1qqKzTRqZ
📝 WalkthroughWalkthroughThe documentation now identifies color alias source tokens and provides specific descriptions for percentage-based and intrinsic content-width utilities across API indexes, token annotations, and ChangesDocumentation metadata
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Greptile SummaryThe PR replaces duplicate or vague API descriptions with precise documentation for width utilities and color-token aliases.
Confidence Score: 5/5The PR appears safe to merge, with the revised documentation matching the underlying CSS behavior and generated outputs. No actionable defect remains: the width descriptions match their utility declarations, the color alias notes match their source token targets, and the generated artifacts consistently reproduce the source annotations.
|
| Filename | Overview |
|---|---|
| docs/token-annotations.json | Updates the source annotations with width behavior and color alias descriptions that agree with the underlying CSS declarations. |
| docs/api-index.json | Regenerated API data consistently reflects the revised source annotations. |
| docs/api-index.md | Regenerated reference tables expose the new descriptions without identified inconsistencies. |
| configurator/src/data/api-index.generated.json | Regenerated configurator token metadata consistently carries the revised notes. |
| configurator/src/data/classes.generated.json | Regenerated class metadata carries the differentiated width utility descriptions. |
| dist/css-custom-data.json | Regenerated editor metadata consistently incorporates the updated token and utility documentation. |
| llms.txt | Regenerated LLM-facing documentation reflects the same API description updates. |
Reviews (1): Last reviewed commit: "docs: name the -a5 alias in the -tint to..." | Re-trigger Greptile
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@llms.txt`:
- Around line 553-554: Update the `.sf-width-auto` and `.sf-width-fit`
descriptions to accurately reflect block-flow sizing: state that
`inline-size:auto` fills available inline space subject to constraints, and that
`fit-content` uses content-based sizing capped by available space while wrapping
at permitted soft breaks.
🪄 Autofix
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: 269dc479-78ab-4ab6-8461-1bc34ca283d1
⛔ Files ignored due to path filters (3)
configurator/src/data/api-index.generated.jsonis excluded by!**/*.generated.*configurator/src/data/classes.generated.jsonis excluded by!**/*.generated.*dist/css-custom-data.jsonis excluded by!**/dist/**
📒 Files selected for processing (4)
docs/api-index.jsondocs/api-index.mddocs/token-annotations.jsonllms.txt
| - `.sf-width-auto` — Intrinsic auto width (inline-size:auto) — sizes to the box’s normal layout. | ||
| - `.sf-width-fit` — Width sized to its own content (fit-content). |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
printf '%s\n' '--- llms.txt ---'
sed -n '544,557p' llms.txt
printf '%s\n' '--- utility declarations ---'
sed -n '220,255p' optional/utilities.css
printf '%s\n' '--- related width documentation/usages ---'
rg -n --glob '!node_modules' --glob '!dist' 'sf-width-(auto|fit)|inline-size:\s*(auto|fit-content)|fit-content' .Repository: codeslash-dev/SLASHED
Length of output: 32745
🌐 Web query:
CSS inline-size auto normal block flow fit-content keyword sizing available space soft wrapping MDN CSS Sizing
💡 Result:
The inline-size CSS property is a logical sizing property that defines an element's size along its inline axis [1][2]. Because it is logical, its effect is relative to the element's writing-mode rather than physical orientation: in horizontal writing modes, it corresponds to width, while in vertical writing modes, it corresponds to height [1][3]. Key characteristics include: Axis Mapping: It works in tandem with block-size (which defines the dimension perpendicular to the inline axis) [1]. Using these logical properties allows layouts to adapt automatically when the writing mode or direction of content changes, enhancing internationalization and responsive design [2][3]. Sizing Keywords: inline-size accepts the same values as the traditional width and height properties [1][4]. Relevant intrinsic sizing keywords include: - auto: The initial value, typically causing the element to size automatically based on its content and layout context [4][5]. - min-content: Constrains the element to the smallest size required by its content (e.g., the length of the longest word or element) [6][5]. - max-content: Constrains the element to the largest size required by its content (e.g., the width of the content without line breaks) [6][5]. - fit-content: Adapts the element's size to its content while respecting the limits of its container, calculated as min(max-content, max(min-content, stretch)) [6][5]. Soft Wrapping and Available Space: The property interacts with the standard CSS box model and layout algorithms (like Flexbox or Grid) to determine how an element occupies available space [2][7]. When an element is sized with auto or fit-content, it naturally participates in soft wrapping; the browser will break text or inline content across lines to fit within the inline-size constraint, provided that the white-space property allows wrapping [2][6]. Advanced Manipulation: The calc-size function can be used to perform calculations on these intrinsic sizing keywords (like fit-content or max-content), which is not possible with the standard calc function [7]. This is particularly useful for creating fluid, animated, or responsive layouts where specific sizing constraints are required [7].
Citations:
- 1: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/inline-size
- 2: https://cssportal.com/css-properties/inline-size.php
- 3: https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Logical_properties_and_values
- 4: https://www.w3schools.com/CSSref/css_pr_inline-size.php/css_ref_pseudo_classes.php
- 5: https://www.w3.org/TR/css-sizing/
- 6: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/fit-content
- 7: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/calc-size
🏁 Script executed:
#!/bin/bash
python3 - <<'PY'
from pathlib import Path
import re
css = Path("optional/utilities.css").read_text()
expected = {
"sf-width-auto": "auto",
"sf-width-fit": "fit-content",
}
for class_name, value in expected.items():
pattern = rf"\.{re.escape(class_name)}\s*\{{\s*inline-size:\s*([^;]+);"
match = re.search(pattern, css)
assert match, f"missing declaration for {class_name}"
actual = match.group(1).strip()
assert actual == value, (class_name, actual, value)
print(f"{class_name}: inline-size:{actual}")
print("normal-flow auto: automatic inline sizing; block-level width fills available space")
print("fit-content: min(max-content, max(min-content, available space)); soft breaks remain available")
PYRepository: codeslash-dev/SLASHED
Length of output: 407
Update the descriptions for .sf-width-auto and .sf-width-fit.
In normal block flow, inline-size:auto fills the available inline space, subject to constraints. fit-content uses content-based sizing, capped by available space, and wraps at permitted soft breaks.
🤖 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 `@llms.txt` around lines 553 - 554, Update the `.sf-width-auto` and
`.sf-width-fit` descriptions to accurately reflect block-flow sizing: state that
`inline-size:auto` fills available inline space subject to constraints, and that
`fit-content` uses content-based sizing capped by available space while wrapping
at permitted soft breaks.
The 14 .sf-width-* utility classes all inherited the same section-banner
description in the generated API index (the only exact-duplicate group in
the whole surface). Give each its own precise annotation: the -10…-90
fractions each state their percentage cap, and the keyword variants
(full/auto/fit/min/max) describe their specific CSS width behaviour.
Also unify the 30 ramp lightness aliases (superlight/xlight/lighter/
darker/xdark/superdark across primary/secondary/tertiary/action/neutral)
so every one names its numeric equivalent (e.g. -darker → -600), matching
the format the -lighter/-superdark entries already used. Mapping verified
against core/tokens.css; base has no such aliases.
Edits are in the hand-authored docs/token-annotations.json; all generated
artifacts (api-index.{json,md}, llms.txt, configurator data, vscode custom
data) regenerated via npm run docs. check:annotations, check:doc-refs,
check:llm-guide, check:registry, audit:check, check:dead-knobs all pass.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_017dNWVwVRAS8Sn1qqKzTRqZ
Summary by CodeRabbit