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
DataViews: set color for primary field/a
element when focused
#58814
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. |
packages/dataviews/src/style.scss
Outdated
@@ -228,6 +228,10 @@ | |||
&:hover { | |||
color: $gray-900; | |||
} | |||
&:focus { | |||
color: var(--wp-admin-theme-color--rgb); |
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'm not convinced this is the right approach/color combination.
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.
In addition to the fix, I wonder how 3rd parties can provide their own theming. We have a mix of approaches:
- in some places, dataviews uses the
@wordpress/component
variables and fallback to wp-admin theme. - in some other, dataviews uses the wp-admin theme custom properties directly.
Size Change: +49 B (0%) Total Size: 1.71 MB
ℹ️ View Unchanged
|
This seems like a step in the right direction to me, but the cut-off shadow looks a bit strange. Could we try a solid ring instead, similar to the focus treatment applied to other elements in Gutenberg? That seems achievable using As noted in #58811 should we apply these styles to |
Pushed an update and it's the outline/shadow is no longer cut-off.
The difference is visible for controls ( |
d01629e
to
c061051
Compare
After looks good, though can you try an outset box-shadow instead of inset? |
c061051
to
51f5c09
Compare
ok, I've done that. I had to add a little margin on the sides to prevent the outline cut-off. Is that the preferred way? Also tried with outline-offset but couldn't make it work. Feel free to push a fix if you will. |
I'll try a fix tomorrow, I don't think we should add margin, or it might get jumpy. I see that the box shadow is already not "inset", so something else may be going on. But I'll see if I can push a fix in my morning. |
I pushed a small fix, I think this is acceptable: However, I'm not entirely sure this should land. I wonder if we can put it in the reset mixin? ( The thing is: we should not override the focus style on a per-section basis. There should be a single focus style for the Here's another place where it bleeds through: Pending an update to all of WordPress, can we move the fix to the reset, and then apply a local override here if need be? |
d68cbfb
to
3f9c376
Compare
@jasmussen I've created a Also, with the latest commit, I still see the outline being cut-off on the inline axis: |
The mixin sounds good. As far as the cutoff, is there |
I think @t-hamano may have worked on adjacent code, perhaps @richtabor as well. |
3f9c376
to
b03904e
Compare
6314965
to
1a84d9e
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.
405ce6d
to
6ade827
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!
- ✅ No build warning/error
- ✅ The focus outline cannot be cut off.
- ✅ Outline color changes depending on user's color scheme
@@ -367,6 +367,14 @@ | |||
} | |||
} | |||
|
|||
@mixin link-reset { |
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.
Why is this called link-reset?
Is this fix, something we want in 6.5? |
I don't see any reason not to include it. |
Co-authored-by: oandregal <oandregal@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
I just cherry-picked this PR to the update/packages-6.5-rc1 branch to get it included in the next release: 8334c94 |
Co-authored-by: oandregal <oandregal@git.wordpress.org> Co-authored-by: jasmussen <joen@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
Part of #55083
Fixes #58811