Skip to content

fix(settings): make elements use proper focus colors#18852

Merged
MagentaManifold merged 1 commit intomainfrom
FXA-5787
May 14, 2025
Merged

fix(settings): make elements use proper focus colors#18852
MagentaManifold merged 1 commit intomainfrom
FXA-5787

Conversation

@MagentaManifold
Copy link
Copy Markdown
Contributor

Because

  • Front-page Settings elements focus use system default outlines.

This pull request

  • makes elements use proper focus outline colors and adds rounded corners to focus outlines.

Issue that this pull request solves

Closes: FXA-5787

Checklist

Put an x in the boxes that apply

  • My commit is GPG signed.
  • If applicable, I have modified or added tests which pass locally.
  • I have added necessary documentation (if appropriate).
  • I have verified that my changes render correctly in RTL (if appropriate).

Screenshots (Optional)

image image image

etc. Please checkout Storybook for full detail.

Other information (Optional)

Made some changes to the spacing (e.g., padding -> margin, margin -> gap) to make the outline box sizing look right. No actual layout is changed.

Copy link
Copy Markdown
Contributor

@vpomerleau vpomerleau left a comment

Choose a reason for hiding this comment

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

Nice work on these! I had a look through with storybook and added some comments for your consideration :)

<LinkExternal
href="https://www.mozilla.org/about/?utm_source=firefox-accounts&utm_medium=Referral"
data-testid="link-mozilla"
// Using grey outline here to match the rest of the footer
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.

Could we switch the focus outline to our standard blue for consistency across the app? If there’s a specific reason to match the component’s current style instead, let me know and we can discuss.

Comment thread packages/fxa-react/components/Footer/index.tsx Outdated
aria-expanded={!!isRevealed}
aria-haspopup="menu"
className="rounded-full border border-transparent hover:border-purple-500 focus:border-purple-500 focus:outline-none active:border-purple-700 transition-standard"
className="rounded-full border border-transparent hover:border-purple-500 focus-visible:outline focus-visible:outline-blue-500 focus-visible:outline-2 active:border-purple-700 transition-standard"
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.

The focus outline looks great 👌 Do you have ideas about how to update the hover styling which is still purple and conflicts a tad with the focus outline?

Comment thread packages/fxa-settings/src/components/Settings/ConnectAnotherDevicePromo/index.tsx Outdated
Comment thread packages/fxa-settings/src/components/Settings/BentoMenu/index.tsx Outdated
@vpomerleau
Copy link
Copy Markdown
Contributor

Extra note that I also had a peek at the Storybook in Windows with High-Contrast Mode active, and the focus outlines look good there too!

@MagentaManifold MagentaManifold marked this pull request as ready for review May 13, 2025 22:00
@MagentaManifold MagentaManifold requested a review from a team as a code owner May 13, 2025 22:00
Copy link
Copy Markdown
Contributor

@vpomerleau vpomerleau left a comment

Choose a reason for hiding this comment

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

Great attention to detail going through all the components + finding small tweaks that make the styling sharper.

I've added some thoughts for consideration - no blockers though because these updated styles all look good on Storybook. Please reach out if you'd like to discuss anything here!

Comment thread packages/fxa-react/styles/focus.css Outdated
Comment thread packages/fxa-settings/src/components/Banner/index.tsx Outdated
>
<button
className="w-4 h-4"
className="w-4 h-4 rounded-sm focus-visible-neutral outline-offset-2"
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.

Same as before + this component is not currently in use so it's not important, but just noting that this close icon doesn't have hover or active state indicator (so no visible interaction feedback on this button unless navigating with keyboard)

title={localizedButtonTitle}
aria-label={localizedButtonAriaLabel}
className="me-4 tablet:me-0 tablet:p-4 tablet:absolute tablet:-start-24"
className="me-4 tablet:me-0 tablet:p-4 tablet:absolute tablet:-start-24 focus-visible-neutral"
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.

This work on focus states is making it obvious that many buttons/links are missing interaction feedback on hover/active states. 😰

Comment thread packages/fxa-settings/src/components/ResetPasswordWarning/index.tsx Outdated
Comment thread packages/fxa-settings/src/components/Settings/BentoMenu/index.tsx
aria-expanded={!!isRevealed}
aria-haspopup="menu"
className="rounded-full border border-transparent hover:border-purple-500 focus:border-purple-500 focus:outline-none active:border-purple-700 transition-standard"
className="rounded-full border border-transparent hover:border-purple-500 active:border-purple-700 transition-standard focus-visible-neutral focus-visible:border-transparent"
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.

You're already aware of this, but just noting here that the hover/active states here need a review from UX because they don't look clean when combined with the focus outline. This could be pulled in as a quick follow-up with some of the other interaction state updates you have planned (e.g., for the shadowy outlines on links) instead of holding up this PR though.

Comment thread packages/fxa-settings/src/components/Settings/HeaderLockup/index.tsx Outdated
Because:

* Front-page Settings elements focus use system default outlines.

This commit:

* makes elements use proper focus outline colors and adds rounded corners to focus outlines.

Closes #FXA-5787
@MagentaManifold MagentaManifold merged commit ffcf3b8 into main May 14, 2025
19 checks passed
@MagentaManifold MagentaManifold deleted the FXA-5787 branch May 14, 2025 23:43
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.

2 participants