fix(clerk-js): Fix neutral alpha shades generation #2750
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes an issue in generating alpha shades from a user-provided color.
The value provided for the neutral alpha shades should not be included in the scale.
Before:
Users could provide a single color, a part of the scale, or the whole scale to generate alpha colors. We generated an 50-950 alpha scale based on the 500 shade (or the single color) provided by the user, and then we would set the base color used for generation directly to the shade-500 position. This is problematic, because when user provides the color
black
, we end up with a scale that has the black color in the shade-500 position, where the shade-950 was lighter than black.After:
The user will be able to provide only a single color or the whole scale for the
colorNeutral
property.Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change
Packages affected
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/clerk-expo
@clerk/fastify
gatsby-plugin-clerk
@clerk/localizations
@clerk/nextjs
@clerk/clerk-react
@clerk/remix
@clerk/clerk-sdk-node
@clerk/shared
@clerk/themes
@clerk/types
build/tooling/chore