-
Notifications
You must be signed in to change notification settings - Fork 202
feat(accordion): add direct actions #4020
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
base: spectrum-two
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 4480c6d 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 |
File metricsSummaryTotal size: 1.43 MB*
accordion
* An ASCII character in UTF-8 is 8 bits or 1 byte. |
📚 Branch previewPR #4020 has been deployed to Azure Blob Storage: https://spectrumcss.z13.web.core.windows.net/pr-4020/index.html. |
1f8e5b3
to
a2a2bc9
Compare
- updates test cases in order to use shorter content that fits better with the default width of accordion items
dc3ac58
to
812af2b
Compare
- adds direct actions feature to storybook, template, and css
812af2b
to
ec8d50d
Compare
ec8d50d
to
4480c6d
Compare
/* Calculated vertical spacing for action button and switch to center them within the accordion item */ | ||
--spectrum-accordion-item-direct-actions-vertical-spacing: calc( | ||
(var(--mod-accordion-item-min-block-size, var(--spectrum-accordion-item-min-block-size)) - | ||
var(--mod-accordion-item-direct-actions-height, var(--spectrum-accordion-item-direct-actions-height))) / 2 | ||
); | ||
|
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.
Did I miss a better way to do vertical spacing for this situation? I was finding that this got pretty complex, pretty fast:
- An
align-items: center
on the.spectrum-Accordion-itemDirectActions
isn't ideal when the text wraps because the designs show that we want direct actions to align with the first line of text, instead of all of them. - Accordion items have a min-height of
component-height-75
/component-height-100
/component-height-200
/component-height-300
, same with the direct actions, but we don't usually see that min-height in accordion (except for compact) because of the calculations for spacing and font-size * line-height making it larger
Description
Gives the accordion component a minor update to include direct actions, which may consist of a quiet action button, switch, or both. Direct action items are vertically centered within the heading's first line of text for all sizes and densities, and maintain their own individual key focus states.
CSS-1204
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
Regression testing
Validate:
Screenshots
To-do list