Font Weight Accessibility Issue
Flatpickr fails when using an accessibility checker. In my case, the checker i'm using is "Sort Site by PowerMapper" which uses WCAG 2.0 Level A rules, and this is happening on several sites that use flatpickr.
The accessibility issue is
"Use semantic markup like STRONG instead of using the CSS font-weight property. Use the STRONG element instead of the SPAN element for bold text."
https://www.w3.org/TR/WCAG20-TECHS/F2.html
This is a bit of a silly issue, but you would need to replace all the span elements that contain font-weight: bold (.flatpickr-current-month span.cur-month, .flatpickr-weekday), with strong elements OR modify the CSS.
As a temporary fix for this, in the CSS file, I've just replaced all instances of font-weight: bold, with font-weight: 400, and added text-shadows to them so they appear bold.
That way flatpickr passes accessibility...
Your Environment
- flatpickr version used: 3.0.6
- Browser name and version: Chrome 60.0.3112.101
- OS and version: Windows 10
This doesn't really make sense because the <strong> element is intended to convey strong importance usually depicted in bold text, whereas bold text using font-weight is only an appearance property with additional meaning/emphasis.
Barring machine learning, an accessibility tool would not be capable of knowing whether the text is supposed to be important or just visually distinct (bold).
See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong#Bold_vs._Strong
Yea its a really strange issue, but it did fix itself when I changed the font-weight in the stylesheet. So it must be capable of knowing. And the issue is still valid as seen on the w3 site...
Hello,
As mentioned earlier, the font-weight is there simply for visual purposes, rather than emphasis.
While there's work to be done regarding accessibility (which for me is not just a "feature", but a requirement), I consider this a non-issue.
But thank you for raising concern about it regardless!