Problem/Motivation

Right now we have a limited amount of greys on the design system and they don't have enough middle steps for some situations. Also, some of them have a different tone due to the grow of the design system.

Proposed resolution

Update the gray names here, so we end up with a gray-based scale name. But keeping the same color we have right now that have already been tested. The colors won't set exactly into the 100 scale, but will be close enough:

--color-gray: #232429; /* Same */
--color-gray-900: #393A3F; /* New */
--color-gray-800: #55565B; /* Davi's Grey */
--color-gray-700: #75767B; /* Moiety */
--color-gray-600: #828388; /* Old Silver */
--color-gray-500: #919297; /* Gray Blue */
--color-gray-400: #ADAEB3; /* Gravity */
--color-gray-300: #C1C2C7; /* Seashell */
--color-gray-200: #D3D4D9; /* Light Gray */
--color-gray-100: #DEDFE4; /* Light Diamond */
--color-gray-050: #F3F4F9; /* White Smoke */
--color-gray-025: #F9FAFF; /* White Smoke Light */

When this is in place, the correct values will be updated in #3123811: Grey text in Claro theme failed accessibility, which is the one that should fix the accessibility issues with gray.

Link to Figma specs: https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/Drupal-Design-system...

Remaining tasks

  • Define new color values
  • Update color values
  • Replace existing colors
  • Change variable names

User interface changes

All grey colors will change.

Release notes snippet

CommentFileSizeAuthor
#49 gray-overlay.png229.33 KBckrina
#49 gray-form-boolean.png178.8 KBckrina
#49 gray-claro-details.png117.77 KBckrina
#49 gray-button.png155.64 KBckrina
#49 gray-breadcrumb.png51.95 KBckrina
#49 gray-action-link.png127.46 KBckrina
#49 gra-file-size.png98.08 KBckrina
#45 3154539-45.patch59.97 KBpaulocs
#45 interdiff-44-45.txt393 bytespaulocs
#44 3154539-44.patch59.97 KBbnjmnm
#43 Captura de Pantalla 2021-06-30 a la(s) 17.28.17.png86.55 KBjavi-er
#26 new-gray-naming.png74.13 KBckrina
#24 3154539-24-REROLL.patch32.25 KBbnjmnm
#23 interdiff_21-23.txt29.59 KBbnjmnm
#23 3154539-23.patch32.3 KBbnjmnm
#23 interdiff_21-23.txt29.59 KBbnjmnm
#23 3154539-23.patch32.3 KBbnjmnm
#21 reroll_diff_19-21.txt1.96 KBMeenakshiG
#21 3154539-21.patch2.71 KBMeenakshiG
#19 interdiff_13-19.txt1.76 KBkiran.kadam911
#19 3154539-19.patch2.73 KBkiran.kadam911
#17 Disabled Test.jpg100.94 KBsaschaeggi
#15 color-palette.png53.44 KBsd9121
#13 interdiff_7-13.txt677 byteskiran.kadam911
#13 grey-scale-3154539-13.patch3.02 KBkiran.kadam911
#7 grey-scale-3154539-7.patch3.05 KBkiran.kadam911
#5 grey-scale-3154539-5.patch2.86 KBkiran.kadam911
grey-scale.png32.74 KBckrina

Issue fork drupal-3154539

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ckrina created an issue. See original summary.

saschaeggi’s picture

Issue summary: View changes
saschaeggi’s picture

Colors are updated in the Drupal Design System (including Colors Library & Claro in Figma): https://www.figma.com/file/OqWgzAluHtsOd5uwm1lubFeH/Drupal-Design-system...

kiran.kadam911’s picture

Assigned: Unassigned » kiran.kadam911
Status: Active » Needs work
kiran.kadam911’s picture

Assigned: kiran.kadam911 » Unassigned
Status: Needs work » Needs review
FileSize
2.86 KB

Kindly review the attached patch.

Thanks!

sd9121’s picture

Assigned: Unassigned » sd9121
kiran.kadam911’s picture

Sorry, I missed one variable to update. Kindly review the new updated patch.

Thanks!

jwilson3’s picture

  1. +++ b/core/themes/claro/css/base/variables.pcss.css
    @@ -4,25 +4,29 @@
    -  --color-lightgray: #d4d4d8;
    +  --color-lightgray: #d3d4d9;
    ...
    -  --color-lightgray-active: #adaeb3; /* 10% darker than base. */
    +  --color-lightgray-active: var(--color-gravity); /* 10% darker than base. */
    

    Regarding the code comment /* 10% darker than base. */It's not clear from this patch that the --color-gravity is in fact 10% darker than base. Base I presume in this case is --color-lightgray (?), in which case seashell is the next color down in the scale, that i'd presume would be 10% apart, but maybe not. ¯\_(ツ)_/¯ I think it makes sense to just remove this code comment (and any other similar ones that can be found related to the gray scales).

     

  2. What would make this patch overall much nicer to maintain and review would be to use HSL colors to more easily confirm that the colors are all in the same Hue and only change in Lightness or Saturation to achieve the correct tone. For instance, a quick run through using a color picker shows that the bottom 4 colors have a hue of 231 while the lighter shades have a hue of 230. Very minor difference, most likely imperceptible to the eye but in the end, it is an annoyance that could be fixed and standardized.

    Given that the contributors on the design side have provided only RGB colors, maybe this is out of scope, but I feel link this is an integral part of building a proper grayscale using more precise intervals and colorspace that is native for the web.

     

  3. Instead of naming color variables that are near to impossible to remember if you need to lighten or darken one, I'd suggest naming the css variables on a numeric scale.

    --color-gray-100
    --color-gray-200
    --color-gray-300
    --color-gray-400
    --color-gray-500
    --color-gray-600
    --color-gray-700
    --color-gray-800
    --color-gray-900
    --color-text
    

    You put the 100 level scale there to allow for future expansion if it were ever needed. This would vastly improve themers experience, maybe designers too.

    Of the 11 design systems I checked, 8 of them standardize around a decimal system for their neutral color variables.

    The 3 design systems that I looked at that broke from this trend were:

    It is clear that the reason these outliers do not use a decimal system is because they don't have a complete grayscale, but only offer a few select neutral tones. Because we're adding several more grays here, it makes sense to switch to a decimal system.

     

  4. It probably makes sense to standardize on one single spelling of the word gray in the color variables. I see "lightgray" and "davysgrey" as two color names. This issue also makes a similar problem (the issue title says "gray" but the description uses "grey" in several places). Gray is the American spelling and therefore the recommended spelling because there is precedence in core standardizing on American spellings.

    I've filed a follow-up issue for this where the topic can be hashed out in the wider community, since the problem affects all of Drupal, not just this theme. #3155258: Use American English spelling of "gray"

     

sd9121’s picture

Assigned: sd9121 » Unassigned
jwilson3’s picture

Status: Needs review » Needs work
saschaeggi’s picture

Answers to @jwilson3 points:

  1. As the comment is outdated it can be removed
  2. Not in the scope of this ticket
  3. Very good idea, I've created a follow-up ticket for this #3155531: Naming convention of color shades in the Drupal Design System (e.g. for Claro), not in the scope of this ticket though
  4. You already created a follow-up ticket, thanks
kiran.kadam911’s picture

Assigned: Unassigned » kiran.kadam911
kiran.kadam911’s picture

Assigned: kiran.kadam911 » Unassigned
Status: Needs work » Needs review
FileSize
3.02 KB
677 bytes

Thank you @saschaeggi for your reply on #8 and As per your reply #11 patch is updated, Kindly review the attached patch.

Thanks!

sd9121’s picture

Assigned: Unassigned » sd9121
sd9121’s picture

Assigned: sd9121 » Unassigned
Status: Needs review » Reviewed & tested by the community
FileSize
53.44 KB

@kiran.kadam911,

I have reviewed your patch and it looks good to me.

Screenshot for reference:

color palette

Thanks!

bnjmnm’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs issue summary update
  1. +++ b/core/themes/claro/css/base/variables.pcss.css
    @@ -134,14 +138,14 @@
    -  --button--disabled-fg-color: var(--color-grayblue);
    +  --button--disabled-fg-color: var(--color-moiety);
       --button-fg-color--primary: var(--color-white);
       --button-bg-color--primary: var(--color-absolutezero);
       --button--hover-bg-color--primary: var(--color-absolutezero-hover);
       --button--active-bg-color--primary: var(--color-absolutezero-active);
       --button--focus-bg-color--primary: var(--button-bg-color--primary);
       --button--disabled-bg-color--primary: var(--color-lightgray);
    -  --button--disabled-fg-color--primary: var(--color-oldsilver);
    +  --button--disabled-fg-color--primary: var(--color-moiety);
    

    The disabled color for button will likely be different than the disabled color for an input. This is because inputs will be on a white background, but the button text is on top of the button's background color. This could either be decided in this issue, or the changes to button color could be removed and addressed in a followup.

  2. +++ b/core/themes/claro/css/base/variables.pcss.css
    @@ -91,7 +95,7 @@
    +  --input--disabled-fg-color: var(--color-moiety);
    

    Figma does say "disabled 4:5.1", for but the issue summary also says "Also it should be discussed which color we should finally use for the disabled elements." and "Decide which color to use for disabled".

    If the decision has been made, that should be made more evident in the issue summary as there's no discussion of it in the comments. If it hasn't, then that needs to happen.

I removed the Figma screenshot from the issue summary as it is outdated and can be confusing when checking multiple colors against the patch.

saschaeggi’s picture

FileSize
100.94 KB

An update on the disabled state front. Cristina & I discussed this today and we decided on the following option:
We decided to use gray-blue for disabled text. We also streamlined it accross elements (see example with input and buttons):

I hope this unblocks this issue.

(Note that this change is currently not everywhere reflected in the design system yet, but it's on our task list to do so)

kiran.kadam911’s picture

Assigned: Unassigned » kiran.kadam911
kiran.kadam911’s picture

Assigned: kiran.kadam911 » Unassigned
Status: Needs work » Needs review
FileSize
2.73 KB
1.76 KB

Thanks @saschaeggi for your reply to go head.

I updated the patch as per #17 with New disabled color(gray blue).

Kindly review the attached patch.

Thanks!

bnjmnm’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

This needs a reroll, also noticed a few things, some may require design input. It's possible some are more suitable for followup issues so I'm open to that.

  1. --input--disabled-bg-color: #f2f2f3; /* Light gray with 0.3 opacity on white bg. */ The color assigned to this variable is not any one of the new grays. I assume it's pretty close to one of them, and should equal that instead of #f2f2f3
  2. Similar to the previous item, I noticed several other variables that are assigned some kind of gray color that isn't an exact match for any of the grays introduced here, although it's possible some may be if converted to hex.
    We should either change these to one of the grays added in this issue, or explicity state that it's OK for them to keep their value despite them adding to the number of grays presented by Claro:
      --color-divider: rgba(142, 146, 156, 0.5);
    
      --input--disabled-color: rgba(84, 85, 96, 0.6); /* Davy's grey with 0.6 opacity. */
    
      --input--disabled-border-color: #bababf; /* Old silver with 0.5 opacity on white bg. */
    
     --details-bg-color: rgba(243, 244, 249, 0.4);
     --details-border-color: rgba(216, 217, 224, 0.8);
      --jui-dropdown-border-color: rgba(216, 217, 224, 0.8); /* Light gray with 0.8 opacity. */
      --jui-dropdown-shadow-color: rgba(34, 35, 48, 0.1); /* Text color with 0.1 opacity. */
    
    

    I suspect some of the rgba ones can stay as-is, but if they can be converted to hex thats better as the color will be consistent regardless of its background

  3. Was keeping --color-lightgray-o-80: rgba(212, 212, 218, 0.8); intentional or should it be replaced by one of the new grays?
  4. +++ b/core/themes/claro/css/base/variables.pcss.css
    @@ -4,25 +4,29 @@
    +  --color-grayblue: #919297;
    +  --color-oldsilver: #828388;
    +  --color-davysgrey: #55565b;
    

    The reroll should include making sure that any instances of "grey" are now "gray", as that change was made in a commit that occurred since the last patch was uploaded.

  5. +++ b/core/themes/claro/css/base/variables.pcss.css
    @@ -4,25 +4,29 @@
    +  --color-moiety: #75767b;
    +  --color-gravity: #adaeb3;
    +  --color-seashell: #c1c2c7;
    +  --color-lightdiamond: #dedfe4;
    

    May as well add these next to the other grays instead of at the end of the list. I considered also suggesting reordering by darkness, but that can happen in the variable renaming issue.

  6. +++ b/core/themes/claro/css/base/variables.pcss.css
    @@ -4,25 +4,29 @@
    -  --color-lightgray-active: #adaeb3; /* 10% darker than base. */
    +  --color-lightgray-active: var(--color-gravity);
    

    Is is actually specified anywhere that --color-gravity should be the value of --color-lightgray-active? It's possible I missed this, but this and the disabled fg/bg colors should be explicitly stated in the issue summary or figma (ideally both but as long as theres a single place to consult it should be fine).

MeenakshiG’s picture

Status: Needs work » Needs review
FileSize
2.71 KB
1.96 KB

Rerolled the patch and implemented 5 and 6.

bnjmnm’s picture

Status: Needs review » Needs work
Issue tags: -Needs reroll
  1. The patch needs to include the compiled CSS. I notice that the patches have only been including variables.pcss.css, but the changes there will significantly impact the compiled CSS and those changes need to be part of the patch. yarn build:css in /core should do it.
  2. Items 1,3,4,7 from #20 still need to be addressed. Will likely require design input. It's possible they'll just say "these grays can stay, they don't have to be part of the new grayscale", but that should be confirmed since the goal of this issue was to reduce the amount of different grays in use.
bnjmnm’s picture

Status: Needs work » Needs review
FileSize
32.3 KB
29.59 KB
32.3 KB
29.59 KB

On the Claro weekly call @ckrina confirmed that items 1,3,4,7 from #20 don't need to be in the scope of this issue.

This has the missing compiled CSS from #21

bnjmnm’s picture

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

ckrina’s picture

Status: Needs review » Needs work
FileSize
74.13 KB

We just discussed this with @lauriii at today's weekly call to find the best way to implement ideas from #3155531: Naming convention of color shades in the Drupal Design System (e.g. for Claro) here. The plan:
1. Update the gray names here, so we end up with a gray-based scale name. But keeping the same color we have right now that have already been tested. The colors won't set exactly into the 100 scale, but will be close enough:

--color-gray: #232429; /* Same */
--color-gray-900: #393A3F; /* New */
--color-gray-800: #55565B; /* Davi's Grey */
--color-gray-700: #75767B; /* Moiety */
--color-gray-600: #828388; /* Old Silver */
--color-gray-500: #919297; /* Gray Blue */
--color-gray-400: #ADAEB3; /* Gravity */
--color-gray-300: #C1C2C7; /* Seashell */
--color-gray-200: #D3D4D9; /* Light Gray */
--color-gray-100: #DEDFE4; /* Light Diamond */
--color-gray-050: #F3F4F9; /* White Smoke */

2. Open a follow-up to update the colors and do a proper accessibility testing revision so we don't introduce a11y regressions, and iterate in there.

This way we can close this stable blocker and fix the accessibility issues it is holding up.

ckrina’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update

Update issue summary.

hansa11 made their first commit to this issue’s fork.

hansa11’s picture

Status: Needs work » Needs review
mgifford’s picture

mgifford’s picture

mgifford’s picture

I think I'm missing something. The changes that I can see which would affect color contrast are just moving from: core/themes/claro/css/base/variables.pcss.css

--color-sunglow-shaded: #c;

to this:
--color-sunglow-shaded: #977405;

These are commented out, right? core/themes/claro/css/base/variables.css

/* Variations. */ /* 5% darker than base. */ /* 10% darker than base. */ /* 10% darker than base. */ /* 20% darker than base. */ /* 5% darker than base. */ /* 10% darker than base. */ /* 5% darker than base. */ /* 10% darker than base. */ /* 5% darker than base. */ /* 10% darker than base. */

/* Variations. */ /* 10% darker than base. */ /* 20% darker than base. */ /* 5% darker than base. */ /* 10% darker than base. */ /* 5% darker than base. */ /* 10% darker than base. */ /* 5% darker than base. */ /* 10% darker than base. */

Most of the changes aren't where I would be expecting them from looking at @bnjmnm's code.

ckrina’s picture

@mgifford this issue is just to implement a new set of variables / a new gray scale and to standardize the design system first. When this is in place, the correct values will be updated in #3123811: Grey text in Claro theme failed accessibility, which is the one that should fix the accessibility issues with gray. Sorry if I didn't explain it properly during the sprints :)

chetanbharambe’s picture

Assigned: Unassigned » chetanbharambe
chetanbharambe’s picture

Assigned: chetanbharambe » Unassigned

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

ckrina’s picture

Status: Needs review » Needs work

Changing to Needs work so there's more visibility.

saschaeggi’s picture

Sounds good to me for using only 025, 050, (potentially 075 in the future) and 100. Keeps things a little bit simpler.

ckrina’s picture

Status: Needs work » Needs review

Moving it back to Needs Review. Let's see if we can fix this one and move forward with all the accessibility issues blocked by this one :)

ckrina’s picture

Issue summary: View changes

Updating issue summary so the scope of this issue is easier to understand.

bradleyfmash’s picture

@ckrina --- If I'm not mistaken you have a PR in for this via this commit right? https://git.drupalcode.org/project/drupal/-/merge_requests/427/diffs#dif...

I can help here if needed, but seems just needs merged?

javi-er’s picture

I took a look to the color names on the merge request and seems right to me now, here's a screenshot with the latest values:

bnjmnm’s picture

I can't get the current MR, or a new branch to be based on 9.3 (perhaps it's just a Gitlab blindspot on my part). This addresses the CI failures in the most recent MR + rerolls to 9.3. I didn't realize I couldn't get this to cooperate with the MR until it's too late, but here are the changes that can hopefully be part of an MR that is against 9.3!

paulocs’s picture

ckrina’s picture

I've just created a new MR to 9.3.x with changes from #45 (thanks @bnjmnm and @paulocs!) plus a new change I realized was missing: the primary --color-text was still using the old gray value, so I've updated with the darker gray from the new gray scale. I've done it in a new commit so its easier to review what I've changed.

Hopefully it's ready now :)

marcusvsouza’s picture

Status: Needs review » Reviewed & tested by the community

The patch in comment #45 correctly changes the css variables names e values.

ckrina’s picture

Here is a list of screenshots to help evaluating the changes:

Overlay

.ui-widget-overlay {
  z-index: 1259;
  opacity: 0.7;
-  background: #222330;
+ background: #232429;
}

Moves background: var(--color-text); from #222330 to #232429:

Radio button

.form-boolean {
  display: inline-block;
  box-sizing: border-box;
  width: 1.125rem;
  height: 1.125rem;
  vertical-align: text-bottom;
-  border: 1px solid #8e929c;
+  border: 1px solid #919297;

Moves var(--input-border-color); from --color-grayblue: #8e929c; to var(--color-gray-500) ( --color-gray-500: #919297;):

Claro details

.claro-details {
  display: block;
  margin-top: 1rem;
  margin-bottom: 1rem;
-  color: #222330;
+ color: #232429;

Moves color from color: var(--color-davysgray); to color: var(--color-gray-800);:

Gray button

.button {
  display: inline-block;
  margin: 1rem 0.75rem 1rem 0; /* LTR */
  padding: calc(1rem - 1px) calc(1.5rem - 1px); /* 1 */
  cursor: pointer;
  text-align: center;
  text-decoration: none;
 - color: #222330;
 + color: #232429;
  border: 1px solid transparent !important;  /* 2 */
  border-radius: 2px;
 - background-color: #d4d4d8;
 + background-color: #d3d4d9;

Changes color: var(--button-fg-color); declaration in variables, that uses var(--color-text) (from #222330 to --color-gray: #232429;; and background-color: var(--button-bg-color); that is replaced by --color-gray-200 (#d3d4d9).

Breadcrumb

.breadcrumb {
  padding: 0;
-  color: #222330;
+  color: #232429;

Uses color: var(--color-text);, changed in variables from #222330 to --color-text: var(--color-gray); (#232429).

Action Link

.action-link {
  display: inline-block;
  padding: 0.75rem 1rem;
  cursor: pointer;
  text-decoration: none;
-  color: #545560;
+  color: #55565b;

Changes color: var(--color-davysgray); to color: var(--color-gray-800); (#55565b):

File

.file__size {
 - color: #545560;
 + color: #55565b;
}

Also changes color: var(--color-davysgray); to color: var(--color-gray-800);(#55565b):

  • lauriii committed ffb4778 on 9.3.x
    Issue #3154539 by bnjmnm, ckrina, kiran.kadam911, hansa11, Meenakshi.g,...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Great work here all! I really like end result of this issue!

Did some manual testing and confirmed did my best to confirm there are no regressions to color contrast as a result of this. Wasn't able to find anything so I think we are ready to proceed with this.

Committed ffb4778 and pushed to 9.3.x. Thanks!

Status: Fixed » Closed (fixed)

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