Skip to content

docs(css,ai): update custom property rules and migration skill coverage#6350

Merged
5t3ph merged 2 commits into
mainfrom
seckles/ai-docs-config-updates
May 29, 2026
Merged

docs(css,ai): update custom property rules and migration skill coverage#6350
5t3ph merged 2 commits into
mainfrom
seckles/ai-docs-config-updates

Conversation

@5t3ph
Copy link
Copy Markdown
Contributor

@5t3ph 5t3ph commented May 28, 2026

Description

Three areas of work combined on this branch:

CSS stylelint and linting updates:

  • Adds transition-behavior to the stylelint property order so it sorts correctly within the transition-* group
  • Adds the full set of CSS system color keywords (ButtonFace, CanvasText, GrayText, etc.) as allowed values in stylelint so forced-colors overrides don't trip the design token enforcement rule

CSS style guide additions (CONTRIBUTOR-DOCS/02_style-guide/01_css/):

  • 01_component-css.md: Documents section banner format, expands the :host exception with code examples covering UA resets, entry/exit transitions, and positioning surfaces; adds inherit guidance for sub-elements that track a variant value; clarifies native pseudo-class preference over attribute selectors for states
  • 02_custom-properties.md: Adds explicit rules for private property placement (:host does not encapsulate --_swc-*), exposure criteria (expose only when the component itself overrides, with nested component relationship exception), size variant pattern (single property overridden per size selector), state-specific custom property pattern for native browser states on internal elements, and full property name convention
  • 03_component-css-pr-checklist.md: Adds a Custom properties section covering all five new rules as checkable items
  • 05_anti-patterns.md: Updates anti-pattern # 6 with the nested component relationship exception; adds new anti-pattern # 10 covering size-specific custom properties

AI migration skill and rule updates (.ai/):

  • migration-phase-awareness.md: Adds "Migration plan checklist" as an explicit phase-completion step and surfaces it in the Migration Checkpoint format
  • migration-styling SKILL.md: Adds Step 5 to write @cssprop JSDoc tags on the SWC class for every exposed property after writing CSS
  • migration-documentation SKILL.md: Adds a @cssprop verification step to Phase 7 cross-check
  • consumer-migration-guide SKILL.md and prompt: Scopes guide content to what actually shipped in the source, not migration plan categories (Additive/Deferred reflect intent, not final state)
  • code-conformance.md: Makes the CSS PR checklist the first and explicit verification step rather than a passive reference

Motivation and context

Custom property exposure decisions were underdocumented, leading to inconsistent implementations across components — in particular: private properties declared on :host (which exposes them), size-specific custom properties that bloat the API surface, and missing @cssprop tags that break Storybook API docs. The PR feedback on Button that prompted these additions also identified that state-specific custom properties (:hover, :focus-visible, :active) on internal elements are correct and necessary because static-color compound overrides require them.

@5t3ph 5t3ph requested a review from a team as a code owner May 28, 2026 19:37
@5t3ph 5t3ph added Component:Documentation Issues or PRs involving changes to docs or docs website. Component prefix is for Jira integration. 2nd gen These issues or PRs map to our 2nd generation work to modernizing infrastructure. AI tooling labels May 28, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 28, 2026

⚠️ No Changeset found

Latest commit: 78c40f4

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Member

@cdransf cdransf left a comment

Choose a reason for hiding this comment

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

This looks awesome! ✨

@github-actions
Copy link
Copy Markdown
Contributor

📚 Branch Preview Links

🔍 First Generation Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6350

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

@caseyisonit caseyisonit added the Status:Ready for review PR ready for review or re-review. label May 28, 2026
@caseyisonit caseyisonit added Status:Ready for merge PR has 2 approvals, all tests pass, and is ready to merge and removed Status:Ready for review PR ready for review or re-review. labels May 29, 2026
@5t3ph 5t3ph enabled auto-merge (squash) May 29, 2026 15:50
@5t3ph 5t3ph merged commit 67ce833 into main May 29, 2026
21 of 27 checks passed
@5t3ph 5t3ph deleted the seckles/ai-docs-config-updates branch May 29, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2nd gen These issues or PRs map to our 2nd generation work to modernizing infrastructure. AI tooling Component:Documentation Issues or PRs involving changes to docs or docs website. Component prefix is for Jira integration. Status:Ready for merge PR has 2 approvals, all tests pass, and is ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants