Skip to content

Conversation

dz4k
Copy link
Collaborator

@dz4k dz4k commented Aug 21, 2024

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 --bg and --fg are 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-10 etc)? These were never documented and only meant for internal use, but some people might be depending on them.

@dz4k dz4k changed the title Compute color variables usi Compute color variables using relative color syntax Aug 21, 2024
@geoffrey-eisenbarth
Copy link
Collaborator

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.

@geoffrey-eisenbarth
Copy link
Collaborator

geoffrey-eisenbarth commented Aug 21, 2024

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

@dz4k
Copy link
Collaborator Author

dz4k commented May 11, 2025

it seems like many browsers have glitches around the combination of light-dark() and relative color syntax

@dz4k dz4k added blocked:platform Waiting for new web platform features to stabilize blocked:breakage This change breaks the public API and we need to decide how to do that labels May 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked:breakage This change breaks the public API and we need to decide how to do that blocked:platform Waiting for new web platform features to stabilize
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants