Skip to content

Commit

Permalink
fix(clerk-js): Fix neutral alpha shades generation
Browse files Browse the repository at this point in the history
  • Loading branch information
anagstef committed Feb 8, 2024
1 parent fde58eb commit 42d0669
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .changeset/new-wasps-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
---
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui/utils/colorOptionToHslaScale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const generateFilledScaleFromBaseHslaColor = (base: HslaColor): InternalColorSca
};

const generateFilledAlphaScaleFromBaseHslaColor = (base: HslaColor): InternalColorScale<HslaColor> => {
const newScale = { 20: undefined, ...createEmptyColorScale<HslaColor>() };
const newScale = createEmptyColorScale<HslaColor>();
const baseWithoutAlpha = colors.setHslaAlpha(base, 0);
const alphas = [0.02, 0.03, 0.07, 0.11, 0.15, 0.28, 0.41, 0.53, 0.62, 0.73, 0.78, 0.81, 0.84, 0.87, 0.92];
// @ts-expect-error
Expand Down
2 changes: 1 addition & 1 deletion packages/themes/src/themes/dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { experimental_createTheme } from '../createTheme';
export const dark = experimental_createTheme({
variables: {
colorBackground: '#212126',
colorNeutral: 'white',
colorNeutral: 'hsla(0, 0%, 100%, 0.53)',
colorPrimary: '#ffffff',
colorTextOnPrimaryBackground: 'black',
colorText: 'white',
Expand Down
4 changes: 2 additions & 2 deletions packages/types/src/appearance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ export type Variables = {
colorWarning?: CssColorOrScale;
/**
* The color that will be used as the neutral color for all the components. To achieve sufficient contrast,
* light themes should be using dark shades (`black`), while dark themes should be using light (`white`) shades. This option applies to borders,
* light themes should be using dark shades, while dark themes should be using light shades. This option applies to borders,
* backgrounds for hovered elements, hovered dropdown options etc.
* @default 'black'
* @default 'hsla(0, 0%, 0%, 0.53)'
*/
colorNeutral?: CssColorOrAlphaScale;
/**
Expand Down

0 comments on commit 42d0669

Please sign in to comment.