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

♿ [#2955] A11y: Remove B-tags if they are used for styling #1566

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jiromaykin
Copy link
Contributor

@jiromaykin jiromaykin commented Jan 16, 2025

B-tags should not be used lightly, usually these need to be replaced with a STRONG tag or a correct styling class, since B has no meaning and is only a visual tag (but we should use CSS for that).
Strong has emphasis in meaning and tone, which is useful to (for example) notify the user there is no data available.
Screen-reader software responds differently to B-tags and Strong tags so they are more than just a 'style'.
Issue: https://taiga.maykinmedia.nl/project/open-inwoner/task/2955

Also: it is NOT allowed to use H2 headings if that heading has no paragraph and doesn't actually summarize any content - for accessibility software Headings have a specific meaning and are read out loud as a list with nested hierarchy.

So: if there is data, then it is fine to use the H2, but if there isn't, it should be a paragraph.

Additionally we should aim to always use the NLDS classes for headings, so municipalities can overwrite these with their own tokens.

The Heading hierarchy should be correct for accessibility, and it is perfectly acceptable to use the H3 CSS style for an H2 heading, as long as the HTML structure stays correct.

@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.23%. Comparing base (3cb42c1) to head (121409b).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1566   +/-   ##
========================================
  Coverage    94.23%   94.23%           
========================================
  Files         1070     1070           
  Lines        39412    39412           
========================================
  Hits         37140    37140           
  Misses        2272     2272           

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

@jiromaykin jiromaykin marked this pull request as draft January 20, 2025 09:54
@jiromaykin jiromaykin force-pushed the issue/2955-A11y-remove-b-tags branch 2 times, most recently from 2a471f7 to 9b0440b Compare January 21, 2025 10:52
@jiromaykin jiromaykin marked this pull request as ready for review January 21, 2025 10:52
@jiromaykin jiromaykin force-pushed the issue/2955-A11y-remove-b-tags branch from 713a68f to 121409b Compare January 21, 2025 11:39
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.

4 participants