Repository navigation
Conversation
| --wp-admin-theme-color: #{$color-primary}; | ||
| --wp-admin-theme-color--rgb: #{hex-to-rgb($color-primary)}; | ||
|
|
||
| // Lighter shades. |
There was a problem hiding this comment.
I'm thinking, the easier path forward would be to use rgba(var(--wp-admin-theme-color--rgb), 0.08) directly.
Example:
--wp-admin-theme-color-opaque-04:rgba(var(--wp-admin-theme-color--rgb), 0.04);
--wp-admin-theme-color-opaque-08:rgba(var(--wp-admin-theme-color--rgb), 0.08);This means no color changes, but the vars are a bit clunky.
|
Size Change: +3.26 kB (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 1790cc3. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7719860858
|
|
cc @SaxonF since this may be captured by the Theme package work. |
Thanks for the link. Looks promising. I wouldn't want to introduce any new CSS vars here if they're going to create hurdles for a wider refactor. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @jameskoster. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. Core SVNIf you're a Core Committer, use this list when committing to GitHub Merge commitsIf you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
What?
This is an experiment to replace (and standardize) adhoc admin color rgba "variations" with solid admin colors.
Example, replacing
rgba(var(--wp-admin-theme-color--rgb), ${ alpha_value } )withvar(--wp-admin-theme-color-lighter-${ lighten_value })Note
It's difficult to get exact matches of current
rgbavariations using SASS'slightenfunction. Notice how thergbacolors are greyer. This PR opts for thelightenfunction to complement thedarkencolor set, by assuming that the color palette will be more uniform.Where
--wp-admin-theme-color--rgb === 0, 124, 186:rgba(0, 124, 186, 0.08)rgb(242, 251, 255)rgba(0, 124, 186, 0.04)rgb(247, 252, 255)Example output:
Why?
To rein in random admin color alpha-variants, and allow better control over the color palette, color contrast ratios etc.
See related comments in:
How?
Use SASS's
lightenfunction to create admin-color CSS vars.Testing Instructions
Compare trunk with this branch for components that have changed:
In action:
Before
before.mp4
After
after.mp4