-
Notifications
You must be signed in to change notification settings - Fork 201
feat(menu): spectrum 2 migration #3686
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
…ctrum-css into seckles/css-614-s2-menu
…ctrum-css into seckles/css-614-s2-menu
🦋 Changeset detectedLatest commit: ed988bc The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
🚀 Deployed on https://pr-3686--spectrum-css.netlify.app |
File metricsSummaryTotal size: 1.38 MB*
File change detailscolorarea
colorhandle
colorslider
colorwheel
menu
slider
* An ASCII character in UTF-8 is 8 bits or 1 byte. |
7e8269c
to
4ce8d19
Compare
{ | ||
testHeading: "With multi-select switch", | ||
selectionMode: "multiple", | ||
hasActions: true, | ||
include: ["Truncation", "Text wrapping"], | ||
include: ["Truncation", "Truncation with thumbnails", "Text wrapping", "Text wrapping with thumbnails"], | ||
}, |
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.
This and the other test case multi-select switch
cuts off the switch on the right side. I wonder if there should be a minimum inline size for this variant.
.spectrum-Menu-itemLabel--truncate { | ||
text-overflow: ellipsis; | ||
white-space: nowrap; |
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.
I see this has been added, but I don't see the ellipsis
taking effect in the controls instead the menu items get longer. Should there be an inline size placed when this class is added in the template?
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.
Line 274 I think for the Menu Item. I added a code block in the styleMap just to see that truncation take effect. I'm sure you have a better way 😁
style=${styleMap({
...customStyles,
...(shouldTruncate ? { width: "200px" } : {}),
})}
Description
First of all, big s/o to @rise-erpelding for the original work in #2802 🙌
S2 Menu references:
New features
Also of note is that the
grid-template-areas
forspectrum-Menu-item
were updated to accomodate the positioning of elements relative to the thumbnail.Tokens update
Since
@adobe/spectrum-tokens
has been updated to include many tokens relating to the menu component, including some that replace custom tokens that had previously been added. As such, these custom menu item color tokens that are now available from@adobe/spectrum-tokens
have been removed.One special case is
--spectrum-menu-item-background-color-default
which was spec'd to have "0% opacity" which for a CSS background color translates totransparent
so that token is redefined as such. So,menu-item-background-opacity
was not used.Additionally, due to the margin required for the focus indicator previously implemented, the "new" token
menu-item-to-item
was not implemented as it compounded that margin.New mods
--mod-menu-item-linkout-icon-height
--mod-menu-item-linkout-icon-width
--mod-menu-item-thumbnail-height
--mod-menu-item-thumbnail-opacity-disabled
--mod-menu-item-thumbnail-to-label
--mod-menu-item-thumbnail-width
--mod-menu-item-top-to-thumbnail
--mod-menu-section-description-color
--mod-menu-section-description-font-size
--mod-menu-section-description-font-weight
--mod-menu-section-description-line-height
--mod-menu-section-description-line-height-cjk
--mod-menu-section-header-to-description
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
menu-item-background-opacity
andmenu-item-to-item
as explained abovemenu-item-label-to-description
size tokenssection-header-to-description
size tokensmenu-top-to-thumbnail
size tokenstext-to-visual-400
(used for thumbnail to label inline spacing)link-out-icon
size tokensRegression testing
Validate:
Screenshots
Note: The desktop guide shows that when thumbnail is active, the selected state check or checkbox should be center aligned
To-do list