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

Avoid rendering empty lists in top links and footer #4505

Merged
merged 9 commits into from
Jun 24, 2021
Merged

Conversation

javierm
Copy link
Member

@javierm javierm commented May 6, 2021

Background

We've had an accessibility error reported by the Spanish "Portal Administración electrónica" (PAe). While I can't find any accessibility rule saying empty lists should be avoided, it looks like some screen readers report finding lists with 0 items, which is annoying.

Objectives

  • Make sure screen readers don't announce lists with no items
  • Simplify the code rendering social links in the footer

Notes

The CSS rule ul:empty { display: none} cannot be applied here because right now browsers don't apply this rule when there's whitespace inside the <ul> tag and the HTML we generate contains whitespace.

@javierm javierm self-assigned this May 6, 2021
@javierm javierm added this to Reviewing in Consul Democracy via automation May 6, 2021
@javierm javierm changed the title Avoid rendering empty list in top links and footer Avoid rendering empty lists in top links and footer May 6, 2021
@javierm javierm force-pushed the social_footer branch 5 times, most recently from 0d6d800 to 4052154 Compare May 6, 2021 21:56
@javierm javierm force-pushed the menu_button branch 3 times, most recently from c6eb39b to dab2e80 Compare May 29, 2021 13:21
Base automatically changed from menu_button to master June 3, 2021 15:24
@taitus taitus self-assigned this Jun 24, 2021
Consul Democracy automation moved this from Reviewing to Testing Jun 24, 2021
On small screens the list is on its own line so it doesn't need a
margin, while on medium/large screens the padding of its parent element
makes the margin unnecessary as well.
We've had an accessibility error reported by the Spanish "Portal
Administración electrónica" (PAe). While I can't find any accessibility
rule saying empty lists should be avoided, it looks like some screen
readers report finding lists with 0 items, which is annoying.

We could also do it with CSS using `ul:empty { display: none}`. However,
at the time of writing no browser supports this rule when the tag
contains whitespace.
It isn't used since commit ccee843.
This way it's easier to test.
We've had an accessibility error reported by the Spanish "Portal
Administración electrónica" (PAe). While I can't find any accessibility
rule saying empty lists should be avoided, it looks like some screen
readers report finding lists with 0 items, which is annoying.
All calls were using `I18n.locale` as the second parameter, so we might
as well make it optional.
@javierm javierm merged commit d2876f5 into master Jun 24, 2021
@javierm javierm deleted the social_footer branch June 24, 2021 11:29
Consul Democracy automation moved this from Testing to Release 1.4.0 Jun 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants