-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Design system - Colour scales #53612
Comments
Are there plans to integrate Superpal into WordPress? Would be great to have something like this available not only for plugin devs but for theme design and something "AI" theme setup wizards can tap into. An alternative could be a large enough database of colors/scales. I'm kind of a color nerd and during my own research into colors I've landed on 30 hues within an oklab circle (12 steps apart), 12 contrast steps per hue and 6 different saturations (5%, 20% 40%, 60%, 80%, 100%), 2160 "colors" in total. This covers all design intents I can think of. When somebody pastes a RGB Hex color it could be read out as hsl, mapped to one of the 30 hues and 6 saturations, and it work equally well because the circle is dense enough with 30 hues and deep enough with the 6 saturations. Here is the 30 hue okhsv/okhsl circle with each color at its natural peak chroma. The okxxx space also enables a nice even division between cool and warm colors. The visual difference of the cyans manifests at different contrasts, not so much at peak chroma in the circle. Here are the oklch scales in Leonardocolor.io, broken up into 3 links because it would otherwise too big for leonardo to load: The scales are at 100% saturation, but the other saturations can be easily generated with the theme settings next to the blue share button, which also provides an option to export the color values. The contrast/lightness steps are what I use lately, but it's also easy to adjust. |
Inspired by Radix I tried a couple of scales (light and dark mode) that are purely gray and generated using https://hihayk.github.io/scale/. This is very much an initial exploration, not a proposal.
Here's an example of the UI elements this scale could produce: Note: Details like spacing, radius, shadow, and type are naturally related, but not directly relevant to this issue—the focus of which is purely color. Those elements should be explored in separate issues. AliasesIn addition to steps 0, 9, and 10, as described above, aliases may also be needed for things like:
Such needs will become apparent as we investigate other elements of the design system such as the full suite of primitive components, elevation, and so on. As mentioned above this is just an initial exploration. I'd like to try a version using Superpal, but given the scales it generates seem to be very linear I wonder if it might be tricky to apply semantic purpose to each value in a way that works equally well in light and dark modes? I also have a question about how to utilise the accent color – should it be applied sparingly to specific elements like primary buttons like the example here, or should the entire scale be derived from it so that the interface is be 'tinted' instead of purely gray? |
@jameskoster and I have spent some time playing around with this in code the results of which you can see below. color-change.mp4The PR here goes in to more detail so I'd recommend reading if you're interested. Importantly, the work in that PR lays the foundation for better management of admin tokens in general including spacing, fonts, border radius, shadows etc. |
For the record, I've grouped together issues related to "theming" in the dataviews component issue, so they are visible #55083 This one is larger than DataViews but it also impacts it. |
Part of #53322
What problem does this address?
The current Gutenberg colour system has been great for the editor, however we are starting to see the limitations while designing for a dark surface (e.g. site editor). If we want to lean heavily into personalization, support themes including dark, and offer a contrast preference (empowering users to achieve AAA conformance), then we will need to extend the system and take a more programmatic approach.
One of the biggest gaps in our current system is a limited bottom end of the scale. e.g. for component backgrounds, states etc
What is your proposed solution?
We can learn a lot from other systems out there, one of which is Radix colors. One additional piece of complexity is that we'd ideally want to programmatically generate themes based on single colour values. The benefit of a scale like Radix is that "each step was designed for at least one specific use case." This means that you have contrast guidelines built in ("Step 11 is designed for 400 weight text in any size, and guaranteed to work well on a step 3 background. Each test should pass 4.5:1 contrast ratio.")
The good news is that we already have an experimental theme provider in our components package and tools to generate scales based on a single value.
The text was updated successfully, but these errors were encountered: