-
Notifications
You must be signed in to change notification settings - Fork 201
feat(actionbar): new s2 migration #3657
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?
Changes from all commits
19fe479
0e43d2d
9c2b19f
85881a0
dccf04a
df5bdf8
5bf1c46
3cd57fc
4bd9863
52f50ad
ba9179c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
"@spectrum-css/actionbar": major | ||
--- | ||
|
||
### Actionbar S2 Migration | ||
|
||
Action bar now has some updated colors, corner radius, and icons. There's a new look to the default and emphasized variants and each have a custom touch in both light and dark themes. | ||
|
||
The emphasized has changed from an `accent` background color to a `neutral` background color. | ||
|
||
#### New tokens | ||
|
||
`--spectrum-actionbar-emphasized-actionbutton-label-color` | ||
`--spectrum-actionbar-emphasized-icon-color` | ||
`--spectrum-actionbar-minimum-width` | ||
`--spectrum-actionbar-spacing-label-to-actiongroup` | ||
`--spectrum-actionbar-spacing-action-group-edge` | ||
`--spectrum-actionbar-close-button-to-counter` | ||
|
||
#### New mods | ||
|
||
`--mod-actionbar-minimum-width` | ||
`--mod-actionbar-spacing-action-group-edge` | ||
`--mod-actionbar-spacing-label-to-actiongroup` |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -12,42 +12,37 @@ | |||||
*/ | ||||||
|
||||||
.spectrum-ActionBar { | ||||||
--spectrum-actionbar-popover-background-color: var(--spectrum-gray-25); | ||||||
--spectrum-actionbar-popover-border-color: var(--spectrum-gray-400); | ||||||
marissahuysentruyt marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
|
||||||
/* Layout */ | ||||||
--spectrum-actionbar-height: var(--spectrum-action-bar-height); | ||||||
--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. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
A minor suggestion to the naming so it's more readable and consistent with the naming of the other action group custom property. |
||||||
--spectrum-actionbar-spacing-action-group-edge: var(--spectrum-action-bar-edge-to-content-area); | ||||||
--spectrum-actionbar-close-button-to-counter: var(--spectrum-action-bar-close-button-to-counter); | ||||||
|
||||||
/* item counter field label */ | ||||||
--spectrum-actionbar-item-counter-font-size: var(--spectrum-font-size-100); | ||||||
--spectrum-actionbar-item-counter-line-height: var(--spectrum-line-height-100); | ||||||
--spectrum-actionbar-item-counter-color: var(--spectrum-neutral-content-color-default); | ||||||
|
||||||
/* emphasized variation colors */ | ||||||
--spectrum-actionbar-emphasized-background-color: var(--spectrum-informative-background-color-default); | ||||||
--spectrum-actionbar-emphasized-item-counter-color: var(--spectrum-white); | ||||||
--spectrum-actionbar-emphasized-background-color: var(--spectrum-neutral-content-color-default); | ||||||
--spectrum-actionbar-emphasized-item-counter-color: var(--spectrum-gray-25); | ||||||
Comment on lines
+29
to
+30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could some of these for emphasized be handled by changes to existing custom properties, instead of creating new ones and repeating some declarations later in the CSS?
|
||||||
--spectrum-actionbar-emphasized-action-button-label-color: var(--spectrum-gray-25); | ||||||
--spectrum-actionbar-emphasized-icon-color: var(--spectrum-gray-25); | ||||||
|
||||||
/* colors - applied to popover */ | ||||||
--spectrum-actionbar-popover-background-color: var(--spectrum-background-elevated-color); | ||||||
--spectrum-actionbar-popover-border-color: var(--spectrum-action-bar-border-color); | ||||||
|
||||||
/* spacing of action bar bottom and horizontal outer edge */ | ||||||
--spectrum-actionbar-spacing-outer-edge: var(--spectrum-spacing-300); | ||||||
|
||||||
/* spacing of close button */ | ||||||
--spectrum-actionbar-spacing-close-button-top: var(--spectrum-spacing-100); | ||||||
--spectrum-actionbar-spacing-close-button-start: var(--spectrum-spacing-100); | ||||||
--spectrum-actionbar-spacing-close-button-end: var(--spectrum-spacing-75); | ||||||
|
||||||
/* spacing of item counter field label */ | ||||||
--spectrum-actionbar-spacing-item-counter-top: var(--spectrum-action-bar-top-to-item-counter); | ||||||
--spectrum-actionbar-spacing-item-counter-end: var(--spectrum-spacing-400); | ||||||
|
||||||
/* spacing of action group */ | ||||||
--spectrum-actionbar-spacing-action-group-top: var(--spectrum-spacing-100); | ||||||
--spectrum-actionbar-spacing-action-group-end: var(--spectrum-spacing-100); | ||||||
|
||||||
/* drop shadow */ | ||||||
--spectrum-actionbar-shadow-horizontal: var(--spectrum-drop-shadow-x); | ||||||
--spectrum-actionbar-shadow-vertical: var(--spectrum-drop-shadow-y); | ||||||
--spectrum-actionbar-shadow-blur: var(--spectrum-drop-shadow-blur); | ||||||
--spectrum-actionbar-shadow-color: var(--spectrum-drop-shadow-color); | ||||||
--spectrum-actionbar-shadow-horizontal: var(--spectrum-drop-shadow-elevated-x); | ||||||
--spectrum-actionbar-shadow-vertical: var(--spectrum-drop-shadow-elevated-y); | ||||||
--spectrum-actionbar-shadow-blur: var(--spectrum-drop-shadow-elevated-blur); | ||||||
--spectrum-actionbar-shadow-color: var(--spectrum-drop-shadow-elevated-color); | ||||||
|
||||||
Comment on lines
+45
to
46
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After these drop shadows, I would also suggest setting Screen.Recording.2025-04-23.at.5.43.52.PM.mov |
||||||
/* cjk language support for item counter */ | ||||||
&:lang(ja), | ||||||
|
@@ -57,17 +52,6 @@ | |||||
} | ||||||
} | ||||||
|
||||||
/* windows high contrast mode */ | ||||||
@media (forced-colors: active) { | ||||||
.spectrum-ActionBar { | ||||||
--highcontrast-actionbar-popover-border-color: CanvasText; | ||||||
} | ||||||
|
||||||
.spectrum-ActionBar--emphasized .spectrum-ActionBar-popover { | ||||||
--highcontrast-actionbar-popover-border-color: CanvasText; | ||||||
} | ||||||
} | ||||||
|
||||||
/* ActionBar is outer wrapper with nested popover component within */ | ||||||
.spectrum-ActionBar { | ||||||
/* creates horizontal spacing to edge */ | ||||||
|
@@ -94,11 +78,11 @@ | |||||
.spectrum-ActionBar-popover { | ||||||
/* popover is ActionBar height */ | ||||||
block-size: var(--mod-actionbar-height, var(--spectrum-actionbar-height)); | ||||||
min-inline-size: var(--mod-actionbar-minimum-width, var(--spectrum-actionbar-minimum-width)); | ||||||
box-sizing: border-box; | ||||||
inline-size: 100%; | ||||||
margin: auto; | ||||||
padding-block-start: 0; | ||||||
padding-block-end: 0; | ||||||
padding-inline: var(--mod-actionbar-spacing-action-group-edge, var(--spectrum-actionbar-spacing-action-group-edge)); | ||||||
|
||||||
/* Be relative so our width can be restricted */ | ||||||
position: relative; | ||||||
|
@@ -115,27 +99,19 @@ | |||||
/* inner layout of content items */ | ||||||
display: flex; | ||||||
flex-direction: row; | ||||||
align-items: center; | ||||||
} | ||||||
|
||||||
/* close button */ | ||||||
.spectrum-CloseButton { | ||||||
margin-inline-start: var(--mod-actionbar-spacing-close-button-start, var(--spectrum-actionbar-spacing-close-button-start)); | ||||||
margin-inline-end: var(--mod-actionbar-spacing-close-button-end, var(--spectrum-actionbar-spacing-close-button-end)); | ||||||
margin-block-start: var(--mod-actionbar-spacing-close-button-top, var(--spectrum-actionbar-spacing-close-button-top)); | ||||||
flex-shrink: 0; | ||||||
.spectrum-ActionBar-actiongroup { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is an existing If |
||||||
padding-inline-start: var(--mod-actionbar-spacing-label-to-actiongroup, var(--spectrum-actionbar-spacing-label-to-actiongroup)); /* space between label and action group */ | ||||||
} | ||||||
|
||||||
/* item counter */ | ||||||
.spectrum-FieldLabel { | ||||||
margin-inline-end: var(--mod-actionbar-spacing-item-counter-end, var(--spectrum-actionbar-spacing-item-counter-end)); | ||||||
margin-block-start: var(--mod-actionbar-spacing-item-counter-top, var(--spectrum-actionbar-spacing-item-counter-top)); | ||||||
|
||||||
/* neutralize padding for correct spacing within ActionBar */ | ||||||
padding: 0; | ||||||
|
||||||
font-size: var(--mod-actionbar-item-counter-font-size, var(--spectrum-actionbar-item-counter-font-size)); | ||||||
color: var(--mod-actionbar-item-counter-color, var(--spectrum-actionbar-item-counter-color)); | ||||||
line-height: var(--mod-actionbar-item-counter-line-height, var(--spectrum-actionbar-item-counter-line-height)); | ||||||
padding-inline-start: var(--mod-actionbar-close-button-to-counter, var(--spectrum-actionbar-close-button-to-counter)); | ||||||
|
||||||
/* cjk language support */ | ||||||
&:lang(ja), | ||||||
|
@@ -147,27 +123,38 @@ | |||||
|
||||||
/* action group */ | ||||||
.spectrum-ActionGroup { | ||||||
margin-inline-end: var(--mod-actionbar-spacing-action-group-end, var(--spectrum-actionbar-spacing-action-group-end)); | ||||||
margin-block-start: var(--mod-actionbar-spacing-action-group-top, var(--spectrum-actionbar-spacing-action-group-top)); | ||||||
|
||||||
/* align to end by default */ | ||||||
margin-inline-start: auto; | ||||||
} | ||||||
} | ||||||
|
||||||
.spectrum-ActionBar--emphasized { | ||||||
.spectrum-ActionBar-popover { | ||||||
filter: none; | ||||||
background-color: var(--mod-actionbar-emphasized-background-color, var(--spectrum-actionbar-emphasized-background-color)); | ||||||
|
||||||
/* border transparent instead of none so WHCM will have visible border */ | ||||||
border-color: transparent; | ||||||
.spectrum-CloseButton:hover .spectrum-Icon { | ||||||
color: var(--highcontrast-actionbar-closebutton-highlight-color, var(--spectrum-actionbar-emphasized-icon-color)); | ||||||
} | ||||||
} | ||||||
|
||||||
/* ensure text is legible on emphasized background */ | ||||||
.spectrum-FieldLabel { | ||||||
color: var(--mod-actionbar-emphasized-item-counter-color, var(--spectrum-actionbar-emphasized-item-counter-color)); | ||||||
} | ||||||
|
||||||
.spectrum-ActionGroup .spectrum-ActionButton { | ||||||
.spectrum-ActionButton-label { | ||||||
color: var(--highcontrast-actionbutton-emphasized-content-color-default, var(--spectrum-actionbar-emphasized-action-button-label-color)); | ||||||
} | ||||||
|
||||||
.spectrum-ActionButton-icon { | ||||||
color: var(--highcontrast-actionbutton-emphasized-icon-color, var(--spectrum-actionbar-emphasized-icon-color)); | ||||||
} | ||||||
} | ||||||
|
||||||
.spectrum-CloseButton .spectrum-Icon { | ||||||
color: var(--spectrum-actionbar-emphasized-icon-color); | ||||||
} | ||||||
Comment on lines
+135
to
+157
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think we need to be changing colors on the action buttons or the icons. Or the close button? I didn't see any separate colors defined on the spec (but the specs look unfinished). I saw this on the S2 desktop Figma "In the action bar, the action buttons use the static white and static black versions, which remain the same between color themes." That might be related. I don't think that's being done currently; we only use one of the static color classes in the template. |
||||||
} | ||||||
|
||||||
.spectrum-ActionBar--sticky { | ||||||
|
@@ -184,3 +171,13 @@ | |||||
.spectrum-ActionBar--flexible .spectrum-ActionBar-popover { | ||||||
inline-size: auto; | ||||||
} | ||||||
|
||||||
/* windows high contrast mode */ | ||||||
@media (forced-colors: active) { | ||||||
.spectrum-ActionBar { | ||||||
--highcontrast-actionbar-popover-border-color: CanvasText; | ||||||
--highcontrast-actionbutton-emphasized-content-color-default: CanvasText; | ||||||
--highcontrast-actionbutton-emphasized-icon-color: CanvasText; | ||||||
--highcontrast-actionbar-closebutton-highlight-color: Highlight; | ||||||
} | ||||||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -92,7 +92,7 @@ WithForcedColors.parameters = { | |||||
|
||||||
// ********* DOCS ONLY ********* // | ||||||
/** | ||||||
* The emphasized action bar has a blue background that adds visual emphasis on the actions and selection. Use this for when the bar should call attention (e.g., floating in a table). | ||||||
* The emphasized action bar has a neurtral background that adds visual emphasis on the actions and selection. Use this for when the bar should call attention (e.g., floating in a table). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
*/ | ||||||
export const Emphasized = BehavioralTemplate.bind({}); | ||||||
Emphasized.tags = ["!dev"]; | ||||||
|
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.
What is the "custom touch" in light and dark themes? I didn't notice any theme specific CSS in the PR.