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

Color contrast tweaks for V4 #19693

Closed
wants to merge 6 commits into from
Closed

Color contrast tweaks for V4 #19693

wants to merge 6 commits into from

Conversation

patrickhlauke
Copy link
Member

A series of (hopefully non-controversial) tweaks to some common color contrast issues that V4 inherited from V3.

Some of these tweaks aim for the full 4.5:1 color contrast ratio recommended by WCAG 2.0, while others (notably the success, info and warning tweaks) go for the slightly more relaxed 3:1 (which is really for large text, so still not ideal in all situations...but a slightly more achievable goal, particularly for vibrant colors).

Not all possible combinations have been tried out, but most tweaks seem to move towards a more positive result judging purely by the documentation examples.

#70787D makes this pass 4.5:1 contrast ratio against white at least
Improves contrast of active breadcrumb (using new darker #70787D) to at
least 4.2:1, which passes nominally for large text (though currently
breadcrumb text is not exactly "large")
Nudges it past 3:1 (counting it as "large text") and past 4.5:1 when
hovered/focused
This at least pushes them over the 3:1 contrast ratio for large text
(though admittedly "warning" looks very muddy)
No quite 4.5:1 ratio yet, but a shade more contrasty
@patrickhlauke
Copy link
Member Author

Visual examples of the changes (compared to http://v4-alpha.getbootstrap.com/ - hence the difference in font, which is not related to this particular PR but to a previously merged change in the font stack). All examples are before/after (left/right or top/bottom)

untitled-1

untitled-1b

untitled-2

untitled-3

untitled-4

untitled-5

untitled-6

untitled-7

untitled-9

untitled-10

untitled-12

@patrickhlauke
Copy link
Member Author

The tweak to the secondary button would also address the concern (against white background anyway) of the secondary outline variant from #17286

@cvrebert
Copy link
Collaborator

cvrebert commented Apr 9, 2016

CC: @mdo

@patrickhlauke
Copy link
Member Author

waiting for @mdo to merge #18462 so i can rejig this PR and hopefully get non-cherry-picked parts merged with the new palette too.

@Drakenhart
Copy link

A suggestion: The U.S. Web Design Standards for government websites have addressed this and other concerns in regards to accessibility (because due to Section 508 they HAVE to address this). They have a github repository as well and have done a LOT of the footwork. Check it out for inspiration?

@mdo mdo modified the milestones: v4.0.0-alpha.3, v4.0.0-alpha.4 Jul 23, 2016
@Francismori7
Copy link

Seems like they do not really affect .alerts?

@patrickhlauke
Copy link
Member Author

@mdo mind having a look at the big composite image #19693 (comment) and giving your thoughts on these proposed tweaks? would love to see at least some improvements to the out-of-the-box color contrast on some of the items make it into BS at some point...

@mdo mdo modified the milestones: v4.0.0-alpha.5, v4.0.0-alpha.6 Oct 19, 2016
@mdo
Copy link
Member

mdo commented Nov 25, 2016

Superseding this with #21199, which tackles most of this minus the brand color changes. I'll swing back around to those at a later time to give them a bit more love—not super happy with where those values ended up.

@mdo mdo closed this Nov 25, 2016
@mdo mdo removed this from the v4.0.0-alpha.6 milestone Nov 25, 2016
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.

5 participants