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(TabInfoButton): [EMU-7334] Increase contrast #309

Merged
merged 2 commits into from
May 13, 2024

Conversation

kimkwanka
Copy link
Contributor

What this PR does

This PR increases the contrast ratio between TabInfoButton and background as user testing showed that it's really hard to see.

Before

image

After

image

Why is this needed?

Solves:
EMU-7334

Checklist:

  • I reviewed my own code
  • The changes align with the designs I received
    Or give a reason why this does not apply:
  • I have attached screenshot(s), video(s) or gif(s) showing that the solution is working as expected
    Or give a reason why this does not apply:
  • I have updated the task(s) status on Linear
  • All new media is optimized (images, gifs, videos)

Browser support

My code works in the following browsers:

  • Firefox
  • Chrome
  • Safari
  • [xw] Edge

@@ -25,7 +25,7 @@
}

svg {
fill: $ds-primary-100;
fill: $ds-grey-400;
Copy link
Collaborator

@diogomateus diogomateus May 13, 2024

Choose a reason for hiding this comment

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

Not necessary as part of this PR but if you want, you can also replace this inline SVG with
<InfoInfo color="grey-400" size={20 /* or other */} />

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds nifty, but how would I then give it hover states and similar? I tried manipulating it with

svg {
 fill: SOMECOLOR
}

to no avail :/
Looks like the fill is set to "currentColor" at all times

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nvm, I need to use svg -> path instead.

Copy link
Collaborator

Choose a reason for hiding this comment

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

You can then remove the svg fill color as the Icon component captures the button color (that's what currentColor is doing):

.button {
  color: $ds-primary-400;
  
  &:hover {   
    color: $ds-primary-300;
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah cool 👍 Will keep that in mind and use it in the future! Here however, for better a11y, I wrapped the icon in a real button and just tweaked the original custom css instead of creating 2 new classes (one for the wrapping button and one for the icon itself).

@kimkwanka kimkwanka force-pushed the kim/emu-7334-make-tabinfobutton-darker branch from ee6a8c6 to 7010599 Compare May 13, 2024 10:35
@kimkwanka kimkwanka merged commit 4f47a31 into main May 13, 2024
4 checks passed
@kimkwanka kimkwanka deleted the kim/emu-7334-make-tabinfobutton-darker branch May 13, 2024 10:37
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.

3 participants