Compute color variables using relative color syntax
Relative color syntax is supported on every browser I personally care about (except Firefox Android), so this seems like a pretty good time to start experimenting.
In this PR, the whole color palette is derived from a single variable (--base-accent).
The PR changes the programmatic interface of missing.css, so we either need to find a way to not do that, or make a version 2.0.
Some considerations:
- Things like
--bgand--fgare computed from the accent color, but the effect is basically imperceptible. Should we make it more or less prominent?- Could we have a variable that determines the overall "colorfulness" of the page?
- For colorways (
info ok warn bad), the hue is currently not affected by the accent color (only lightness and chromaticity). Is there some color theory magic we can do to generate colorways that are harmonious with the accent, and also avoid clashes? - How do we ensure good contrast? Is it OK to leave it to the user ("if you customize the accent, make sure to test the color contrast")?
- Should we remove the Colar color swatches (
--blue-10etc)? These were never documented and only meant for internal use, but some people might be depending on them.
I hope to chime in more later, but for now I'll say that I like the idea of having a variable that determines the overall "colorfulness" of the page, something that is implemented akin to --density, with helper classes (.packed, ..., .airy).
Perhaps something that could be implemented with adjectives such as "bright,", "vivid", "drab," "iridescent" etc (or any of the other Google search results for "adjectives describing color").
Although, while density is something most developers would want granular control over, perhaps "colorfulness" is more of a "one size fits all" once the value is set.
Also, re: 2.0, if this PR does end up requiring a version increase, do you have a wishlist of components you'd like to see implemented in 2.0 as well?
Edit: v2 roadmap has begun here: https://cloud.dz4k.dev/s/mznkdLLiLnf27HE
it seems like many browsers have glitches around the combination of light-dark() and relative color syntax