feat(accordion): spectrum 2 migration#3684
Merged
Merged
Conversation
🦋 Changeset detectedLatest commit: d85d936 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
ad07a57 to
7c4c408
Compare
Contributor
File metricsSummaryTotal size: 1.42 MB*
accordion
* An ASCII character in UTF-8 is 8 bits or 1 byte. |
Contributor
|
🚀 Deployed on https://pr-3684--spectrum-css.netlify.app |
7c4c408 to
17ba3bc
Compare
7e8269c to
4ce8d19
Compare
bbd7643 to
6a48b9f
Compare
cb89f13 to
3eb63f2
Compare
6f53ef1 to
b935581
Compare
214cc10 to
b935581
Compare
rise-erpelding
previously requested changes
May 20, 2025
Collaborator
rise-erpelding
left a comment
There was a problem hiding this comment.
Nice work, I did some review on the documentation for a first pass! I will also take a look at the CSS and tokens but decided to put that in a separate review since those usually take a bit to validate and I already have quite a few comments in this review.
Contributor
aef4d60 to
ff25c8e
Compare
matches spec for top-to-text spacing and bottom-to-text-spacing removes now-deprecated top-to-text-regular- tokens
change rgb syntax for background colors fix: use different colors for background The `background-opacity-hover`, `background-opacity-down`, and `background-opacity-key-focus` tokens' values did not match the design spec, design has been asked and the custom properties here have been updated to match the colors in the spec with the understanding that this may be temporary. Additionally, the previous rgb syntax did not work and comma syntax was required, if we need to use opacity tokens when the correct ones become available, we will likely need to use the comma syntax instead of the slash syntax that was used previously.
Adds a :not(.is-disabled) selector for hover/focus/active states to ensure that those styles do not apply for disabled accordion item headers. In many cases this is not necessary, but when a --mod is used for hover/ focus/active colors, the mod was still being applied even when the disabled class was present.
was previously being flagged as unused. the icon's size is also set by ui-icons, but this provides a fallback for sizing as well as a mod, --mod-accordion-disclosure-indicator-height
This reverts commit cdcba08. I had initially thought this was skipped over, but after reviewing some of the previous discussion on this via Slack, it seems like it is safe not to include it, so the commit is being reverted. In addition to reverting the commit, metadata has been updated.
…led" oops This reverts commit 3372bd9.
Instead of putting the --mod variables for colors where styles are defined, --mods are now used in the custom property definition. This aligns with a couple of the other color definitions, such as --spectrum-accordion-item-content-color and --spectrum-accordion-divider-color. This also makes it so that a mod used for the background, for example, is overridden by disabled styles instead of persisting through the disabled styles.
To keep the pattern of defining custom properties for tokens consistent, this defines a custom property for the accordion-focus-indicator-gap token. It has been renamed to accordion-item-focus-indicator-gap. To keep patterns consistent, other focus-indicator custom properties have been renamed to include "item" in the name. Metadata has been updated and changeset changes have been documented.
- clarify language around density options - other minor documentation edits for clarity, grammar, format, and consistent class notation (`.class-name`) - use sentence case where it wasn't used - add description to hasNoInlinePadding - add migrated tags/status - move custom width story to hang out with the other docs only stories - centers accordion - because default width tokens are applied, the padded layout no longer seems necessary and looks awkward left-aligned, but we can bring this back if there are unintended side effects
5954349 to
d85d936
Compare
Merged
3 tasks
11 tasks
This was referenced Aug 27, 2025
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Accordion Spectrum 2 migration
Accordion now uses Spectrum 2 tokens and specifications. New sized tokens are used for corner rounding, the spacing around the disclosure icon, and the spacing around the content area.
A few notes on tokens: Medium top-to-text spacing tokens appear to be the wrong values (they appear to be the large values, not the values seen in the spec), I've followed up on this with design and assume that the correct values will be added later. Background color tokens also don't match the spec, I've followed up on this as well and have temporary colors that match the spec in place. Finally, so far we've noticed that the design spec appears to have a focus indicator gap but the token spec is 0 (no gap), so that is another follow-up item. The
accordion-item-to-dividertoken is not used here per previous guidance from the designer.New features
collapsing the accordion item.
overridden with
--mod-accordion-item-widthbut should not be smaller than--spectrum-accordion-item-minimum-width.Markup changes
The HTML markup has changed slightly for the accordion header. The disclosure icon has been moved
from outside the the button (
spectrum-Accordion-itemHeader), to within the button. The extraelement with class
spectrum-Accordion-itemIconContainer, previously wrapping the icon, hasbeen removed. A span with class
spectrum-Accordion-itemTitlehas been added around the headingtext.
Mod changes
The following
--modcustom properties have been renamed to better reflect how they are used:--mod-accordion-item-heighthas been renamed to--mod-accordion-item-minimum-height--mod-accordion-min-block-sizehas been renamed to--mod-accordion-item-min-block-size--mod-accordion-component-edge-to-texthas been renamed to--mod-accordion-content-padding-inlineNew mods:
--mod-accordion-animation-duration--mod-accordion-edge-to-content-area--mod-accordion-item-minimum-width--mod-accordion-top-to-disclosure-indicatorCSS-1018
Note: this does not include the new "direct actions" feature. That will be done in a follow-up PR/task.
How and where has this been tested?
Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.
Validation steps
collapsing the accordion item
Regression testing
Validate:
Screenshots
To-do list