-
Notifications
You must be signed in to change notification settings - Fork 201
feat(accordion): spectrum 2 migration #3684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
File metricsSummaryTotal size: 1.42 MB*
accordion
* An ASCII character in UTF-8 is 8 bits or 1 byte. |
🚀 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
aef4d60
to
ff25c8e
Compare
accordion now has min width, default width, and max width
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
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-divider
token is not used here per previous guidance from the designer.New features
collapsing the accordion item.
overridden with
--mod-accordion-item-width
but 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-itemTitle
has been added around the headingtext.
Mod changes
The following
--mod
custom properties have been renamed to better reflect how they are used:--mod-accordion-item-height
has been renamed to--mod-accordion-item-minimum-height
--mod-accordion-min-block-size
has been renamed to--mod-accordion-item-min-block-size
--mod-accordion-component-edge-to-text
has been renamed to--mod-accordion-content-padding-inline
New mods:
--mod-accordion-animation-duration
--mod-accordion-edge-to-content-area
--mod-accordion-item-minimum-width
--mod-accordion-top-to-disclosure-indicator
CSS-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