-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Try/admin color lighten colors #58481
Conversation
@@ -428,6 +428,14 @@ | |||
// Hexadecimal css vars do not work in the rgba function. | |||
--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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
rgba
variations using SASS'slighten
function. Notice how thergba
colors are greyer. This PR opts for thelighten
function to complement thedarken
color 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
lighten
function 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