Skip to content

fix: correct markup for Abbr component #19317

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

Merged
merged 6 commits into from
Aug 14, 2025
Merged

fix: correct markup for Abbr component #19317

merged 6 commits into from
Aug 14, 2025

Conversation

Parkreiner
Copy link
Member

@Parkreiner Parkreiner commented Aug 12, 2025

Fixes some accidental styling issues introduced in #19242

Changes made

  • Updated styles
  • Added support for className prop so that we can override the styles as needed
  • Removed the aria-label in favor of injecting the main text directly

Notes

  • This feels like a case where the changes in the previous PR were actually correct overall, but something with our MUI+Tailwind setup created conflicting styles, and we accidentally introduced an underline style that shouldn't be there
  • Removed the Aria label because I've realized in the past year that Aria is really easy to misuse, and it's best just to do things with the base HTML features as much as possible. There's a risk that the old code had compliance issues with certain types of screen readers (even though it worked fine when I did manual testing back in 2023). These changes hopefully remove those risks completely

@Parkreiner Parkreiner self-assigned this Aug 12, 2025
@Parkreiner Parkreiner marked this pull request as ready for review August 13, 2025 21:18
@Parkreiner Parkreiner requested a review from aslilac as a code owner August 13, 2025 21:18
pronunciation: Pronunciation;
};

function assertAccessibleLabel({
Copy link
Member Author

Choose a reason for hiding this comment

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

Got rid of the test helper because it felt like we were binding all our tests to a shallow abstraction

children === children.toUpperCase()
? "tracking-wide"
: "tracking-normal",
"no-underline tracking-normal",
Copy link
Member

Choose a reason for hiding this comment

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

I wish we understood where the underline is coming from. these kinds of conflicts are so annoying. can we at least add a TODO to clean this up one day?

Copy link
Member Author

@Parkreiner Parkreiner Aug 14, 2025

Choose a reason for hiding this comment

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

So, the funny thing is, abbr elements have an underline by default in normal HTML – it's MUI that somehow overrode it

I actually don't think we should do anything – once MUI is out, we should be much closer to "normal" CSS, and this behavior would be 100% expected

@Parkreiner Parkreiner merged commit 0c203b0 into main Aug 14, 2025
32 checks passed
@Parkreiner Parkreiner deleted the mes/abbr-fix branch August 14, 2025 04:20
@github-actions github-actions bot locked and limited conversation to collaborators Aug 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants