Skip to content

Prevents text color from changing on hover for "inactive" ActionMenu.Items of the "danger" variant - #4651

Merged
mperrotti merged 3 commits into
mainfrom
mp/inactive-danger-hover-fix
Jun 17, 2024
Merged

Prevents text color from changing on hover for "inactive" ActionMenu.Items of the "danger" variant#4651
mperrotti merged 3 commits into
mainfrom
mp/inactive-danger-hover-fix

Conversation

@mperrotti

Copy link
Copy Markdown
Contributor

Closes # No issue created.See Slack comment (GitHub staff only).

Demo of fix

The fourth item, "Make a copy", is variant="danger" and has inactiveText set. Before this change, the text color would change on hover. After this change, the text color remains the same.

Before:

Kapture.2024-06-07.at.08.47.09.mp4

After:

Kapture.2024-06-07.at.08.34.08.mp4

Changelog

New

Changed

Increases specificity of the :hover styles to exclude inactive items.

Removed

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Try and hover the fourth item ("Make a copy") in the menu of the ActionMenu/Features/Inactive items story. VRTs should cover regressions.

Merge checklist

@mperrotti
mperrotti requested a review from a team as a code ownerJune 7, 2024 13:03
@mperrotti
mperrotti requested a review from keithamusJune 7, 2024 13:03
@changeset-bot

changeset-botBot commented Jun 7, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f3db868

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

'[data-variant="danger"]:hover &, [data-variant="danger"]:active &': {
color: getVariantStyles(variant, disabled, inactive).hoverColor,
},
'[data-variant="danger"]:not([aria-disabled]):not([data-inactive]):hover &, [data-variant="danger"]:active &':

@mperrottimperrottiJun 7, 2024

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.

The fact that these styles affect the color of sibling nodes is kind of weird. Should we do a refactor as part of this PR? I was afraid to touch it and break things.

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.

Let's wait till we refactor to CSS modules 😂

@github-actions

github-actionsBot commented Jun 7, 2024

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js89.63 KB (+0.02% 🔺)
packages/react/dist/browser.umd.js89.89 KB (-0.04% 🔽)

@github-actions
github-actionsBottemporarily deployed to storybook-preview-4651 June 7, 2024 13:07 Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-4651 June 7, 2024 13:25 Inactive
@mperrotti
mperrotti enabled auto-merge June 17, 2024 14:52
@github-actions
github-actionsBottemporarily deployed to storybook-preview-4651 June 17, 2024 14:56 Inactive
@mperrotti
mperrotti added this pull request to the merge queueJun 17, 2024
Merged via the queue into main with commit b13bbb3Jun 17, 2024
@mperrotti
mperrotti deleted the mp/inactive-danger-hover-fix branch June 17, 2024 15:13
@primerprimerBot mentioned this pull request Jun 14, 2024
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.

2 participants

@mperrotti@langermank