feat(actionbar): new s2 migration#3657
Conversation
🦋 Changeset detectedLatest commit: 34a5eea 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 |
File metricsSummaryTotal size: 1.38 MB*
actionbar
* An ASCII character in UTF-8 is 8 bits or 1 byte. |
|
🚀 Deployed on https://pr-3657--spectrum-css.netlify.app |
701ca81 to
0e43d2d
Compare
marissahuysentruyt
left a comment
There was a problem hiding this comment.
Before I went too far, I wanted to ask why several of the components were downgraded from the spectrum-two branch. I see some of our plugins have been downgraded, as well as our token package and bundle. Was that intentional, do we have conflicting dependencies or something? Those changes just caught me off guard, so I wanted to double check the reasoning.
marissahuysentruyt
left a comment
There was a problem hiding this comment.
Here are a couple of things I wanted to bring up with you! I wasn't sure where to put them...
- In the actionbar.stories.js file, would you update the documentation regarding the emphasized's blue background, since it got changed to the gray for S2?
- If I'm understanding Figma correctly, the expectation for an emphasized action bar, in dark mode, is to have a border, correct? If I inspect the Figma component, there's still a border:
But right now, the border-color: transparent at line 132ish is overriding that. Should it match Figma? This wasn't something you introduced, but something I noticed. Based on the comments about WHCM, I wonder if the transparent border is even something we need, now that this component has a border in the emphasized variant. Just testing with that line removed, it looks like the borders in high contrast mode are still looking good.

I will give the rest of the tokens a better look tomorrow!
| .spectrum-ActionGroup .spectrum-ActionButton { | ||
| .spectrum-ActionButton-label { | ||
| --mod-actionbutton-label-color: var(--spectrum-actionbar-emphasized-action-button-label-color); | ||
| } | ||
|
|
||
| .spectrum-ActionButton-icon { | ||
| color: var(--spectrum-actionbar-emphasized-icon-color); | ||
| } | ||
| } | ||
|
|
||
| .spectrum-CloseButton .spectrum-Icon { | ||
| color: var(--spectrum-actionbar-emphasized-icon-color); | ||
| } |
There was a problem hiding this comment.
Interestingly, I only get the black boxes in the Chromatic test preview. 🤔
There was a problem hiding this comment.
OHHHH I think this is related to the background colors passed to Container()s. I'm more and more convinced the longer I stare at this that we have to revert the Container() addition.
| Container({ | ||
| withBorder: false, | ||
| wrapperStyles: { | ||
| "column-gap": "var(--spectrum-action-bar-close-button-to-counter)", | ||
| "align-items": "center", | ||
| }, | ||
| content: [ | ||
| CloseButton({ | ||
| label: "Clear selection", | ||
| staticColor: isEmphasized ? "white" : undefined, | ||
| }, context), | ||
| FieldLabel({ size: "s", label: "2 Selected" }, context), | ||
| ] | ||
| }), |
There was a problem hiding this comment.
Hmm...I'm unsure if Container() was really intended to be used in our templates. Right now, it's adding a lot of additional markup that doesn't seem necessary, and I'm not sure SWC would be able to do anything with these Storybook-only classes & divs.
We may have to revert this back to the old markup.
| .spectrum-ActionBar--emphasized .spectrum-ActionBar-popover { | ||
| --highcontrast-actionbar-popover-border-color: CanvasText; |
There was a problem hiding this comment.
This selector is a little repetitive to me, so can we remove it? --highcontrast-actionbar-popover-border-color: CanvasText; was already declared above in .spectrum-ActionBar, and this second selector block is just variants, so isn't it already set?
|
|
||
| .spectrum-ActionGroup .spectrum-ActionButton { | ||
| .spectrum-ActionButton-label { | ||
| --mod-actionbutton-label-color: var(--spectrum-actionbar-emphasized-action-button-label-color); |
There was a problem hiding this comment.
I wonder if, for the emphasized action bar specifically in dark mode in force colors/WHCM 🥵 if this should use a high contrast variable. Testing it in both the Chrome forced-colors emulator and Assistiv labs, if I switch to dark mode, the emphasized action buttons are not visible.

--mod-actionbutton-label-color: var(--highcontrast-actionbar-emphasized-action-button-label-color, var(--spectrum-actionbar-emphasized-action-button-label-color));
I don't know where quite yet we'd want that mod, if it's here or somewhere else.
There was a problem hiding this comment.
Oh, and somewhat related- I'd like to see this action button mod passthrough be organized with the rest of the custom property definitions, instead of mixed in with the style definitions.
|
|
||
| ### Actionbar S2 Migration | ||
|
|
||
| Action bar now has some updated colors, corner radius, icons and outline has been removed. The default and emphasized variant now have a light and dark mode theme. |
There was a problem hiding this comment.
Could we clarify the part about the outline/border a little? The border is still there, but just different colors based on light vs dark modes.
jawinn
left a comment
There was a problem hiding this comment.
Design specs are missing info
I don’t see “emphasized” included on the S2 token specs for action bar, so it's difficult to validate this 100% (I did look at the S2 desktop file). It looks like the spec is unfinished. Was the design team going to update the specs?
Shadow and dark theme border
I noticed some difference in the dark theme border size and the size of the shadow, as compared to the S2 desktop file.


The border sounds like a question for design; the component changelog says "removed outline" and doesn't show it, but the S2 desktop file does show it in a couple places 🤔 .
For the shadow; I'm not sure if it's just a rendering difference, but it looks to extend farther than the Figma shows?
| --spectrum-actionbar-corner-radius: var(--spectrum-corner-radius-100); | ||
| --spectrum-actionbar-minimum-width: var(--spectrum-action-bar-minimum-width); | ||
| --spectrum-actionbar-corner-radius: var(--spectrum-corner-radius-medium-size-extra-large); | ||
| --spectrum-actionbar-spacing-label-to-actiongroup: var(--spectrum-action-bar-label-to-action-group-area); |
There was a problem hiding this comment.
| --spectrum-actionbar-spacing-label-to-actiongroup: var(--spectrum-action-bar-label-to-action-group-area); | |
| --spectrum-actionbar-spacing-label-to-action-group: var(--spectrum-action-bar-label-to-action-group-area); |
A minor suggestion to the naming so it's more readable and consistent with the naming of the other action group custom property.
…//github.com/adobe/spectrum-css into aramos-adobe/css1027-action-bar-s2-migration
| --spectrum-actionbar-spacing-top-area: var(--spectrum-action-bar-top-to-content-area); | ||
| --spectrum-actionbar-spacing-bottom-area: var(--spectrum-action-bar-bottom-to-content-area); | ||
| --spectrum-actionbar-close-button-to-counter: var(--spectrum-action-bar-close-button-to-counter); | ||
| --spectrum-actionbar-item-counter-line-height: var(--spectrum-line-height-100); |
There was a problem hiding this comment.
Custom property --spectrum-actionbar-item-counter-line-height's references have been removed
There was a problem hiding this comment.
@aramos-adobe I think this got flagged because we're only setting spectrum-actionbar-item-counter-line-height to define the field label mod. We can get around the linting issues with the disable if you wanted:
/* stylelint-disable-next-line spectrum-tools/no-unused-custom-properties -- defines the field label mod */
7e8269c to
4ce8d19
Compare
marissahuysentruyt
left a comment
There was a problem hiding this comment.
Woo, this is looking great! I'm going to approve, but I'd like to request we get the tags: ["migrated"] into the story file before this merges (you added the status, but we also need the tag). Other than that, I just left a suggestion to get around the stylelint warning 😊 Nice work on this!
There was a problem hiding this comment.
@aramos-adobe Thanks so much for adding the migrated status! Once your branch is rebased, we should get a migrated badge now :)
If you could also add tags: ["migrated"] to this file, that'd be wonderful also! The tags code doesn't have to go in the parameters object- it can just go at the bottom of the default export.
| --spectrum-actionbar-spacing-top-area: var(--spectrum-action-bar-top-to-content-area); | ||
| --spectrum-actionbar-spacing-bottom-area: var(--spectrum-action-bar-bottom-to-content-area); | ||
| --spectrum-actionbar-close-button-to-counter: var(--spectrum-action-bar-close-button-to-counter); | ||
| --spectrum-actionbar-item-counter-line-height: var(--spectrum-line-height-100); |
There was a problem hiding this comment.
@aramos-adobe I think this got flagged because we're only setting spectrum-actionbar-item-counter-line-height to define the field label mod. We can get around the linting issues with the disable if you wanted:
/* stylelint-disable-next-line spectrum-tools/no-unused-custom-properties -- defines the field label mod */
jawinn
left a comment
There was a problem hiding this comment.
One small update to the changeset and I think this is good to go.
|
|
||
| `--mod-actionbar-minimum-width` | ||
| `--mod-actionbar-spacing-action-group-edge` | ||
| `--mod-actionbar-spacing-label-to-actiongroup` |
There was a problem hiding this comment.
| `--mod-actionbar-spacing-label-to-actiongroup` | |
| `--mod-actionbar-spacing-label-to-action-group` |


Actionbar S2 Migration
Action bar now has some updated colors, corner radius, and icons The default and emphasized variant now have a light and dark mode theme.
The emphasized variant has visibly changed from blue to gray.
New tokens
--spectrum-actionbar-emphasized-actionbutton-label-color--spectrum-actionbar-emphasized-icon-color--spectrum-actionbar-minimum-width--spectrum-actionbar-spacing-label-to-action-group--spectrum-actionbar-spacing-action-group-edgeNew mods
--mod-actionbar-minimum-width--mod-actionbar-spacing-action-group-edge--mod-actionbar-spacing-label-to-action-groupHow 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