question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Improve accessibility on the theme

See original GitHub issue

I checked that…

  • … the documentation does not mention anything about my problem
  • … the problem doesn’t occur with the default MkDocs template
  • … the problem is not in any of my customizations (CSS, JS, template)
  • … there are no open or closed issues that are related to my problem

Description

It probably depends on the palette accent/primary color used, but we have this kind of accessibility issue at least with the red and blue variation.

I was running a Lighthouse check on our website and realize this accessibility issue:

Background and foreground colors do not have a sufficient contrast ratio.

image

This is valid for the title and links in the header, the links in the main content and the links in the footer.

Expected behavior

Lighhouse do not report any contrast issue.

Actual behavior

Lighhouse reports some contrast issues with various elements of the page.

Steps to reproduce the bug

  1. Open a website using mkdown material on Chrome
  2. Click on the Lighthouse tab and click on generate report
  3. Check the issues related to Accessibility

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
squidfunkcommented, Sep 29, 2020

Sure! It will be merged back into master as soon as the funding goal is hit 😊 You’ll have immediate access if you become a sponsor of this project, which starts at $10/m. If you don’t want to become a sponsor, note that you can already also tweak colors and color schemes easily with some CSS.

1reaction
squidfunkcommented, Oct 4, 2020

I investigated this issue and found the following issues with the original theme on the “Getting started” page:

Bildschirmfoto 2020-10-04 um 13 57 49
  • Active tab labels (the blue used for the first tab titling “Material for MkDocs”). The tab label color is entirely configurable through the accent color configuration, and also customizable via 3-4 lines of extra CSS. While I agree that we should try to meet AA standards, the tab label color has a contrast ratio of 4.24 which is almost 4.5 which would pass the test, meaning we’re not far off. We would need to deviate from Google’s official Material color palette, which I would rather not do, as this will be an entire rabbit hole I don’t have the time to go down.

  • The non-link footer text, i.e. the “Made with”. I agree that this color is more off, but the problem here lies in the way links are styled in the footer. The accent color is not used on hover, to better separate the footer from the rest of the content. Also, darker accent colors will not work with the footer, thus we can only transpose the problem. For this reason we need three shades of grey: white is the hovered state, grey the unhovered state of a link, and a dark grey is the normal text color. To change the color, you can use the following extra CSS:

.md-footer-copyright {
  color: white;
}

I hope you understand this decision. While we try to make this theme as accessible as possible, some things have to be compromises, because of the many ways this theme can be configured. In the end, it’s a combinatorial problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

3 Actionable Ways to Improve WordPress Accessibility for ...
Three ways to improve WordPress accessibility · 1. Test your website's current accessibility · 2. Use an accessibility-ready theme · 3. Install a ......
Read more >
Accessibility for themes - Shopify Help Center
When you customize your theme, it's a good idea to make design and content choices that help to keep your online store accessible....
Read more >
Top 10 Tips for Making Your Website Accessible
Choose a content management system that supports accessibility ; Use headings correctly to organize the structure of your content; Include proper alt text ......
Read more >
10 Ways to Improve Web Accessibility - StarDust Testing
10 Tips for Web Accessibility · 2. Structure and organize with headers · 3. Assign alt tags for images · 4. Use descriptive...
Read more >
How to create better, more accessible WordPress themes
Hopefully that'll help someone to build more accessible themes, and we can share ideas of how to make the web better place for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found