-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Button: Update hover styles to account for pressed state for tertiary button
#68542
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
Button: Update hover styles to account for pressed state for tertiary button
#68542
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
I'd suggest to wait for some feedback from @WordPress/gutenberg-design and see what is the desired styling. Screenshot: |
Thanks for the review, @afercia. I think I've considered the I'll await design feedback on this one, post which, I should have a clear path forward. |
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.
Thanks for the PR!
We found that this problem is new to WordPress 6.8, so let's fix this problem in 6.8 release.
First, this problem occurred by #67325. I read all of #67325, and it looks like the reason for the changes made to the tertiary button as well as the secondary button was to apply a consistent hover color style (See this commit: d68ec6a).
At that time, the is-pressed
selector was added to the secondary button, but it seems that adding it to the tertiary button was forgotten.
background: color-mix(in srgb, $components-color-accent 4%, transparent); | ||
color: $components-color-accent-darker-20; | ||
} | ||
|
||
&:active:not(:disabled, [aria-disabled="true"]) { | ||
background: color-mix(in srgb, $components-color-accent 8%, transparent); | ||
color: $components-color-accent-darker-20; |
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.
I think this color makes the text hard to read in hover + active (hover + mouse click) state:
Currently, the pressed + active state is inconsistent across all variations. Text becomes invisible, background color changes, etc.
In the screenshot below, I have enabled the pseudo active state for all variations:
Until we have a clear direction to address these, I suggest not adding new styles to the active state.
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.
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.
Would it be helpful to create a new issue for it with
Needs design feedback
to gather opinions?
It's a good idea 👍
548ff1e
to
5bfb2e1
Compare
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.
LGTM! Let's wait for additional feedback and backport this PR to 6.8 RC2.
I tested various states by running storybook:e2e:dev
. I believe there are no visual changes except for hover + pressed + tertiary state:
6be2455945af7f5fded6ba5df2f565b5.mp4
Pinging @WordPress/gutenberg-components @Mamaduka for additional feedback/approval. We plan to backport this PR into 6.8 RC2. |
The fix makes sense to me, so +1 for backporting. |
There was a conflict while trying to cherry-pick the commit to the wp/6.8 branch. Please resolve the conflict manually and create a PR to the wp/6.8 branch. PRs to wp/6.8 are similar to PRs to trunk, but you should base your PR on the wp/6.8 branch instead of trunk.
|
@yogeshbhutkar Do you have the bandwidth to manually backport this PR into the Similar failures have occurred in the past, but these were also caused by conflicts in the changelog file. Example: |
Thanks for the heads up, @t-hamano. I'll be creating a PR shortly. |
…y button` (#69744) * Button: Update hover styles to account for pressed state for `tertiary button` (#68542) * chore: scope `CHANGELOG` changes to the current PR * chore: remove version from `CHANGELOG` Co-authored-by: yogeshbhutkar <yogeshbhutkar@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
…y button` (WordPress#68542) * Button: Update hover styles to account for pressed state * Components: Add `CHANGELOG` entry * Components: Update `CHANGELOG` entry * Components: move `CHANGELOG` entry to `Unreleased` section * Button: Update active state color for better visibility when button is pressed * chore: fix CHANGELOG entry * fix: remove color from active state Co-authored-by: yogeshbhutkar <yogeshbhutkar@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: afercia <afercia@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: patil-vipul <vipulpatil@git.wordpress.org>
What, Why and How?
As noted in the comment, the is-pressed CSS rule was overridden on hover, resulting in a dark blue accent that reduced readability.
gutenberg/packages/components/src/button/style.scss
Line 172 in ef7afef
This PR introduces an additional
:not
condition to ensure the color property is applied only when theis-pressed
state is not active.Testing Instructions
storybook
usingnpm run storybook:dev
command.Button
component.variant
istertiary
.text color
stayswhite
onhover
.Screencasts
The settings button hover effect
It was found to work as expected.
Closes: #68535