-
Notifications
You must be signed in to change notification settings - Fork 12
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
Color System: A Wonderful World of Color #19
Comments
(⊃。•́‿•̀。)⊃━☆゚.*・。゚ For WordPress and the block editor usage specifically, we have intentionally moved away from having multiple shades of each color, and even colors in total, for a number of reasons:
There are efforts underway in https://core.trac.wordpress.org/ticket/49999 to revisit wp-admin color schemes. That's an opportunity to look at a rainbow of spot colors and a limited set of grays to go with those. That could very much help inform the needs for a more elaborate color system. And it's a good point to discuss whether such a system should have a "red-300" and a "purple-700" if they end up never being used in the interface. |
🤗 Thank you for your insight!!
That's a good point. I've personally only used 1-3 shades from a typical collection of I just made an update that removes 200, 400, 600, and 800. Each colour has been reduced from 9 to 5. With the current system, 4/5 of them are being used for colour computation.
We can still trim them if needed :). For the most part, the component layer will use things like |
Fast response times in this repo! 5 shades in my personal opinion seems far more reasonable! More importantly (and something that I'm perhaps just realizing now) is that there's a component-technical aspect to this in that it's nice it can handle a system of colors, any color set, that clients can use, and in that vein the fast tweak to the system feels promising. Looking at this from a WordPress/Gutenberg lens, most of these colors would need tweaking or adjustment and perhaps even further reduction/changing (neutral gray, the right shade of blue etc) — but that feedback is probably worth not addressing here, but rather a bridge to cross if this were to be adopted at one point. |
Closing this up! The color system seems to be holding up well. |
(Expanding on this post: #12)
Check out the Story:
https://g2-components.xyz/?path=/story/references--colors
Base Palette
I've started establishing a base color palette within the core style system. The palette has the following colours:
(The values of these colours were derived from WP Admin / Gutenberg).
From that, I've established a spectrum between
100
(lightest) to900
(darkest) for each color.Complementary Text Color
Based on the
100...900
colors, the color system also generates a complementary text color, optimized for readability.For example,
blue500
will have ablue500Text
value.RGBA
For each color, the system also generates a range of RGBA values between alpha
10
(0.1
) to90
(0.9
).Backgrounds
For each color, a set of
background
and backgroundText` have been created with certain colors receiving special treatment for improved color blindness support. These values offer a "bold" variant where the color is stronger. All background + backgroundText values have dark mode supported adjustments.CSS Variables (
get
and mixins)FINALLY! All of this stuff is compiled into a list of CSS variables:
Within the library, these variables can be accessed with the
get()
function from@wp-g2/styles
The most common use-cases would be to use colours as backgrounds or text colors (rather than using color grade values like
red500
).An example of this would look like:
It is recommended that
getBackgroundColor
andgetBackgroundColorText
mixins are used instead, as these have color-blind support built into them.The complete picture
There are multiple parts within the system that work in concert to create simple and cohesive experience when it comes to using colors.
get
or mixins)Point
#1
-#6
are all at the core system level.Point
#7
would be where most devs/designers will be working with colors.The text was updated successfully, but these errors were encountered: