digdir / designsystemet

Designsystemet
https://designsystemet.no
MIT License
76 stars 37 forks source link

Accessibility and quality issues found in automatic tests for designsystemet.no #2501

Open Camulos opened 3 days ago

Camulos commented 3 days ago

Description of the bug

Automatic testing of designsystemet.no, tools used:

Findings in categories:

Accessibility findings in WCAG categories A and AA should be prioritized.

Images from Sortsite (20. september 2024)

Skjermbilde 2024-09-20 kl  10 09 12 Skjermbilde 2024-09-20 kl  10 08 40 Skjermbilde 2024-09-20 kl  10 06 27

Steps To Reproduce

Scan using automatic tools.

Additional Information

No response

### Tasks
- [ ] AAA - Some interactive elements are smaller than 44x
- [ ] ARIA - Skip link is not inside a landmark
- [ ] AAA - Our accent color do not have enough contrast on links and buttons to pass enhanced contrast requirements
- [ ] A - Add empty alternative texts to decorative SVGs
- [ ] Enhancment - Documentation pages do not start with a H1
- [ ] A - Add text alternative to videoes (iframes)
- [ ] Enhancment - Headers on front page and component overview have no content
- [ ] AAA - FontSize on front page is in px
- [ ] AA - Comments inside code snippets have low contrast
- [ ] A - A video plays longer than 5 seconds, without a way to pause it. (Sortsite scan)
- [ ] A - PDFs need title, language tag and tags for accessibility (Sortsite scan)
- [ ] A - Document title must not be blank. (Sortsite scan) - Vimeo embed
- [ ] A - alt text should not contain placeholders like 'picture' or 'spacer'. (Sortsite scan) - "image" alt text
- [ ] AA - Phrases in a different language should be in a span or div with a lang attribute. (Sortsite scan) - artikler med kode
Camulos commented 3 days ago

Level A finding in Sortsite: "A video plays longer than 5 seconds, without a way to pause it." and "Avoid animated images over 5 seconds long that can't be paused or stopped." Relates to WCAG 2.2.2 Pause, stop, hide Found 2 times, animations on front-page Skjermbilde 2024-09-24 kl  12 24 24 Respects user setting for reduced animations? Yes! As the animations is looped, and the content is not related to real-time updates/events it may be necessary to also give the user means to stop the animation by interacting with it. However as it respects the user preferences it could be that this issue is not critical. (For discussion)

Camulos commented 3 days ago

Level A finding in Sortsite:

Relates to WCAG success criterion

Found 3 times in PDFs uploaded to the site: Skjermbilde 2024-09-24 kl  12 38 15 The first two documents is generated from Confluence using the save as PDF feature, the documents should have been adjusted in Acrobat Pro before uploading here. The third document seem to be related to "Dødsfall og arv", based on the link-text.

The PDFs is used in this page: https://www.designsystemet.no/grunnleggende/introduksjon/designprinsipper (found from the footer urls on the frontpage)

Adding title and language-tag is fairly simple for PDFs, but if this is something we want to do, there may be other issues as well that the accessibility scan in Acrobat would find. The tagging for accessibility may be more of a challenge to amend after the documents have been created.

It is possible that the content of these documents is easiest made available and recreated as web-pages?

Camulos commented 3 days ago

Level A finding in Sortsite: "SVG elements with graphic role attributes must have an accessible name." (SVG elements with role=img, role=graphics-document or role=graphics-symbol need an accessible name provided by the SVG title element or an ARIA label.) Relates to WCAG success criterion: 1.1.1 Non-text content

Found on 28 pages, multiple times on some pages

Skjermbilde 2024-09-25 kl  08 22 27

It looks like this is a problem almost everywhere there is any SVG-files, for example the three icons used to illustrate the 3 main call to action cards from the front page.

Many of these SVGs could be hidden with aria hidden, but even if hidden they should most likely be given an labelled by and their first child should be an title?

mimarz commented 2 days ago

Moving this to an epic as we'll have different sub-tasks to fix this.

Camulos commented 2 days ago

Level A finding in Sortsite: "Document title must not be blank." Relates to WCAG success criterion 4.1.2 Name, Role, Value

Found 2 places and it looks like it is when we embed video from Vimeo:

The frames/iframes need to have the title-attribute set to avoid SR read the filename (urls?) instead.

Camulos commented 2 days ago

Level A finding in Sortsite: "Element li not allowed as child element in this context." Relates to WCAG success criterion 1.3.1 Info and Relationships

Found on this page: https://www.designsystemet.no/grunnleggende/designelementer/farger In selections for brand or mode here:

Skjermbilde 2024-09-25 kl  12 39 27

There are li-elements that are not set inside either ol or ul in these dropdowns.

Camulos commented 2 days ago

Level A finding in Sortsite: "alt text should not contain placeholders like 'picture' or 'spacer'." Relates to success criterion 1.1.1 Non-text Content

In this page: https://www.designsystemet.no/grunnleggende/designelementer/ikoner there is an image that uses the alt text "image" here:

Skjermbilde 2024-09-25 kl  12 44 49
Camulos commented 2 days ago

Level AA finding in Sortsite: "Phrases in a different language should be in a span or div with a lang attribute." Relates to success criterion 3.1.2 Language of parts

Found in this page: https://www.designsystemet.no/grunnleggende/for-utviklere/komposisjon Every time an code-example is inserted in the text, the SR will try to read them in Norwegian, however the codes should be read in english? Add span for each and add lang="en" for each such span?