Skip to content

docs(storybook): docs cleanup#6495

Closed
rise-erpelding wants to merge 26 commits into
mainfrom
rise-erpelding/docs-site-small-updates
Closed

docs(storybook): docs cleanup#6495
rise-erpelding wants to merge 26 commits into
mainfrom
rise-erpelding/docs-site-small-updates

Conversation

@rise-erpelding

@rise-erpelding rise-erpelding commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Style guide: Added .ai/rules/text-formatting.md, codifying capitalization, <kbd> usage, CSS-class-in-prose, em dash, backtick-value, UI-element-naming, and callout conventions for docs going forward. Updated .ai/rules/stories-documentation.md and .ai/rules/stories-format.md to match the structural decisions below (Anatomy shape, static-color story pattern, single-story-section headings, narrowed Behaviors "Focus management" guidance).
  • Anatomy section standardized: Every migrated component's ## Anatomy section now uses a flat, unordered list of parts with slot names called out inline, replacing five inconsistent shapes (numbered lists, ### Content/#### Slots/#### Properties splits, ### Visual structure/### Technical structure splits). Applied to accordion, tabs, badge, avatar, status-light, color-loupe, color-handle, progress-circle, meter, divider, and illustrated-message.
  • Static color sections standardized: Rewrote the static-color prose in action-button, button, progress-circle, meter, divider, and link to a single sourced template ("Use static-color when the component needs to sit on top of a photo or colored background..."), sourced from Spectrum's published static-color usage guidance. Removed the unused three-story static-color pattern (StaticBlack/StaticWhite/StaticColors) from the stories rules in favor of the combined pattern every component already uses.
  • Options/States/Behaviors placement fixes: Moved avatar's Disabled state out of ## Options into a new ## States section (with a matching story retag); deduplicated divider's orientation content, which was documented twice (once in Options, once in Behaviors); consolidated the Pending state fully into ## States for both action-button and button, removing the duplicate ## Behaviors entry each had.
  • Sentence-case headings + lint enforcement: Fixed Title Case heading violations across badge, status-light, tabs, typography, icon (internal), opacity-checkerboard (internal), and several patterns/controllers docs (prompt-field, suggestion-group, upload-artifact, focusgroup-navigation-controller). Added a new sentence-case check to scripts/validate-docs-pages.js (yarn lint:docs-pages), currently scoped to component/internal genres.
  • Story name / heading audit: Storybook auto-generates a Title Case display name from a story's export name unless an explicit storyName override exists; audited and added missing overrides across accordion, link, tooltip, tabs, badge, status-light, typography, icon, opacity-checkerboard, and progress-circle so every hand-authored heading matches what actually renders.
  • Migration guides standardized: Added a consistent "Installation" section (install command, before/after import snippet, monolithic-package callout) to the accordion, button-group, button, color-loupe, and illustrated-message migration guides. Fixed an incorrect import path in the color-loupe migration guide (@adobe/spectrum-wc/components/color-loupe@adobe/spectrum-wc/components/color-loupe/swc-color-loupe.js, the path that actually registers the element).
  • API documentation completeness: Added missing @cssprop entries to Button.ts (2), IllustratedMessage.ts (10), Tab.ts (4), and Tabs.ts (1), and missing @fires entries to Tooltip.base.ts (4), so the generated API tables match the component CSS/events. Fixed an invalid @example in Badge.ts (fixed="fill" is not a valid value; corrected to fixed="block-end"). Removed a stale "Breaking change" note from Tabs.base.ts's direction property doc that was rendering inside the live API table. Documented accordion's focus()/click() method delegation and corrected an avatar outline-default claim that belonged under Avatar Group, not the single-avatar Outline section. All source-file changes are JSDoc-comment-only; no runtime behavior changed.
  • Docs site navigation and content fixes: Added the missing "Build with AI" entry to the Resources sidebar in preview.ts; removed a stale "Action bar" entry with no corresponding page; sentence-cased the Customization submenu labels to match their renamed pages. Deduplicated getting-started.mdx's installation instructions against get-started.mdx. Fixed a copy/paste bug in theme-scales.mdx ("theme" where "scale" was meant). Added a missing H1 to screen_reader_testing.mdx. Fixed broken/imprecise anchor links in accessibility_resources.mdx and an inaccurate cross-reference in accessible_pattern_libraries.mdx. Clarified in build-with-ai.mdx that there is not yet a Gen2-specific Agent Skill or llms.txt.
  • Formatting cleanup: Replaced em dashes with colons/semicolons/restructured sentences per the new style guide across dozens of files; wrapped keyboard key references in <kbd>; standardized > **Important**: blockquotes to ⚠️ **Important:**; backticked bare class/attribute-value names in bulleted lists; bolded UI element names on first mention; converted bare WCAG success-criterion mentions into links to the W3C Understanding docs. Note: not all em dashes were addressed, see the PR comment to learn why.
  • Misc cleanup: Removed the retired section-order story parameter from all 10 stories in accordion.stories.ts (section order is hand-authored in MDX, not story-driven). Collapsed a redundant ## States / ### States heading pair in color-handle.mdx into one heading. Removed two stray JSDoc comments duplicating MDX content from typography.stories.ts. Removed a duplicated "Rendering and styling migration analysis" sidebar entry mistakenly copy-pasted into the Toast section.
Follow-up tickets to be filed (11)
  • Typography Accessibility section: typography.mdx is the only component doc with no Accessibility section at all. Real, sourceable content exists (link underline styling, semantic-tag-to-type-style mapping, heading-order best practice); needs a new MDX section plus a new accessibility-tagged story, since neither exists yet.
  • Badge fixed attribute validation: the fixed attribute has no runtime validation or dev-mode warning for invalid values, unlike the sibling variant attribute. An invalid value silently produces a dead CSS class with no visible effect and no error.
  • Extend the new sentence-case lint check to patterns and controllers: the heading-casing lint check added in this PR is currently scoped to components only. The pattern/controller doc content itself has already been fixed to sentence case; only the lint enforcement itself still needs extending.
  • Fix a Windows-only lint script bug: the docs-page lint script silently reports "0 files checked, all pass" on Windows due to a path-separator mismatch, meaning none of its checks currently run for a contributor on Windows (Linux CI is unaffected).
  • Author a per-unit MDX doc page for button-group: this component has no docs page of its own yet; several distinct, non-duplicated documentation blocks currently live only as JSDoc comments in the stories file and need a proper home.
  • Wire up additional API tables for tabs: swc-tab and swc-tab-panel have their own CSS custom properties and slots that never render on the tabs docs page because the story config only exposes the parent swc-tabs table. A related undocumented custom property on the tab panel also needs annotating.
  • Fix a few accessibility-copy inaccuracies: progress-circle's docs omit some ARIA attributes it actually sets and overstate live-region announcement behavior; badge's migration guide is missing a required role attribute that the main docs page already documents correctly.
  • Reword stale legacy-comparison notes: a handful of components still describe current behavior by contrasting it against the previous generation, or contain internal backlog notes that render live in the generated API tables. Needs a wording pass so these read as current-behavior-only.
  • Fix inaccurate dev-mode-warning claims: a couple of components' docs describe development warnings that don't actually exist in the source, while a few real warnings that do exist aren't documented anywhere on the main docs pages.
  • Add framework-integration and SSR/hydration guidance: there is currently no React/Angular/Vue integration guidance or SSR/hydration guidance anywhere in the docs site, despite both being common needs for a web-components library. This is net-new content, not a text fix.
  • Restructure the fonts guide: the fonts customization guide currently mixes Storybook-internal tooling instructions with consumer-facing setup steps; needs a split, plus a more prominent "required" callout for font setup on the getting-started page, since components render incorrectly without it.
  • Address em dashes/semicolons: see PR comment.

Motivation and context

Continuation of a documentation-quality pass on the 2nd-gen Storybook docs site: an initial style-guide sweep (capitalization, <kbd> usage, em dashes) expanded into a deeper structural-consistency pass across every migrated component's docs page (Anatomy, Options, States, Behaviors), plus fixes for verified inaccuracies and gaps surfaced during review (invalid examples, missing API annotations, broken links, an incorrect migration-guide import path). No component runtime behavior changed.

Related issue(s)

  • N/A: no associated ticket; general docs-site cleanup.

Screenshots

N/A, documentation only.


Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed at the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Reviewer's checklist

  • Includes a Github Issue with appropriate flag or Jira ticket number without a link
  • Includes thoughtfully written changeset if changes suggested include patch, minor, or major features
  • Automated tests cover all use cases and follow best practices for writing
  • Validated on all supported browsers
  • All VRTs are approved before the author can update Golden Hash

Manual review test cases

  • Component doc pages read consistently

    1. Go to /docs/components-accordion--docs, /docs/components-badge--docs, and /docs/components-progress-circle--docs
    2. Confirm each ## Anatomy section is a flat bullet list with slot names called out inline, no ### Content or #### Slots/#### Properties subsections
    3. Confirm each ### Static colors subsection (where present) reads with the same "Use static-color when..." opening sentence
  • Avatar/divider/button Options-States-Behaviors placement

    1. Go to /docs/components-avatar--docs; confirm Disabled appears under ## States, not ## Options
    2. Go to /docs/components-divider--docs; confirm orientation is documented once, under ## Options only
    3. Go to /docs/components-button--docs and /docs/components-action-button--docs; confirm Pending appears once, under ## States, with no separate ## Behaviors entry
  • Lint check passes

    1. Run yarn lint:docs-pages
    2. Expect it to report all checked files passing (no Title Case heading violations, no broken Canvas references)
  • Migration guides render correctly

    1. Go to /docs/components-accordion-migration-guide--docs and /docs/components-color-loupe-migration-guide--docs
    2. Confirm each has an "Installation" section with a correct import path
    3. For color loupe specifically, confirm the import path is @adobe/spectrum-wc/components/color-loupe/swc-color-loupe.js
  • API tables reflect new annotations

    1. Go to /docs/components-button--docs, /docs/components-illustrated-message--docs, and /docs/components-tooltip--docs
    2. Confirm the CSS Custom Properties table lists --swc-button-max-inline-size, --swc-button-down-state-transform, the illustrated-message illustration/typography properties, and the Events table lists all four tooltip open/close events
  • Sidebar navigation is correct

    1. Open the 2nd-gen Storybook sidebar
    2. Confirm Build with AI appears under Resources
    3. Confirm there is no Action bar entry under the migration-analysis tree
    4. Confirm Customization submenu entries read "Getting started", "Theme and scales", "Component styles", "Global element styling"

Device review

  • Did it pass in Desktop?
  • Did it pass in (emulated) Mobile?
  • Did it pass in (emulated) iPad?

Accessibility testing checklist

  • Keyboard: not applicable; documentation-only change, no interactive component code modified.
  • Screen reader: not applicable; documentation-only change, no interactive component code modified.

@changeset-bot

changeset-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5c93559

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

@rise-erpelding rise-erpelding added Status:WIP PR is a work in progress or draft skip_vrt Skip VRT build; mark UI Tests green without running Chromatic labels Jul 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📚 Branch Preview Links

🔍 Gen1 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-6495

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.

@coveralls

coveralls commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 29448418525

Warning

No base build found for commit 41e0483 on main.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 96.257%

Details

  • Patch coverage: No coverable lines changed in this PR.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 39169
Covered Lines: 37903
Line Coverage: 96.77%
Relevant Branches: 6460
Covered Branches: 6018
Branch Coverage: 93.16%
Branches in Coverage %: Yes
Coverage Strength: 461.12 hits per line

💛 - Coveralls

@rise-erpelding
rise-erpelding force-pushed the rise-erpelding/docs-site-small-updates branch 6 times, most recently from 810e7a5 to 2827051 Compare July 14, 2026 13:51
@rise-erpelding
rise-erpelding marked this pull request as ready for review July 14, 2026 13:52
@rise-erpelding
rise-erpelding requested a review from a team as a code owner July 14, 2026 13:52
@rise-erpelding rise-erpelding added Status:Ready for review PR ready for review or re-review. run_vrt Triggers the Chromatic VRT run for 2nd-gen and removed skip_vrt Skip VRT build; mark UI Tests green without running Chromatic Status:WIP PR is a work in progress or draft labels Jul 14, 2026

@rise-erpelding rise-erpelding Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This migration hit main right when the effort to switch stories to mdx did, I believe, so it is the only component that doesn't have an mdx page right now. Converting this is in the list of follow-up tickets!

@Rajdeepc Rajdeepc added the High priority PR review PR is a high priority and should be reviewed ASAP label Jul 14, 2026
Comment on lines 141 to 161
### Em dashes

Do not use em dashes (`—`) in documentation prose or code comments. Replace them with the punctuation that matches the sentence's intent:

| Em dash usage | Replace with |
| ------------------------------------- | ----------------------------- |
| Clause separator | Semicolon (`;`) |
| Introducing elaboration or an example | Colon (`:`) or a new sentence |
| Parenthetical aside | Comma or parentheses |

```markdown
<!-- ❌ Bad -->

appearance — disabled colors and an animated spinner
fill-only — fill-style="outline" is not supported

<!-- ✅ Good -->

appearance: disabled colors and an animated spinner
fill-only; fill-style="outline" is not supported
```

@rise-erpelding rise-erpelding Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

⚠️ An important note about em dashes ⚠️

The Adobe Spectrum writing guidelines don't actually have any problem with em dashes, but do explicitly say not to use semicolons. This is a bit contradictory to what we have here.

I'm working on getting some clarification here, but have been hesitant to try to do a full pass of the docs to remove or scale back em dashes if the agent is going to replace many of them with semicolons, which Adobe finds objectionable.

For now it is being added to my list of tickets to file in the PR description.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Guidance regarding em dashes: we can certainly continue to try to scale back on these because they're overused in AI.

Guidance regarding semicolons: we'll want to limit them, but I don't think we have to ban them. They shouldn't be the default substitute for em dashes though, and we should definitely avoid using any one punctuation pattern.

@rise-erpelding
rise-erpelding force-pushed the rise-erpelding/docs-site-small-updates branch from 3ccf175 to 1a788ce Compare July 14, 2026 15:58
@rise-erpelding
rise-erpelding requested a review from Rajdeepc July 14, 2026 15:59

@najikahalsema najikahalsema left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Submitting my review before my next meeting--I'm still reviewing the a11y docs!

Comment thread 2nd-gen/packages/swc/.storybook/guides/customization/fonts.mdx Outdated
Comment thread 2nd-gen/packages/swc/components/avatar/avatar.mdx Outdated
Comment thread 2nd-gen/packages/swc/patterns/conversational-ai/prompt-field/prompt-field.mdx Outdated
Comment thread 2nd-gen/packages/swc/patterns/conversational-ai/system-message/system-message.mdx Outdated
Comment thread 2nd-gen/packages/swc/.storybook/guides/accessibility-guides/overview.mdx Outdated

@najikahalsema najikahalsema left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Submitting my review before my next meeting--I'm still reviewing the a11y docs!

@najikahalsema najikahalsema left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the rest of the files :)

Comment thread 2nd-gen/packages/swc/components/accordion/migration-guide.mdx Outdated
Comment thread 2nd-gen/packages/swc/components/action-button/action-button.mdx Outdated
Comment thread 2nd-gen/packages/swc/components/action-button/action-button.mdx Outdated
Comment thread 2nd-gen/packages/swc/components/badge/badge.mdx Outdated
Comment thread 2nd-gen/packages/swc/components/button/button.mdx Outdated
Comment thread 2nd-gen/packages/swc/components/avatar/avatar.mdx Outdated

@najikahalsema najikahalsema left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewed the Core overview and a11y guides in this pass. Will follow up w/ another review of customisation/ and resources/ files.

TLDR: RIP semicolons :( my favourite punctuation mark :(

Comment thread 2nd-gen/packages/core/overview.mdx Outdated

@najikahalsema najikahalsema left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Will do "learn-about-swc" and "resources" dirs tomorrow :^)

I need to follow up with Content strat about the "right" way to refer to our components in the case of stuff like "Button styling". 🫡

Comment thread 2nd-gen/packages/swc/.storybook/guides/customization/component-styles.mdx Outdated
Comment thread 2nd-gen/packages/swc/.storybook/guides/customization/fonts.mdx Outdated
Comment thread 2nd-gen/packages/swc/.storybook/guides/customization/fonts.mdx Outdated
Comment thread 2nd-gen/packages/swc/.storybook/guides/customization/fonts.mdx Outdated
Comment thread 2nd-gen/packages/swc/.storybook/guides/customization/fonts.mdx Outdated
Comment thread 2nd-gen/packages/swc/.storybook/guides/customization/theme-scales.mdx Outdated
Comment thread 2nd-gen/packages/swc/.storybook/guides/customization/theme-scales.mdx Outdated
Comment thread 2nd-gen/packages/swc/.storybook/guides/customization/theme-scales.mdx Outdated
Comment thread 2nd-gen/packages/swc/.storybook/guides/customization/theme-scales.mdx Outdated
Comment thread 2nd-gen/packages/swc/.storybook/guides/customization/theme-scales.mdx Outdated
Rise Erpelding and others added 16 commits July 15, 2026 09:12
Not finished yet! But GitHub is slowing way down and I can't apply others right now.

Co-authored-by: Najika Halsema Yoo <44980010+najikahalsema@users.noreply.github.com>
Co-authored-by: rise-erpelding <54716846+rise-erpelding@users.noreply.github.com>
Co-authored-by: Najika Halsema Yoo <44980010+najikahalsema@users.noreply.github.com>
Co-authored-by: rise-erpelding <54716846+rise-erpelding@users.noreply.github.com>
Co-authored-by: Najika Halsema Yoo <44980010+najikahalsema@users.noreply.github.com>
Co-authored-by: rise-erpelding <54716846+rise-erpelding@users.noreply.github.com>
@rise-erpelding
rise-erpelding force-pushed the rise-erpelding/docs-site-small-updates branch from 48c2368 to badde08 Compare July 15, 2026 16:18
- **Hold affordance** (`hold-affordance` / `longpress`): not yet available. In the interim, separate the secondary action into a distinct `swc-action-button` within an action group, which is more accessible than relying on a longpress interaction alone.
- **Toggle button**: selection and toggle UX is planned via `swc-toggle-button` and `swc-toggle-button-group`, available in a future release.

<DocsFooter />

@rise-erpelding rise-erpelding Jul 15, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Noting that our API tables don't parse the descriptions properly, for instance:

Image

I will make a follow up ticket for this.

I also think the text in our tables seems a bit small, @nikkimk is this an accessibility issue? Does it need to be at least 16px (it's 12.25px with code being 10.5px)? Would it be worthwhile to have a ticket to make the font size bigger?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great call.
I've addressed it here: #6524

Comment thread 2nd-gen/packages/swc/.storybook/guides/accessibility-guides/overview.mdx Outdated
@rise-erpelding
rise-erpelding force-pushed the rise-erpelding/docs-site-small-updates branch from 43fad9e to 5c93559 Compare July 15, 2026 20:30
@rubencarvalho rubencarvalho added skip_vrt Skip VRT build; mark UI Tests green without running Chromatic and removed run_vrt Triggers the Chromatic VRT run for 2nd-gen labels Jul 15, 2026

@najikahalsema najikahalsema left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Okay, all done with the content pass! Looking good!

Even when a section has only one story (e.g. a single `States` story called `States`), the `### Title` subheading appears under the `## Section` heading. This matches the `SpectrumStories` block's behavior when `hideTitle=false`.
When a section has only one story, and that story's rendered name is identical to the `## Section` heading (e.g. a single `States` story named `States`), omit the `### Title` subheading. Author the prose directly under `## Section`, with the `<Canvas>` reference immediately below it. A `## States` heading followed immediately by a `### States` subheading is redundant; collapse it to one heading. (`button.mdx`, `color-handle.mdx`.)

If a single-story section's rendered name _differs_ from the `## Section` heading (e.g. a `## Behaviors` section whose only story renders as "Toggle behavior"), keep the `### Title` subheading. It's adding real information there, not repeating the section title.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
If a single-story section's rendered name _differs_ from the `## Section` heading (e.g. a `## Behaviors` section whose only story renders as "Toggle behavior"), keep the `### Title` subheading. It's adding real information there, not repeating the section title.
If a section of a single story has a rendered name that _differs_ from the `## Section` heading, (e.g., a `## Behaviors` section whose only story renders as "Toggle behavior"), keep the `### Title` subheading. This adds valuable context because it's not simply repeating the section title.

4. _coming soon:_ providing granular customization via the theme object
5. extending the components to include custom styles
6. [globally overriding design token](#globally-override-design-tokens) custom properties
1. Use of style-related attributes per component such as `variant` and `size`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
1. Use of style-related attributes per component such as `variant` and `size`
1. Use style-related attributes per component, such as `variant` and `size`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Using "simple" verb tenses instead of -ing ending

5. extending the components to include custom styles
6. [globally overriding design token](#globally-override-design-tokens) custom properties
1. Use of style-related attributes per component such as `variant` and `size`
2. Providing [overrides of component custom properties](#overriding-component-custom-properties)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
2. Providing [overrides of component custom properties](#overriding-component-custom-properties)
2. Provide [overrides of component custom properties](#overriding-component-custom-properties)

6. [globally overriding design token](#globally-override-design-tokens) custom properties
1. Use of style-related attributes per component such as `variant` and `size`
2. Providing [overrides of component custom properties](#overriding-component-custom-properties)
3. _Coming soon:_ writing styles for specific component shadow parts

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
3. _Coming soon:_ writing styles for specific component shadow parts
3. _Coming soon:_ Write styles for specific component shadow parts

1. Use of style-related attributes per component such as `variant` and `size`
2. Providing [overrides of component custom properties](#overriding-component-custom-properties)
3. _Coming soon:_ writing styles for specific component shadow parts
4. _Coming soon:_ providing granular customization via the theme object

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
4. _Coming soon:_ providing granular customization via the theme object
4. _Coming soon:_ Provide granular customization via the theme object

## Step 7 Decommission Gen1
## Step 7: Decommission Gen1

Once no `<sp-*>` element remains in your app:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Once no `<sp-*>` element remains in your app:
Once there are no more `<sp-*>` elements in your app:


## What's not migrated yet

Gen2 is shipping components incrementally. The index of components on our docs site lists all components with a Gen2 implementation; anything not listed is still Gen1 only. Plan to keep the Gen1 package installed alongside Gen2 until your components of interest are migrated.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Gen2 ships components incrementally. The index of components on our docs site lists all components with a Gen2 implementation. Anything not listed remains in Gen1 only. Plan to keep the Gen1 package installed alongside Gen2 until your components of interest are migrated.

Running Gen1 and Gen2 together is expected during migration, but avoid keeping both versions of the same component on a page longer than necessary. This helps prevent shipping extra component code and loading unnecessary CSS custom properties.

- Remove the corresponding `@spectrum-web-components/*` per-element import as soon as the last `<sp-*>` usage of that component is gone, so each migrated component drops out of the bundle.
- Migrate one component at a time, by route or feature area if possible, so the dual-import window for any given page is short.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- Migrate one component at a time, by route or feature area if possible, to shorten the dual-import window for any given page.

## Get help

- Each component documents its own breaking changes in `<Component>/Migration guide`.
- The [customization guides](/docs/guides-customization-getting-started--docs) cover styling, theming, and fonts in depth.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- The [customization guides](/docs/guides-customization-getting-started--docs) cover styling, theming, and fonts in-depth.


- Each component documents its own breaking changes in `<Component>/Migration guide`.
- The [customization guides](/docs/guides-customization-getting-started--docs) cover styling, theming, and fonts in depth.
- [Open an issue on GitHub](https://github.com/adobe/spectrum-web-components/issues/new/choose) for migration questions or gaps.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
- [Open an issue on GitHub](https://github.com/adobe/spectrum-web-components/issues/new/choose) if you have any questions about the migration process or would like to report a bug.

@najikahalsema najikahalsema left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Okay, all done with the content pass! Looking good!

@5t3ph 5t3ph left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great job on this, appreciate your detailed eye!

General comment: some of the bolding seems sporadic, perhaps we need a formatting rule around that. Maybe start with removing it inside of sentences and allowing it for like bullet subheaders? Could be a deferred ticket!

Open to any of these being deferred tickets.

- **Fill**: colored ring segment showing current progress
- **Label**: accessible text describing the operation, provided through the `label` attribute or property (not visually rendered)

> **A11y Note**: Light DOM children are not projected into the shadow tree, so content between the opening and closing tags does not supply an accessible name. Use the `label` attribute or property, or `aria-label` / `aria-labelledby` on the host.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggest removing unless we have a codifiable way to determine when/what a11y rules get promoted here vs. stay in the Accessibility section.

Edit: coming back to say it seems we do have a pattern of noting labeling guidance here, but simplified to a sentence and not in a blockquote, example in Button.

- **`white`**: use on dark color or image backgrounds
- **`black`**: use on light color or image backgrounds

Each panel lists **small**, **medium**, and **large** in order so Chromatic can snapshot every static-color and size pairing with the same label text (stroke weight is what changes).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Remove any text like this throughout component docs that is an implementation detail / belongs better in a code comment or our Contributor Docs or skills.


### In Action Button

An avatar can be placed inside an action button to create a user-triggered action tied to a specific person or entity.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not sure where this guidance comes from - perhaps we remove and file a ticket to support avatar in action button once we validate if this is meant to be supported? I don't see it in the new Figma for either component.


### Best practices

- Always set `alt`: omitting it causes some screen readers to announce the image URL

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you reconcile this with the "Alt text" section prior? Also the demonstrated snippet doesn't use the decorative attribute as instructed. Looking at the implementation, only decorative is actually needed, not the empty alt, because it is supposed to then set aria-hidden which is functionally equivalent, so other references to an empty alt should probably update to prioritize recommending setting decorative only.

There's also a bug with the Playground controls where decorative doesn't get applied.


The `level` attribute sets the heading level (`h2`–`h6`) applied to every item header. The default is `3`; values outside the range are clamped.

> **Note**: In Spectrum 1, `level` could be set on each `sp-accordion-item`; in Spectrum 2 it is set only on `<swc-accordion>`. See the [migration guide](?path=/docs/components-accordion-migration-guide--docs).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Another type of note in component docs to remove throughout (if any more exist) is anything referencing S1, these belong in the migration guides only.


Badges come in four sizes to fit various contexts:

- **Small (`s`)**: default size; compact spaces, inline with text, or in tables

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm quite sure this "guidance" is hallucinated :D We were not very strict about catching these types of hallucinations in the early batches, but most often sizes are to match parent/relative components and not due to visual hierarchy as is implied here. We have kept these simplified withn a sentence with no guidance in other places (example: Button) or listed notable visual differences (example: Illustrated Message).

Maybe another deferred ticket is evaluating the actual UI/UX guidance presented in especially the intros, sizes, and variants.

- No keyboard interaction is required or expected

> **Important**: In focus mode, only interactive elements and their associated labels/descriptions are announced. If content is not a label or description for a focusable element, it will not be read. For non-interactive content, screen reader users must [switch to Browse mode](https://swcpreviews.z13.web.core.windows.net/pr-6122/docs/second-gen-storybook/?path=/docs/guides-accessibility-guides-screen-reader-testing--readme#screen-reader-modes). This is expected behavior, not a bug: ensure you test both modes when evaluating component accessibility.
> ⚠️ **Important:** In focus mode, only interactive elements and their associated labels/descriptions are announced. If content is not a label or description for a focusable element, it will not be read. For non-interactive content, screen reader users must [switch to browse mode](/docs/guides-accessibility-guides-screen-reader-testing--docs#screen-reader-modes). This is expected behavior, not a bug: ensure you test both modes when evaluating component accessibility.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This note seems a bit out of place in the sense it is general a11y information, and why is it important to status light specifically? For example, it would also apply to something like Badge. Tagging @nikkimk to weigh in.

I would also suggest we avoid using blockquote syntax and emojis for things like this, and have a ticket to create maybe some custom doc blocks (or prioritize inline alert 👀 ) to be able to add styled callouts (would also replace the inline style rendered callouts in consumer migration guides).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@5t3ph I had noted that the migration guides use a hardcoded inline alert (under Styling), it makes sense that we should use the same thing in other places as well, that didn't make it into my list of tickets on the PR but I will add it.

Determining whether it's worthwhile to actually have a component migrated for this would be really nice though, so we don't have to change hardcoded styles later.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@5t3ph @rise-erpelding in the a11y migration docs of each non focusable component (badge, status-light, etc), I recommended including a specific callout because we often get support messages from people who don't know that non-focusable elements won't be read by the screen reader in focus mode, so they assume these components aren't accessible.

This could be a doc block that we pull in to multiple component docs, but I really do think having that block as a note in each non-focusable component is useful in each component because they users are less likely to find it if it's not in the a11y section of the component docs.

As it is, that note does link to a more detailed explanation our a11y guides.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High priority PR review PR is a high priority and should be reviewed ASAP skip_vrt Skip VRT build; mark UI Tests green without running Chromatic Status:Ready for review PR ready for review or re-review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants