Skip to content
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

Fix/site icon focus #65936

Closed

Conversation

karthick-murugan
Copy link
Contributor

@karthick-murugan karthick-murugan commented Oct 8, 2024

What?

Fixes 61339 and #66375
This PR updates the SCSS file for the site icon to improve focus visibility.

Why?

The focus ring on the site hub icon was not visible or visually appealing when using keyboard navigation, impacting accessibility.

How?

The SCSS file gutenberg/packages/edit-site/src/components/site-icon/style.scss has been modified to add a blue border outline around the site icon when it is focused.

Testing Instructions

  1. Open the dashboard and navigate to Appearance > Editor.
  2. Click anywhere in the container to close the navigation.
  3. Use the keyboard to focus on the site icon in the top left corner.
  4. Ensure the blue border outline appears around the site icon when focused using keyboard navigation.

Testing Instructions for Keyboard

Ensure the blue border outline appears around the site icon when focused using keyboard navigation.

Screenshots or screencast

Screenshot:
site_icon_focus

Video:
https://github.com/user-attachments/assets/4a5609a0-0827-4e43-b64d-c8b27f714aaf

Copy link

github-actions bot commented Oct 8, 2024

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 props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @gutenbergplugin, @kNoCoding.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: gutenbergplugin, kNoCoding.

Co-authored-by: AhmarZaidi <[email protected]>
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: sirreal <[email protected]>
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: ellatrix <[email protected]>
Co-authored-by: gigitux <[email protected]>
Co-authored-by: tyxla <[email protected]>
Co-authored-by: poojabhimani12 <[email protected]>
Co-authored-by: jeryj <[email protected]>
Co-authored-by: aaronrobertshaw <[email protected]>
Co-authored-by: afercia <[email protected]>
Co-authored-by: oandregal <[email protected]>
Co-authored-by: jameskoster <[email protected]>
Co-authored-by: rudrakshi-gupta <[email protected]>
Co-authored-by: Vrishabhsk <[email protected]>
Co-authored-by: rinkalpagdar <[email protected]>
Co-authored-by: talldan <[email protected]>
Co-authored-by: ndiego <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: stokesman <[email protected]>
Co-authored-by: ntsekouras <[email protected]>
Co-authored-by: ciampo <[email protected]>
Co-authored-by: getdave <[email protected]>
Co-authored-by: mcsf <[email protected]>
Co-authored-by: mirka <[email protected]>
Co-authored-by: peterwilsoncc <[email protected]>
Co-authored-by: swissspidy <[email protected]>
Co-authored-by: ryanwelcher <[email protected]>
Co-authored-by: SantosGuillamot <[email protected]>
Co-authored-by: andrewserong <[email protected]>
Co-authored-by: ramonjd <[email protected]>
Co-authored-by: nicolasgalvez <[email protected]>
Co-authored-by: hbhalodia <[email protected]>
Co-authored-by: jsnajdr <[email protected]>
Co-authored-by: torounit <[email protected]>
Co-authored-by: carolinan <[email protected]>
Co-authored-by: karthick-murugan <[email protected]>
Co-authored-by: vipul0425 <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Oct 8, 2024
Copy link

github-actions bot commented Oct 8, 2024

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @karthick-murugan! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

@akasunil akasunil added [Type] Bug An existing feature does not function as intended CSS Styling Related to editor and front end styles, CSS-specific issues. labels Oct 8, 2024
Copy link
Contributor

@jeryj jeryj left a comment

Choose a reason for hiding this comment

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

Thanks for taking a look at this!

@@ -19,4 +24,9 @@
.edit-site-layout.is-full-canvas & {
border-radius: 0;
}

// Add focus-visible styles
button[data-focus-visible="true"] & {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason to use [data-focus-visible="true"] instead of :focus here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I will try to update it with :focus.


// Add focus-visible styles
button[data-focus-visible="true"] & {
border: 2px solid #1e90ff;
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we have some focus style mixins or variables we can use instead of hardcoding these.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes will use variables.

Comment on lines 11 to 14
// Add focus-visible styles
button[data-focus-visible="true"] & {
border: 2px solid #1e90ff;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to repeat this code block within each section, or is there something higher up we can hook into so we only need to have this focus style one time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes we can update that style to one time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jeryj - Thank you for your feedback and I have updated all the feedback in latest commit. Please have a look.

button:focus {
.edit-site-site-icon__icon,
.edit-site-site-icon__image {
border: var(--wp-admin-border-width-focus) solid var(--wp-admin-theme-color);
Copy link
Contributor

Choose a reason for hiding this comment

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

A border will change the sizing of the image. I believe we have a mixin or variable that uses the box-shadow for the focus style instead. Also, I think we should apply the focus style to the button, not the inner part of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for your feedback @jeryj When I try to add box-shadow I can see the outline on the right side and bottom only and cannot see it in top and left. This is because the Site Icon is on the Top Left. Please have a look at this screenshot
box_shadow

Please advice how to proceed in this case. Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jeryj if you have some time, please advice on this. Thanks in advance.

Copy link
Contributor

Choose a reason for hiding this comment

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

You may need to apply the focus ring to a :before or :after pseudo element in order to have it be visible and inset slightly from the edge.

AhmarZaidi and others added 22 commits November 13, 2024 12:36
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: ellatrix <[email protected]>
Co-authored-by: draganescu <[email protected]>
Co-authored-by: getdave <[email protected]>
Update package management to use npm workspaces instead of lerna.

Lerna is obsolete for many repository management operations, such as
dependency installation or script running. All of these are supported by
npm now.

Lerna continues to be used for publishing flows to ensure the
appropriate dependencies are updated and published with the correct
versions.

The hope is that this simplfies dependendy management and maintains a
more sane dependency tree. Dependency management has become increasingly
difficult as Gutenberg has grown.

---

This was originally merged in 4693c0f.
It was reverted in order to merge it at a more time.

---

Co-authored-by: t-hamano [email protected]
Co-authored-by: sirreal [email protected]
Co-authored-by: gziolo [email protected]
Co-authored-by: ciampo [email protected]
Co-authored-by: jsnajdr [email protected]
Co-authored-by: yusuke-omae [email protected]
Co-authored-by: kevin940726 [email protected]
Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: gziolo <[email protected]>
Co-authored-by: gigitux <[email protected]>
Co-authored-by: jameskoster <[email protected]>
Co-authored-by: ntsekouras <[email protected]>
Co-authored-by: oandregal <[email protected]>
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: gigitux <[email protected]>
Co-authored-by: oandregal <[email protected]>
Co-authored-by: jameskoster <[email protected]>
Co-authored-by: MD-sunilprajapati <[email protected]>
Co-authored-by: poojabhimani12 <[email protected]>
Co-authored-by: rishishah-multidots <[email protected]>
Co-authored-by: ingeniumed <[email protected]>
Co-authored-by: ellatrix <[email protected]>
Co-authored-by: tyxla <[email protected]>
Co-authored-by: ciampo <[email protected]>
Co-authored-by: mtias <[email protected]>
Co-authored-by: jasmussen <[email protected]>
Co-authored-by: youknowriad <[email protected]>
Co-authored-by: annezazu <[email protected]>
Co-authored-by: jameskoster <[email protected]>
Co-authored-by: aaronrobertshaw <[email protected]>
Co-authored-by: ramonjd <[email protected]>
Co-authored-by: jameskoster <[email protected]>
Co-authored-by: ciampo <[email protected]>
Co-authored-by: tyxla <[email protected]>
Co-authored-by: jasmussen <[email protected]>
* Add a transform from the Separator block to the Spacer block

* Add a transform from the Separator block to the Spacer block

Feat WordPress#65492

* Add transformation from spacer to separator

- Remove the default height of 50px after transformation to default 100px that of Spacer
- Update the transform of blocks so that it retains anchor attribute

* Add new transformation block titles in Test

* Add new transformation block titles in Test

* Add new transformation block titles in Test and resolve linting problem

* Add new transformation block titles in Test and resolve linting problem

* Update test suite snapshot for test [mobile] to pass successfully

---------

Co-authored-by: talldan <[email protected]>
Co-authored-by: rudrakshi-gupta <[email protected]>
…65340)


Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: ciampo <[email protected]>
Co-authored-by: tyxla <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: mirka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CSS Styling Related to editor and front end styles, CSS-specific issues. First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Focus ring doesn't match button Site Hub Icon size