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

Support for wider color gamuts #62

Closed
kevmodrome opened this issue Feb 4, 2022 · 5 comments
Closed

Support for wider color gamuts #62

kevmodrome opened this issue Feb 4, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@kevmodrome
Copy link

Safari supports eye-popping colors using the the color() function. I wonder if it'd be neat to maybe add support for this with graceful fallback to regular old hex/hsl.

I have successfully used this on the Svelte Summit website and I think the result is pretty nice. You can see the difference by visiting on Chrome vs Safari.

It would be as simple as figuring out what colors that would be nice to have and then just adding support via something like this (example taken from the WebKit explainer page):

:root {
    --bright-green: rgb(0, 255, 0);
}

/* Display-P3 color, when supported. */
@supports (color: color(display-p3 1 1 1)) {
    :root {
        --bright-green: color(display-p3 0 1 0);
    }
}

Another idea is to support the lch() and lab() functions.

Here's a site where you can compare between the two - you need to use Safar on a Mac or iPhone to see differences.

@madeleineostoja
Copy link
Contributor

Like the idea! It would be complex to add only because mapping config → variables is currently 1:1 with no support for queries. Adding that kind of support would also open up responsive variables generated straight from config which is something I’ve been thinking about.

I can’t think of an elegant API for it off the top of my head, but def open to discussion/proposals for a generic solution to both.

@madeleineostoja madeleineostoja added the enhancement New feature or request label Feb 4, 2022
@madeleineostoja
Copy link
Contributor

Opened a new issue at #63 to track the wider support for queries this would need

@kevmodrome
Copy link
Author

Ah, I hadn't realised there was a mroe complicated build process under the hood here. I really just thought it was a straight up css file, my bad! 🤦

@madeleineostoja
Copy link
Contributor

Oh yeah it was originally, but Pollen now has an optional config driven build step (and a default CSS file generated from it) so you can generate your own custom design systems

@madeleineostoja
Copy link
Contributor

Closed by 458389e

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

No branches or pull requests

2 participants