In the review of http://drupala11y.org these two issues:

Text has appropriate contrast
page core/themes/bartik/templates/page.html.twig

<div class=\section clearfix\></div>
<div id=\name-and-slogan\></div>

Does have color contrast problems according to this new Chrome Color Contrast plugin.

Unlike other tools that analyze the CSS, this new plugin takes a screenshot of a web page and then analyzes that. This means that gradients and background images can be clearly shown in a way that many analysis tools just don't allow.

The Name and slogan is small by default, and clearly doesn't have enough contrast according to this test. Likewise with the text in the background.

Using the ColorZilla Color Picker the colors beside these pieces of text is #0E7EC3 & #2D95D4

Neither of which meets WCAG 2.0 AA when compared against #fff here either http://webaim.org/resources/contrastchecker/

So can we make the blue darker? Will anyone notice if it is as dark as #216fa0 - which will pass?

CommentFileSizeAuthor
#81 2125621-50-74.png19.01 KBstar-szr
#80 2125621-80-after.png16.14 KBstar-szr
#80 2125621-80-before.png16.17 KBstar-szr
#78 screenshot_40_055a8e-d84c3.png225.68 KBdavidhernandez
#74 contrast_between-2125621-74.patch1.84 KBdavidhernandez
#70 bartik-color-contrast-2125621-41-slogan-color.png49.63 KBmgifford
#70 bartik-color-contrast-2125621-41-slogan-black.png52.29 KBmgifford
#70 bartik-color-contrast-2125621-44-slogan-black.png47.63 KBmgifford
#70 bartik-color-contrast-2125621-44-slogan-color.png44.38 KBmgifford
#51 post-patch.png11.07 KBwheatpenny
#51 pre-patch.png10.72 KBwheatpenny
#50 bartik-color-contrast-2125621-50.patch1.84 KBdavidhernandez
#44 big-blue.png20.74 KBmgifford
#44 bartik-color-contrast-2125621-44.patch1.84 KBmgifford
#41 bartik-color-contrast-2125621-41.patch1.84 KBmgifford
#41 New-Blue.png55.03 KBmgifford
#35 Screen Shot 2014-01-22 at 10.12.40 AM.png174.04 KBmgifford
#30 bartik-color-contrast-2125621-30.patch2.45 KBjessebeach
#21 -25_luminance-appearance.jpg43.73 KBanandkp
#21 -15_luminance-appearance.jpg41.43 KBanandkp
#21 interdiff.patch1.88 KBanandkp
#21 drupal8.bartik-theme.2125621-21.patch1.88 KBanandkp
#21 -25_luminance-passed.jpg31.45 KBanandkp
#21 -15_luminance-failed.jpg62.26 KBanandkp
#15 Bartik-Header-Gradients_Comparison-2013-11-21.png101.75 KBJeff Burnz
#11 Screen Shot 2013-11-17 at 3.44.54 PM.png39.51 KBmgifford
#10 Screen Shot 2013-11-15 at 19.39.23 .png104.11 KBmparker17
#10 interdiff.txt1.71 KBmparker17
#10 drupal8.bartik-theme.2125621-10.patch1.8 KBmparker17
#3 drupal8.bartik-theme.2125621-3.patch1.81 KBanandkp
#3 new-color-scheme_vs_old-color-scheme.png62.93 KBanandkp
#3 color-pick-regions.png41.16 KBanandkp
Selection_001.png78.48 KBmgifford
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mgifford’s picture

Issue tags: +Accessibility, +color contrast
anandkp’s picture

Assigned: Unassigned » anandkp

I've done some A11y stuff before and would love to pick this up! Lemme, lemme!

anandkp’s picture

Assigned: anandkp » Unassigned
Issue summary: View changes
Status: Active » Needs review
FileSize
41.16 KB
62.93 KB
1.81 KB

Patch Details

The patch I'm uploading was to update the color stops for the <header> element's background gradient. They correct the contrast of both the Title and Slogan elements to a contrast ratior of 4.5:1.

This change brings that part of the page up to WCAG 2.0 Level AA conformance.

The following screenshots make the details more visible.

Colour-Pick Selection Areas

The following screenshot is of the areas that I used the "ColorZilla Color Picker" Chrome addon to "pick" colours from. It includes the hex-colour values from the two areas.

Visual Before and After

The following screenshot is a composition of the "before" and "after" visual appearance of the <header> element. You will note that the gradient is quite a bit darker in appearance. It is a drastic change but it is the bare minimum contrast necessary to conform to WCAG 2.0 Level AA.

Personally speaking I feel it looks quite nice!

Additional Notes

  • Please note that the patch includes a change to Bartik Theme's color.inc file as well so that this colour gradient scheme is now the Theme's default.
  • This is my very first patch to core. I hope that it meets with the community's standards... Take it easy on the poor ol' noob! :oD
  • @mparker17 pretty much held my hand throughout the process of looking through this issue and creating the patch. Many thanks to him!!!
Jeff Burnz’s picture

Can we experiment a bit with extending the original dark blue further into the gradient, rather than changing the color. Something like this:

background: linear-gradient(to bottom, #0779bf 70%,#478cc6 100%);

These new colors have less blue and green but the same amount of red, which makes them more of a purple.

mgifford’s picture

@anandps Love the enthusiasm. Thanks for rolling up that patch! Can you edit it so that the images that you uploaded show up inline? Not sure what the problem is here, but the images look fine on their own.

Can you experiment with Jeff's suggestion? If we can change the gradient, it might be easier to get adoption.

jessebeach’s picture

@anandps thanks for jumping on this issue. We're working on announcing an effort to clean up issues like this in the automated testing results. So your patch is already a big step in that direction!

mgifford’s picture

Issue tags: +Green by 2014

Tagging.

Bojhan’s picture

Subscribe

jessebeach’s picture

anandps, if you incorporate Jeff Burnz's comment into a reroll, I'll review it.

mparker17’s picture

mgifford’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
39.51 KB

This complies now with the Chrome Color Contrast plugin that I used to identify the problem initially.

The outlined text shows it's all good. I think it looks richer too.

Bojhan’s picture

Isn't this basically removing the gradient on the bg?

mgifford’s picture

I'm not a colour guy, there is technically a gradient, and it will be easier for everyone to read. That might not be enough though.

anandkp’s picture

@everyone on this issue: Sorry for the huge delay and silence from my side... I'd always assumed I'd be notified about issues I'm interacting with but it turns out that my notification settings were set to off! Fixed that now.

@jessebeach: Sorry about the delay again... Many thanks to @mparker17 for providing the patch update and interdiff!

@Bojhan and @mgifford: I've updated the Issue so that the inline images are visible now (had been waiting for Comment editing to be enabled in order to do this. If you take a look at the inline images, you will see things clearly - the gradient is definitely still there, only, it's using a deeper hue-set of colours. Could

@everyone: I've contacted the original author of the Bartik theme, jensimmons and requested her advice and help. Hopefully her input will allow us to move forward and definitively close this issue with confidence!

Cheers! :o)

Jeff Burnz’s picture

Isn't this basically removing the gradient on the bg?

It does make the top 70% pretty much a solid color, certainly not wedded to this, just an idea.

Heres a screenshot showing the original gradient colours, then two darkened alternatives (-15% luminance, and -25 luminance). Basically I convert the hex to hsl and lower the luminance for the whole gradient, then convert it back to hex.

Maybe we can test and find some happy middle ground. Going "too dark" makes the top a bit oppressive and really changes the whole feel of the design. To my mind "too dark" feels a bit serious, whereas Bartik is kind of young and playful in it's original blue.

Here are the actual gradients, sorry I can't test right now as I have no real tools to do so. Note these are not using the 70% solid idea.

-15:
background: -moz-linear-gradient(top, #06649e 0%, #2296de 100%);

-25:
background: -moz-linear-gradient(top, #05598d 0%, #1d85c5 100%);

anandkp’s picture

Assigned: Unassigned » anandkp

Hi folks!

Will implement Jeff Burnz's provided gradients and re-run the Chrome contrast tests against them later today.

Thanks for the input Jeff Burnz!

jessebeach’s picture

Great, I'll review once you get Jeff Burnz's feedback incorporated. Thanks anandps!

anandkp’s picture

My pleasure @jessebeach!

Jeff Burnz’s picture

Status: Reviewed & tested by the community » Needs work

Mike, just resting this until the next tests are done, so what comes of it.

mgifford’s picture

Good call!

anandkp’s picture

Assigned: anandkp » Unassigned
Status: Needs work » Needs review
FileSize
62.26 KB
31.45 KB
1.88 KB
1.88 KB
41.43 KB
43.73 KB

Update

I've applied the colour changes one at a time as request by @Jeff Burnz in his comment (#15).

Below, I include the exact colour values as sampled in the same way described in my first comment (#3) along with a screenshot of the real appearance and a screenshot of the Chrome A11y Colour Plugin's result.

Findings

At -15% Luminescence

Colour Codes
  • Site title: Colour set = foreground:#ffffff, background:#137CBC = pass
  • Site slogan: Colour set = foreground:#ffffff, background:#1883C6 = fail
Appearance and Chrome A11y Result
  • Visual appearance:
  • Chrome a11y result:

With -25% Luminescence

Colour Codes
  • Site title: Colour set = foreground:#ffffff, background:#106EA8 = pass
  • Site slogan: Colour set = foreground:#ffffff, background:#1475B0 = pass
Appearance and Chrome A11y Result
  • Visual appearance:
  • Chrome a11y result:

The new patch

As we can see, the test passes when we reduce the luminosity by 25%. Thus, the patch I've attached (drupal8.bartik-theme.2125621-21.patch) uses @Jeff Burnz's 25% reduction in luminescence values.

Conclusion

I feel that we have TWO viable options now: the patch from comment #3 and the patch I'm attaching now. I'd like to defer to the design sense of those who were originally involved with the creation of the Bartik theme. I do feel that the difference between the two options is not very much.

Cheers!

mgifford’s picture

I was curious what the color contrast was on the My Account & Log out links in the top right. I don't need to see them, but just wanted to verify that the contrast would be the same as that tested.

Looks good by the way. I do think I like the new one, but I'm not a color guy.

The last submitted patch, 21: drupal8.bartik-theme.2125621-21.patch, failed testing.

The last submitted patch, 21: interdiff.patch, failed testing.

mparker17’s picture

@anandps, name the interdiff file "interdiff.txt" to prevent Testbot from trying to test it. Check out the documentation on Creating an interdiff for more information.

anandkp’s picture

Thanks for the link @marpker17! I'll look into why the apply failed later today.

Should i delete the patch and interdiff files I uploaded and resubmit? I'm not sure how to respond to the System message about the patch not applying...

Let me know of action is needed... If so, I'll reassign the issue to myself and proceed with your input.

Thanks!
Thanks!

mgifford’s picture

The last submitted patch, 21: drupal8.bartik-theme.2125621-21.patch, failed testing.

mparker17’s picture

@anandps, D8 head has probably changed enough that your patch no longer applies. Check out the documentation for re-rolling patches.

jessebeach’s picture

I've rerolled the changes.

anandps, I had a lot of trouble rolling patches when I first started. It takes time to get into a rhythm and get your tools optimized. If you feel like you keep hitting the same wall, let me know and we'll have a look at how you've got your local environment set up. Otherwise, I'll just assume that you'll figure it out with a little trial and error, cool?

anandkp’s picture

Thanks a TONNE @jessebeach!

Yes, the idea of "re-rolling" patches still trips me up a bit. @mparker17 has been helping me quite a bit with this stuff... I think that, in this instance, it may have been the fact that I worked from my Windows+Cygwin setup (as opposed to Ubuntu on my laptop) that may have been part of the problem.

I used the command git diff > PATCH_FILENAME.patch... That's probably the biggest problem.

I need practice!!!

Dunno if this issue or IRC or Skype is the right place to talk about patching. Lemme know what you think.

Thanks!

mgifford’s picture

anandkp’s picture

@everyone...

The latest patch that was re-rolled by @jessebeach has applied successfully. I believe that this issue is only awaiting one final thumbsup from @Jeff Burnz.

I think we can possibly just merge this into core because the final values, though not his preference, were indeed submitted by Jeff. It's unfortunate that the colours will deepen to the point that Bartik isn't as chirpy as it used to be but it does pass WCAG Level AA now which was the objective of this issue.

Shall we merge or wait? Thoughts?

mgifford’s picture

mgifford’s picture

Increased color contrast is on the right.

Bojhan’s picture

Why do we need more contrast on a decorative element?

mgifford’s picture

I don't think that the title & sub-titles should be described as decorative.

Bojhan’s picture

Ah, I thought it was about the difference between the top and bottom. I'd vote for going significantly darker with all of it here, we shouldn't make the gradient stronger.

mgifford’s picture

@Bojhan Can you give me some hex numbers to work with? What is significantly darker?

Jeff Burnz’s picture

Darker is OK, it may loose that chirpy feel anandps mentions, which is kind of nice about Bartik, definite preference to passing the WCAG requirements, maybe something like:

-moz-linear-gradient(center top , #055A8E 0%, #1D84C3 100%)

mgifford’s picture

So like this:
Darger blue with more contrast

It works for me.. The new blue meets WCAG on large fonts so we're good there.

Status: Needs review » Needs work

The last submitted patch, 41: bartik-color-contrast-2125621-41.patch, failed testing.

Bojhan’s picture

What about the slogan?

mgifford’s picture

Status: Needs work » Needs review
FileSize
1.84 KB
20.74 KB

I like Jeff's better.... But this has both the light & dark comply. #1971a7 complies...
big navy blue

Thanks Bojhan, I forgot about the slogan. I often don't use them.

Status: Needs review » Needs work

The last submitted patch, 44: bartik-color-contrast-2125621-44.patch, failed testing.

mgifford’s picture

The last submitted patch, 44: bartik-color-contrast-2125621-44.patch, failed testing.

crasx’s picture

The last submitted patch, 44: bartik-color-contrast-2125621-44.patch, failed testing.

davidhernandez’s picture

Status: Needs work » Needs review
FileSize
1.84 KB

Tests failed because there was a mix of case in the hex values changed.

wheatpenny’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
10.72 KB
11.07 KB

davidhernandez's patch worked for me. The text is clearer after the patch because of the darker blue.

Pre patch:

Post patch:

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed cdf25d7 and pushed to 8.x. Thanks!

  • Commit cdf25d7 on 8.x by alexpott:
    Issue #2125621 by anandps, mgifford, davidhernandez, jessebeach,...
tim.plunkett’s picture

What an awful visual regression. :(

I can no longer see a gradient at all, and it's much darker.

Might as well rename Blue Lagoon, this isn't even close to the original design.

mgifford’s picture

The gradient doesn't meet WCAG 2.0 AA color contrast guidelines. It's been a long thread. Realize that the gradient isn't really very visible, but the original design wasn't vetted for accessibility.

RainbowArray’s picture

The original color scheme had #0779bf as the top color and #48a9e4 as the bottom color.

The standard for AA compliance is a contrast ratio of 4.5:1 for normal-sized text and 3:1 for large text.

The contrast ratio for #0779bf is 4.67:1.

The contrast ratio for #48a9e4 is 2.6:1.

The top color would be sufficient contrast even for the slogan, which would be classified as normal-sized text. There's even a little room so that even if the slogan extends into a bit of gradient, it would still pass.

So all that was needed here was to push the color stop for the gradient a bit further down the page, and perhaps pull up the color stop of the lighter color to provide a similar level of contrast from top to bottom. That would have allowed for a similar look and feel, but improved accessibility.

The solution that was chosen results in a color of #115986 next to the slogan. That's a color ratio of 7.5:1, far in excess of what's necessary for AA compliance.

That results in a much darker design and a different look and feel than what was designed for Bartik. That's not a minor matter. That's a decision that impacts the out of the box branding for all of Drupal.

It's really important for people to know that accessibility does not mean bad design. You can create great-looking designs and still be accessible. Telling people, yes Bartik now looks dark and dingy, but hey, it's more accessible is counter to the positive message about accessibility and design going hand in hand.

This change should be reverted, and a different solution chosen that doesn't have such a drastic impact on the look and feel of Bartik. Changing the color stops on the gradient is a simple change that would accomplish that.

tim.plunkett’s picture

Status: Fixed » Needs work

Reopening per #56.

mgifford’s picture

@mdrummond - Please re-roll an alternate patch and include a screenshot.

This is a great Chrome extension for testing contrast with gradients & transparent CSS - https://chrome.google.com/webstore/detail/color-contrast-analyzer/dagdlc...

RainbowArray’s picture

@mgifford I probably don't have the time today to re-roll the patch, figure out the appropriate color stops, test the design, set up the screenshots, etc. In the meantime this change should probably be reverted until a new solution is figured out.

Thanks for your work on an important accessibility issue. I just think there are other approaches that could be used that would achieve the same goal.

tim.plunkett’s picture

Title: drupala11y.org finds two new color contrast issues » REVERT NEEDED: drupala11y.org finds two new color contrast issues
Status: Needs work » Reviewed & tested by the community
webchick’s picture

I hadn't installed Drupal 8 in a couple of days and then got pinged about this issue on IRC so tried it on simplytest.me. The visual difference is definitely quite stark (ha, see what I did there?), and although this sat at RTBC for a number of days, it doesn't look like there was a ton of review on the visual impact of the branding change, only on whether or not the accessibility bug was fixed. I echo others' sentiments that it's great that the accessibility bug is fixed, and I definitely don't want to quash the obvious enthusiasm here, but this patch seems to have introduced a couple of pretty big visual regressions:

1) The gradient that was previously in the design is almost entirely imperceptible now (although I can Firebug the CSS to see it's there, I can't see it with my eyes). I get that the original gradient wasn't designed with a11y in mind, but it nevertheless feels like a pretty fundamental part of Bartik's design.

2) The color got way, way darker, but yet not the same color as the installer background so it's inconsistent.

I'm a bit confused, because the original "after" screenshots in e.g. #3 didn't have nearly this sort of strong visual impact on the design, and I had imagined we'd end up with something like that. It seems like Marc (and Jeff?) suggests the same thing above. Marc also pointed out in IRC that the current contrast ratio is AAA, and there was some confusion over whether AAA or merely AA was sufficient here. Both https://drupal.org/core-gates#accessibility and https://drupal.org/node/2208413 imply AA is sufficient, which should give a lot more options.

So I'm also in favor of a revert, at least for now, with the path to commit it again being:

a) Pursue options around keeping "about" the same visual look and feel, but tightening up the contrast.

b) If that is deemed impossible, bring the colors inline with the installer so at least it's consistent.

c) Let's get sign off this time by Bartik maintainer (which AFAIK would be Jeff Burnz, who's also an accessibility guy so that works well :)) or failing that another person with "design chops," as well as someone from the UX team (looks like Bojhan's been involved) before marking RTBC. If it's as serious a visual change as the patch that was committed, it might need Dries's sign-off as well, since it's a fundamental branding change of the product itself.

So for now, reverted this patch but very supportive of it coming back in a different form as outlined above.

  • Commit 5f6ca54 on 8.x by webchick:
    Revert "Issue #2125621 by anandps, mgifford, davidhernandez, jessebeach...
webchick’s picture

Title: REVERT NEEDED: drupala11y.org finds two new color contrast issues » drupala11y.org finds two new color contrast issues
Status: Reviewed & tested by the community » Needs work
RainbowArray’s picture

Thanks for the revert, and for the good comments.

Another option that came up in IRC that we might want to look at is switching to the colors used on the installer page.

Dark color on gradient: #106193
Light color on gradient: #1788CF

This is a darker color scheme, but one that is more in keeping with the branding colors. The light color doesn't pass AA, but I'd bet that the point at which the slogan appears would.

Install used a radial gradient rather than a linear one, and I don't think we'd want to switch to that.

It also might work to just move the color stop on the original top color.

Could be worth trying a couple of options here.

tim.plunkett’s picture

Can we also get a better issue title that actually describes the colors we're changing?
That would have helped attract more attention to this sooner (like "We're changing Bartik's blue!").

Also I'm not sure about #106193 and #1788CF, those don't appear in the code base anywhere.
But let's find the actual values and try them.

Bojhan’s picture

This issue kinda shows how a lacking style guide, makes for very hard to resolve issues. I understand the revert, but the solution is unclear.

I doubt we will get any closer to a color, that doesn't end up making the gradient very hard. I welcome alternatives, but we might need to look in the direction of adding another bar behind the logo and slogan in order to meet A11Y.

Keep in mind that the installer style never had to account for a11y because its merely a background no text is placed against it. This was an intentional decision.

Bojhan’s picture

Title: drupala11y.org finds two new color contrast issues » Contrast between title/slogan and header is too low

I've retitled the issue, this seems more accurate and clear. I am not into gaining more uninformed opinions on colors, so this should be fine.

Jeff Burnz’s picture

I may have said darker was OK (#40) but not like this - thank-you for reverting this.

I believe the gradient I suggested in #40 is just about perfect, I am sure I tested this and it passed the requirements. The important thing here is that I am not chaining the look and feel, I spent quite some time on those hex values.

You can try the installer colors, however the darker hex value has 3 times as much red in them as the original and this is what I have tried to steer away from - rather keeping to the original RGB values. The difference is 0.10 L (luminance) and that is all. yes it dulls it down a tad, but it works IMO and keeps very much the same feel overall and almost the same gradient.

@mdrummond re #56 - see comment #4, precisely what I originally proposed. We tried to make this work, but it kind of obliterated the gradient a bit too much, it could work with some messing about with different luminance values over the original RGB. I avoided that discussion to avoid this issue getting to 200 comments without agreement.

@67, precisely, this is a contrast issue, so lets alter the contrast - not the hue - which is pretty much what I have been saying the whole time.

mgifford’s picture

mgifford’s picture

#41 has @Jeff Burnz's suggestion, but as @Bojhan mentioned, in #43, it wasn't tested with the slogan. I thought I'd done that, but it seems to be fine here:

#44 is a bit darker:

There was no effort I know to address anything other than the contrast in this issue.

The last submitted patch, 41: bartik-color-contrast-2125621-41.patch, failed testing.

davidhernandez’s picture

I also ran through the contrast checkers for the values in #40 and got the same results as mgifford. Everything I sampled near text passed for AA. I also did the colors from the installer CSS, and those passed, though Jeff prefers #40. That patch will probably fail testing due to the same case-sensitivity issue. If it does I can upload another patch.

mgifford’s picture

@davidhernandez - that would be great, please do.

davidhernandez’s picture

Status: Needs work » Needs review
FileSize
1.84 KB
mgifford’s picture

Definitely more of a gradient visible with that last patch. It's up here for the next 3 hrs http://sdedc7b9b378b80a.s2.simplytest.me/

RainbowArray’s picture

I think the new version looks a lot better. Same hue, visible gradient. Yes, it's darker, but it's in keeping with the previous visual style.

Would be good to get Jeff Burnz's sign-off before we RTBC this, but this is a good improvement. Thanks!

webchick’s picture

Screenshot please?

davidhernandez’s picture

FileSize
225.68 KB

davidhernandez’s picture

Are there any further objections to this? The color in the last patch passes the contrast test, and is based on Jeff's suggestion.

star-szr’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
16.17 KB
16.14 KB

Sometimes issues just need a bump :)

Here are before and after screenshots:

Before:

After:

star-szr’s picture

FileSize
19.01 KB

And this more clearly shows the difference between #50 and #74:

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Awesome, this looks much better now. Thanks so much for the screenshots to show the difference.

Committed and pushed to 8.x. Thanks!

  • webchick committed 9e7f617 on 8.x
    Issue #2125621 by davidhernandez, mgifford, jessebeach, mparker17,...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.