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 custom grade intervals #1

Closed
darekkay opened this issue Sep 27, 2020 · 2 comments
Closed

Support custom grade intervals #1

darekkay opened this issue Sep 27, 2020 · 2 comments
Labels
good first issue Good for newcomers Type: Enhancement New feature or request

Comments

@darekkay
Copy link
Owner

darekkay commented Sep 27, 2020

Currently, the color grade format has to be between 0 and 100 (e.g. white-0, green-10, green-50, green-90, black-100). Some palettes use different grade intervals, e.g.:

A custom grade interval structure should be supported within a11y-contrast to support those use cases. This should be either configurable or automatically detected and applied.

Starting point: https://github.com/darekkay/a11y-contrast/blob/master/src/index.js#L47

@darekkay darekkay added Type: Enhancement New feature or request good first issue Good for newcomers labels Sep 27, 2020
@darekkay darekkay changed the title Support other grade intervals Support custom grade intervals Sep 27, 2020
@frankstallone
Copy link

Adding to this. I only found out about this idea of using specific numbers to align to some system. I created ours based on 100 - 1000. Recently, we needed two darker neutral colors, so I created a neutral-1100, and neutral-1200. I would have to create a whole separate palette to conform to this proposed color grade format, and map it to what we have already. We use SASS but this would still be a mess.

darekkay added a commit that referenced this issue Feb 3, 2024
Derive color scale from the color palette. Update example palettes.
darekkay added a commit that referenced this issue Feb 3, 2024
Derive color scale from the color palette. Update example palettes.
@darekkay
Copy link
Owner Author

darekkay commented Feb 3, 2024

Implemented in version 3.0.0! Any custom grade system is now supported. The example folder includes Radix UI palettes with a range between 1 and 12.

@darekkay darekkay closed this as completed Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants