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

Fixes contrast #200

Merged
merged 9 commits into from
Sep 23, 2016
Merged

Fixes contrast #200

merged 9 commits into from
Sep 23, 2016

Conversation

techieshark
Copy link
Contributor

Fixes #191 - color contrast for accessibility

See comments on commits included, but basically:

  • contrast has been tweaked to be just enough to pass tests [1]
  • changes made to switch from distinguishing links by color alone (e.g. blue link next to grey disclaimer) to now using font-weight and/or underlining (a dotted bottom border which goes solid on hover -- see note about dyslexics in this commit).
  • since the Chrome accessibility tool reported it and it was a small change, we also add aria-label where needed (commit 96acc7f).
  • added empty alt tag on a icon used in the schools detail area so screen readers ignore it
  • This commit ("fix new search button layout on narrow screens") is unrelated but was a small enough tweak I hope the off topic nature of that commit is acceptable.

Still to do:

1: except where we don't but should be fine, thanks to text-shadow. See this comment for more on that.

*  always include a dotted underline under "Start a new search".
* on hover, dotted becomes solid
* we only want padding-right: 0 to apply on wide screens.
* uses same breakpoint as bootstrap does for .col-sm-8
* apply text shadow for light elements on (kind of) dark backgrounds - has the effect of creating enough contrast to meet WCAG requirements
  (sort of: see #191 (comment))

* note we make sure to disable text-shadow on the email & github font icons while being hovered, and instead we set the hover color equal to what that text shadow would be (which provides sufficient contrast against the light circle behind the icon).
* previously the contrast wasn't great enough for disclaimer text; this fixes that
  (while also switching to from RGB to #hex since we weren't using alpha value so no need for RGB syntax)

* we now have a '.lesser-text' class for things lower in the visual hierarchy (which may or may not be disclaimers).
  note: .lesser-text needs more specificity to overcome font-size of .jumbotron p

* use the same style as the disclaimer on the first .jumbotron - gray with a bold link [1]

* to conform with WCAG 1.4.1 (Use of Color) [1], we switch from distinguishing links in disclaimer simply by color
  (blue vs light gray) to use a combination of bold font-weight and a dotted underline for links. Note, we use partly
  because it's more subtle and aesthetically pleasing for most, but also because bold is recommended as a more
  readable alternative to underlining for dyslexic users [2]

* note also we make .lesser-text font a bit smaller (while still readable) so it's position in the visual hierarchy is maintained
  while we're making it darker.

* fixes contrast for results list secondary call to action ("or try a new search")

1: see: Use of Color - https://www.w3.org/TR/UNDERSTANDING-WCAG20/visual-audio-contrast-without-color.html
- 1.4.1 Use of Color: Color is not used as the only visual means of conveying information, indicating an action, prompting a response, or distinguishing a visual element. (Level A)
- Common failure: "F73: Failure of Success Criterion 1.4.1 due to creating links that are not visually evident without color vision"

2: http://www.bdadyslexia.org.uk/common/ckeditor/filemanager/userfiles/About_Us/policies/Dyslexia_Style_Guide.pdf
* Google Chrome Accessibility audit pointed out that we didn't have any appropriate label. This fixes that by adding 'aria-label' attribute.

see https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_aria_02
* makes text just a shade darker so light font color is more visible against it.
* (background is light colored and we needed more contrast)
* for WCAG - use something other than color to show as link (it's now bold)
* instead of link underline, use border-bottom as we do elsewhere
* since the right arrow isn't really content, use :before in hopes that screen readers skip it
* improve margin (2px) between text and right arrow and between arrow and 'read more'
* use same text color as .lesser-text -- we're making it bold but we don't want it too dark that it stands out too much
* note the added <span> (schoolview.js) -- we want the border-bottom on just 'continue reading', not the right arrow content :before it.
* https://github.com/GoogleChrome/accessibility-developer-tools/wiki/Audit-Rules#ax_text_02 says:
```
<!-- Good: image used for presentation has an empty alt value -->
<img src="line.png" alt="">
```
@reekypete
Copy link
Collaborator

Hello Peter, thanks, OK to merge

@techieshark techieshark merged commit cfba146 into master Sep 23, 2016
@techieshark techieshark deleted the fixes/191-contrast_cleaned branch September 23, 2016 07:03
@techieshark techieshark mentioned this pull request May 15, 2017
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.

Color contrast for accessibility
2 participants