docs: update component prop naming with variant docs - #8289
Conversation
|
There was a problem hiding this comment.
Pull request overview
Updates the style-guide documentation for Primer React component prop naming by adding explicit guidance on when to use the variant prop (semantic purpose) and when to avoid it (pure appearance).
Changes:
- Add a guideline recommending
variantvalues describe semantic purpose (e.g.info,warning) rather than colors. - Add a guideline discouraging
variantfor purely visual concerns like size/padding/shape, recommending more specific prop names instead.
Show a summary per file
| File | Description |
|---|---|
| .github/skills/style-guide/docs/component-prop-naming.md | Adds two new documentation sections (and TOC entries) clarifying semantic vs appearance-driven usage of the variant prop. |
Review details
Tip
Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Suppressed comments (1)
.github/skills/style-guide/docs/component-prop-naming.md:177
- For consistency with other prop references in this doc, consider formatting
variantas code here as well.
The variant prop is exclusively meant to communicate the purpose of a component.
It must not be used to communicate the appearance of a component. For example:
- Files reviewed: 1/1 changed files
- Comments generated: 2
- Review effort level: Lite
b73b72e to
b5aa17b
Compare
73d916f to
b73b72e
Compare
Part of: https://github.com/github/primer/issues/6737
Changelog
New
variantprop to the style guide skillChanged
Removed
Rollout strategy
This is a change to docs