Skip to content

Update hover styles for ActionList item - #3815

Merged
pksjce merged 4 commits into
mainfrom
pk/action-menu-hover
Oct 16, 2023
Merged

Update hover styles for ActionList item#3815
pksjce merged 4 commits into
mainfrom
pk/action-menu-hover

Conversation

@pksjce

@pksjcepksjce commented Oct 13, 2023

Copy link
Copy Markdown
Contributor

Closes#2479

In dark high contrast theme, the ActionMenu shows no hover color since the hover color and the menu overlay color are the same in this particular theme. However, if we refer to the view_components implementation, we see that they have a hover shadow as well which does the job pretty well in this theme. I've added the same shadow styles to ActionListItem. This looks great as the fix for our bug without regressing during other cases.

Before

Screen.Recording.2023-10-13.at.2.28.38.pm.mov

After

Screen.Recording.2023-10-13.at.2.30.48.pm.mov

Note

This fixes Light High contrast mode ActionItems as well.

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan

Testing & Reviewing

Merge checklist

  • Added/updated tests
  • Added/updated documentation
  • Added/updated previews (Storybook)
  • Changes are SSR compatible
  • Tested in Chrome
  • Tested in Firefox
  • Tested in Safari
  • Tested in Edge

Take a look at the What we look for in reviews section of the contributing guidelines for more information on how we review PRs.

@pksjce
pksjce requested review from a team and joshblackOctober 13, 2023 03:34
@changeset-bot

changeset-botBot commented Oct 13, 2023

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 1bee44a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
NameType
@primer/reactPatch

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

@github-actions

github-actionsBot commented Oct 13, 2023

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
dist/browser.esm.js104.77 KB (+0.04% 🔺)
dist/browser.umd.js105.36 KB (+0.04% 🔺)

@github-actions
github-actionsBot temporarily deployed to storybook-preview-3815 October 13, 2023 03:42 Inactive
@github-actions
github-actionsBot temporarily deployed to storybook-preview-3815 October 13, 2023 03:43 Inactive
@github-actions
github-actionsBot temporarily deployed to storybook-preview-3815 October 13, 2023 03:44 Inactive
@pksjce
pksjce temporarily deployed to github-pages October 13, 2023 03:46 — with GitHub Actions Inactive
@github-actions
github-actionsBot temporarily deployed to storybook-preview-3815 October 13, 2023 03:46 Inactive
@pksjce
pksjceforce-pushed the pk/action-menu-hover branch from 1b16d31 to 1be4fd3CompareOctober 13, 2023 03:57
@github-actions
github-actionsBot temporarily deployed to storybook-preview-3815 October 13, 2023 04:03 Inactive
@pksjce
pksjce temporarily deployed to github-pages October 13, 2023 04:05 — with GitHub Actions Inactive
@github-actions
github-actionsBot temporarily deployed to storybook-preview-3815 October 13, 2023 04:05 Inactive

@langermanklangermank left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Just one comment about the color token.

Comment threadsrc/ActionList/Item.tsx Outdated
':hover:not([aria-disabled])': {
backgroundColor: `actionListItem.${variant}.hoverBg`,
color: getVariantStyles(variant, disabled).hoverColor,
boxShadow: `inset 0 0 0 max(1px, 0.0625rem) ${theme?.colors.border.muted}`,

@langermanklangermankOct 13, 2023

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
boxShadow: `inset 0 0 0 max(1px, 0.0625rem) ${theme?.colors.border.muted}`,
boxShadow: `inset 0 0 0 max(1px, 0.0625rem) ${theme?.actionListItem.default.activeBorder}`,

I'm not sure if that syntax is right, maybe its:

boxShadow: `inset 0 0 0 max(1px, 0.0625rem) actionListItem.default.activeBorder`,

Regardless, this should use the ActionList specific color token which you can also see in the Primer View Components version 😄

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think with the sx prop it needs to either be just the token or uses that theme from context, potentially? So with the new token it would be:

Suggested change
boxShadow: `inset 0 0 0 max(1px, 0.0625rem) ${theme?.colors.border.muted}`,
boxShadow: `inset 0 0 0 max(1px, 0.0625rem) ${theme?.colors.actionListItem.default.activeBorder}`,

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Me and @broccolinisoup went back and forth with the colors and got confused! Thanks for this input. I have updated the PR!

@joshblackjoshblack left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after the token change! 🥳

@pksjce
pksjceforce-pushed the pk/action-menu-hover branch from 15597d5 to 30f9691CompareOctober 15, 2023 22:31
@pksjce
pksjce enabled auto-merge October 15, 2023 22:35
@github-actions
github-actionsBot temporarily deployed to storybook-preview-3815 October 15, 2023 22:37 Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-3815 October 15, 2023 22:41 Inactive

@broccolinisoupbroccolinisoup left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good! 🚀

Note: I am not sure if it is just me but the after video in the PR description, doesn't render for me. In case you would like to update for future references 😊

@langermanklangermank left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks perfect! Thanks for making that change 😄

@pksjce
pksjce added this pull request to the merge queueOct 16, 2023
Merged via the queue into main with commit 794a477Oct 16, 2023
@pksjce
pksjce deleted the pk/action-menu-hover branch October 16, 2023 14:59
This was referenced Oct 16, 2023
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ActionMenu does not have hover styles in Dark high contrast theme

4 participants

@pksjce@broccolinisoup@joshblack@langermank