Child of #3217923: [Plan] Organize and refactor CSS color variables for Olivero

Problem

Olivero's colors naming is all over the place.

  • Primary colors are namespaced --blue. We will switch this to --primary
  • There are duplicate or extremely similar colors in both the primary and gray palettes. We will consolidate these.
  • The number at the end of the colors does not always indicate its luminosity. We will change this value to reflect its luminosity (round it up to the nearest 5th)

For example, --color--blue-20 will correspond to hsl(202, 79%, 38%). This means that its updated variable name can be something like --color--primary-40.

Plan

I worked with Olivero designer @jwitkowski79 to create this plan to rename and consolidate the colors:

Primary colors:

--color--blue-10 (luminosity 32%) 👉 --color--primary-30
--color--blue-20 (luminosity 38%) 👉 --color--primary-40
--color--blue-30 (luminosity 50%) 👉 --color--primary-50 (deleting this - duplicate color variable)
--color--blue-50 (luminosity 50%) 👉 --color--primary-50
--color--blue-70 (luminosity 62%) 👉 --color--primary-60
--color--blue-90 (luminosity 93%) 👉 not used (remove it)

Grays

--color--gray-0 (luminosity 6%) 👉 --color--gray-5 (this will be consolidated to --color--gray-5)
--color--gray-5 (luminosity 5%) 👉 --color--gray-5 (no change)
--color--gray-8 (luminosity 11%) 👉 --color--gray-10 
--color--gray-10 (luminosity 20%) 👉 --color--gray-20 
--color--gray-20 (luminosity 44%) 👉 --color--gray-45 (deleting this and consolidating to --color--gray-45)
--color--gray-25 (luminosity 44%) 👉 --color--gray-45
--color--gray-28 (luminosity 55%) 👉 --color--gray-60 (deleting this and consolidating to --color--gray-60)
--color--gray-30 (luminosity 57%) 👉 --color--gray-60
--color--gray-40 (luminosity 66%) 👉 --color--gray-65 (deleting this and consolidating to --color--gray-65)
--color--gray-45 (luminosity 72%) 👉 --color--gray-70
--color--gray-50 (luminosity 63%) 👉 --color--gray-65
--color--gray-70 (luminosity 88%) 👉 --color--gray-90
--color--gray-75 (luminosity 89%) 👉 --color--gray-90 (deleting this and consolidating to --color--gray-90)
--color--gray-80 (luminosity 93%) 👉 --color--gray-95
--color--gray-90 (luminosity 96%) 👉 --color--gray-100 (deleting this and consolidating to --color--gray-100)
--color--gray-95 (luminosity 97%) 👉 --color--gray-100

Testing instructions

There should be no visual changes with this patch. Basically, you'll need to look through the site and make sure that nothing has changed :)

You can find Tugboat previews to compare at:

Issue fork drupal-3217926

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:

  • 3217926-2 Comparecompare
  • 3217926-olivero-rename-blue Comparecompare

Comments

mherchel created an issue. See original summary.

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

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

mherchel’s picture

mherchel’s picture

Version: 9.4.x-dev » 10.0.x-dev

💩. Opened up the branch against 9.4. This needs to be 10.0.x

mherchel’s picture

This MR system is really sucking for me right now. Switching back to patches for this issue.

mherchel’s picture

Title: Olivero Rename blue name-spaced variables to primary, and rename numbers to correspond with luminosity » Olivero: Rename and consolidate all color CSS variable names.
Issue summary: View changes

I had a meeting with @jwitkowski79, and we created a plan. Updating summary.

mherchel’s picture

Issue summary: View changes
jwitkowski79’s picture

@mherchel, in the list above, I noticed that --color--gray-20 and --color--gray-25 are the same color. I think we had agreed to remove --color--gray-20

mherchel’s picture

Issue summary: View changes

Yep! They were mapped properly, I just missed adding the "deleting this.." comment. Fixed!

jwitkowski79’s picture

@mherchel All set! This looks good.

mherchel’s picture

Status: Active » Needs review
StatusFileSize
new114.58 KB
mherchel’s picture

Issue summary: View changes

Adding testing instructions to summary

andy-blum’s picture

Status: Needs review » Reviewed & tested by the community

Went through all .pcss.css files and the re-namings seem correct, .css files didn't yield any additional changes when I rebuilt them, so I assume they're good as well. The only comment I'd add is that the comment above defining the --color--primary-X variables we're still calling it "blue colors". Should we refer to it as "Theme primary colors" instead?

mherchel’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new114.62 KB
new976 bytes

D'oh! You're 100% correct. New patch and interdiff attached! Thank you!

andy-blum’s picture

Status: Needs review » Needs work
StatusFileSize
new381.97 KB

Do we need the color names in comments here? The seem unnecessary at best now that our variable names are a little more semantic, and switching back and forth between gray and black, as well as continuing to use "blue" here seems like it could lead to confusion.

mherchel’s picture

Status: Needs work » Needs review

I would say yes. Right now they're in use within the Figma docs, and they help me reconcile the two colors.

That being said, these will likely change or be removed with the work from #3257284: Create designs for secondary color for Olivero

andy-blum’s picture

Status: Needs review » Reviewed & tested by the community

In that case everything else seems in order. RTBC.

mherchel’s picture

  • lauriii committed fc00e0c on 10.0.x
    Issue #3217926 by mherchel, andy-blum, jwitkowski79: Olivero: Rename and...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Committed fc00e0c and pushed to 10.0.x. Thanks!

Status: Fixed » Closed (fixed)

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