Skip to content

Conversation

castastrophe
Copy link
Collaborator

@castastrophe castastrophe commented Oct 1, 2025

Description

This update removes --mod-accordion-* custom property hooks per SWC-1264, see also the RFC for extensible styling. Class selectors and variants remain unchanged; stories were refreshed to match the current API.

  • Remove all --mod-accordion-* custom property hooks.
  • Keep existing class selectors and variants (e.g., .spectrum-Accordion--compact, .spectrum-Accordion--spacious, .spectrum-Accordion--quiet, .is-open, .is-disabled) unchanged.
  • Update stories to reflect the removal of the --mod-accordion-* override layer.

Breaking change: the --mod-accordion-* override layer is removed. Consumers should set --spectrum-accordion-* variables directly where customization is needed.

Motivation and context

  • Reduce API surface and ambiguity by eliminating a parallel modifier layer.
  • Ensure theming consistency through Spectrum tokens.
  • Simplify long‑term maintenance and documentation.

Related issue(s)

  • fixes SWC-1264

Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed the Accessibility Practices for this feature, see: Aria Practices
  • I have added automated tests to cover my changes (or confirmed existing coverage is sufficient for styling-only 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 passing or approved

Manual review test cases

  • Accordion interactions

    1. Open Storybook accordion stories.
    2. Hover, press, and focus the header.
    3. Expect header/background colors to use Spectrum tokens and match design.
  • Densities and sizes

    1. Render compact, regular, spacious across S/M/L/XL.
    2. Compare spacing and typography to tokens.
    3. Expect parity with previous visuals.
  • Quiet and no inline padding

    1. Apply .spectrum-Accordion--quiet and .spectrum-Accordion--noInlinePadding.
    2. Validate visual behavior matches docs.
    3. Expect no regressions.
  • Disabled items

    1. Add .is-disabled to an item.
    2. Check content and header colors.
    3. Expect --spectrum-disabled-content-color to be used.
  • Open state behavior

    1. Toggle item open/closed.
    2. Observe indicator rotation and content visibility.
    3. Expect unchanged behavior.

Device review

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

Copy link

changeset-bot bot commented Oct 1, 2025

🦋 Changeset detected

Latest commit: 902d021

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@spectrum-css/accordion Major
@spectrum-css/bundle Patch
@spectrum-css/preview Patch

Not sure what this means? Click here to learn what changesets are.

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

@castastrophe castastrophe self-assigned this Oct 1, 2025
@castastrophe castastrophe added size-2 S ~6-18hrs; not hard or time consuming, one or two work days to complete. run_vrt For use on PRs looking to kick off VRT S2 Spectrum 2 labels Oct 1, 2025
Copy link
Contributor

github-actions bot commented Oct 1, 2025

📚 Branch preview

PR #4249 has been deployed to Azure Blob Storage: https://spectrumcss.z13.web.core.windows.net/pr-4249/index.html.

Copy link
Contributor

github-actions bot commented Oct 1, 2025

File metrics

Summary

Total size: 1.44 MB*

Package Size Minified Gzipped
accordion 18.81 KB 18.01 KB 2.39 KB

accordion

Filename Head Minified Gzipped Compared to base
index.css 18.81 KB 18.01 KB 2.39 KB 🟢 ⬇ 2.77 KB
metadata.json 9.24 KB - - 🟢 ⬇ 2.19 KB
* Size is the sum of all main files for packages in the library.
* An ASCII character in UTF-8 is 8 bits or 1 byte.

@castastrophe castastrophe force-pushed the feat-accordion-remove-modifiers branch 2 times, most recently from b3aeb55 to 81bc3a8 Compare October 1, 2025 14:50
@castastrophe castastrophe added breaking change Results in a breaking API change ready-for-review and removed run_vrt For use on PRs looking to kick off VRT labels Oct 1, 2025
@castastrophe castastrophe marked this pull request as ready for review October 1, 2025 15:14
@castastrophe castastrophe force-pushed the feat-accordion-remove-modifiers branch from 81bc3a8 to 902d021 Compare October 1, 2025 15:38
@rise-erpelding rise-erpelding self-requested a review October 2, 2025 13:28
Copy link
Collaborator

@rise-erpelding rise-erpelding left a comment

Choose a reason for hiding this comment

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

Did not see any regressions in accordion with these changes!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Love this and I'm excited to try it out!

"--mod-accordion-item-width",
"--mod-accordion-top-to-disclosure-indicator"
],
"modifiers": [],
Copy link
Collaborator

Choose a reason for hiding this comment

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

👋 bye!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change Results in a breaking API change ready-for-review S2 Spectrum 2 size-2 S ~6-18hrs; not hard or time consuming, one or two work days to complete.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants