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

Accessibility improvements to hint_style for emails #5372

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lucascumsille
Copy link
Contributor

@lucascumsille lucascumsille commented Feb 17, 2025

Currently, the email's top(email_summary) and bottom(email_footer) parts don't necessarily pass the contrast test. The text colour uses body_text_color, and the background colour for the top and bottom sections is not set, so the hint text is above whatever the body_background_color is. Looking at some cobrands, I can see that the problem is not only with FMS. The solution on this commit gives hint_style a background that uses color_white as a variable, and because the text is using the body_text_color, it is less likely the contrast test will fail. The scenario where this could happen is when body_text_color is using a light colour, which, so far, I haven't seen a cobrand doing this.

Screen.Recording.2025-02-17.at.14.16.05.mov

Important:

  • If the solution above is accepted then we need to update the email_top and email_bottom templates for: Hackney, Bathnes and Fixamingata
  • Regarding getting rid of email_summary it does seem like it could be done. However looking at the email_summary content across cobrands it seems like it doesn't mimic the main title of the email 100% of the time. Reason why I didn't remove it.

I added an extra commit that corrects the extra space use by "This email was sent from a staging site."

Before

Screenshot 2025-02-17 at 14 30 46

After

Screenshot 2025-02-17 at 14 30 05

[skip changelog]

Currently, the email's top(email_summary) and bottom(email_footer) parts don't necessarily pass the contrast test. The text colour uses body_text_color, and the background colour for the top and bottom sections is not set, so the hint text is above whatever the body_background_color is. Looking at some cobrands, I can see that the problem is not only with FMS. The solution on this commit gives hint_style a background that uses color_white as a variable, and because the text is using the body_text_color, it is less likely the contrast test will fail. The scenario where this could happen is when body_text_color is using a light colour, which, so far, I haven't seen a cobrand doing this.
Copy link

codecov bot commented Feb 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.42%. Comparing base (98764b8) to head (ba26387).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5372      +/-   ##
==========================================
- Coverage   82.43%   82.42%   -0.01%     
==========================================
  Files         416      416              
  Lines       32979    32979              
  Branches     5308     5308              
==========================================
- Hits        27186    27184       -2     
- Misses       4220     4221       +1     
- Partials     1573     1574       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Now, the upper box in the email with the text: " This email was sent from a staging site." is horizontally aligned with the rest of the boxes below it.
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.

1 participant