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

refactor(color): update color function to work with named colors #367

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

simeonoff
Copy link
Contributor

@simeonoff simeonoff commented Dec 10, 2024

Closes #362

The color function will not work with named colors for keys in a palette. This PR fixes that so an expression like color($palette, gray, 200) can still work with palettes where the gray variants are keyed to a string.

This PR DOES NOT fix the underlying issue. Handcrafted palettes should define the keys in the map as strings explicitly, as keys that match named colors will be of type color and will not match map.get calls for strings.

We should make sure this is explained in the docs.

The color function will not work with named colors for keys in a
palette. This PR fixes that so an expression like `color($palette, gray,
200)` can still work with palettes where the `gray` variants are keyed
to a string.
desig9stein
desig9stein previously approved these changes Dec 10, 2024
@desig9stein desig9stein added the ✅ status: verified Applies to PRs that have passed manual verification label Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
palettes version: 14.3.x ✅ status: verified Applies to PRs that have passed manual verification
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handmade color palettes throw an error with unquoted keys
2 participants