Skip to content

Conversation

@pksjce
Copy link
Contributor

@pksjce pksjce commented Oct 13, 2023

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 joshblack October 13, 2023 03:34
@changeset-bot
Copy link

changeset-bot bot commented Oct 13, 2023

🦋 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
Name Type
@primer/react Patch

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
Copy link
Contributor

github-actions bot commented Oct 13, 2023

size-limit report 📦

Path Size
dist/browser.esm.js 104.77 KB (+0.04% 🔺)
dist/browser.umd.js 105.36 KB (+0.04% 🔺)

@github-actions github-actions bot temporarily deployed to storybook-preview-3815 October 13, 2023 03:42 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3815 October 13, 2023 03:43 Inactive
@github-actions github-actions bot 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-actions bot temporarily deployed to storybook-preview-3815 October 13, 2023 03:46 Inactive
@pksjce pksjce force-pushed the pk/action-menu-hover branch from 1b16d31 to 1be4fd3 Compare October 13, 2023 03:57
@github-actions github-actions bot 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-actions bot temporarily deployed to storybook-preview-3815 October 13, 2023 04:05 Inactive
Copy link
Contributor

@langermank langermank left a comment

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.

':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}`,
Copy link
Contributor

@langermank langermank Oct 13, 2023

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
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
Contributor Author

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!

Copy link
Member

@joshblack joshblack left a comment

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 pksjce force-pushed the pk/action-menu-hover branch from 15597d5 to 30f9691 Compare October 15, 2023 22:31
Copy link
Member

@broccolinisoup broccolinisoup left a comment

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 😊

@pksjce pksjce requested a review from langermank October 15, 2023 23:59
Copy link
Contributor

@langermank langermank left a comment

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 😄

Sign up for free to 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

5 participants