Skip to content
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

Compute color variables using relative color syntax #62

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

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

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants