Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/nine-worms-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@clerk/clerk-js': patch
'@clerk/types': patch
---

- Render parsed `colorRing` at 15% vs 100%
- Render parsed `colorModalBackdrop` at 73% vs 100%
- Ensure `avatarBackground` and `avatarBorder` render with parsed neutral colors when `colorNeutral` is passed in via variables prop
4 changes: 2 additions & 2 deletions packages/clerk-js/bundlewatch.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
{ "path": "./dist/clerk.browser.js", "maxSize": "72.2KB" },
{ "path": "./dist/clerk.legacy.browser.js", "maxSize": "115.08KB" },
{ "path": "./dist/clerk.headless*.js", "maxSize": "55KB" },
{ "path": "./dist/ui-common*.js", "maxSize": "111.52KB" },
{ "path": "./dist/ui-common*.legacy.*.js", "maxSize": "115.33KB" },
{ "path": "./dist/ui-common*.js", "maxSize": "111.57KB" },
{ "path": "./dist/ui-common*.legacy.*.js", "maxSize": "115.38KB" },
{ "path": "./dist/vendors*.js", "maxSize": "40.2KB" },
{ "path": "./dist/coinbase*.js", "maxSize": "38KB" },
{ "path": "./dist/stripe-vendors*.js", "maxSize": "1KB" },
Expand Down
12 changes: 10 additions & 2 deletions packages/clerk-js/src/ui/customizables/parseVariables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,17 @@ export const createColorScales = (theme: Theme) => {
: colors.toHslaString(variables.colorInputBackground),
colorShimmer: colors.toHslaString(variables.colorShimmer),
colorMuted: variables.colorMuted ? colors.toHslaString(variables.colorMuted) : undefined,
colorRing: variables.colorRing ? colors.toHslaString(variables.colorRing) : undefined,
colorRing: variables.colorRing ? colors.makeTransparent(colors.toHslaString(variables.colorRing), 0.85) : undefined,
colorShadow: variables.colorShadow ? colors.toHslaString(variables.colorShadow) : undefined,
colorModalBackdrop: variables.colorModalBackdrop ? colors.toHslaString(variables.colorModalBackdrop) : undefined,
colorModalBackdrop: variables.colorModalBackdrop
? colors.makeTransparent(colors.toHslaString(variables.colorModalBackdrop), 0.27)
: undefined,
avatarBackground: neutralAlphaScale?.neutralAlpha400
? colors.toHslaString(neutralAlphaScale.neutralAlpha400)
: undefined,
avatarBorder: neutralAlphaScale?.neutralAlpha200
? colors.toHslaString(neutralAlphaScale.neutralAlpha200)
: undefined,
});
};

Expand Down
8 changes: 6 additions & 2 deletions packages/clerk-js/src/ui/foundations/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,17 @@ const colorMutedForeground = clerkCssVar(
const colors = Object.freeze({
avatarBorder: neutralAlphaScale.neutralAlpha200,
avatarBackground: neutralAlphaScale.neutralAlpha400,
colorModalBackdrop: clerkCssVar('color-modal-backdrop', neutralAlphaScale.neutralAlpha700),
colorModalBackdrop:
colorUtils.makeTransparent(clerkCssVar('color-modal-backdrop', defaultColorNeutral), 0.27) ||
neutralAlphaScale.neutralAlpha700,
colorBackground: clerkCssVar('color-background', 'white'),
colorInput: clerkCssVar('color-input', 'white'),
colorForeground,
colorMutedForeground,
colorMuted: undefined,
colorRing: clerkCssVar('color-ring', neutralAlphaScale.neutralAlpha200),
colorRing:
colorUtils.makeTransparent(clerkCssVar('color-ring', defaultColorNeutral), 0.85) ||
neutralAlphaScale.neutralAlpha200,
colorInputForeground: clerkCssVar('color-input-foreground', '#131316'),
colorPrimaryForeground: clerkCssVar('color-primary-foreground', 'white'),
colorShimmer: clerkCssVar('color-shimmer', 'rgba(255, 255, 255, 0.36)'),
Expand Down
2 changes: 1 addition & 1 deletion packages/clerk-js/src/ui/polishedAppearance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const BUTTON_OUTLINE_SHADOW = (color: string) =>

const cardContentStyles = (theme: InternalTheme) => ({
borderWidth: 0,
boxShadow: `${theme.shadows.$cardContentShadow}, ${BORDER_SHADOW_LENGTH} ${theme.colors.$neutralAlpha50}`,
boxShadow: `${theme.shadows.$cardContentShadow}, ${BORDER_SHADOW_LENGTH} ${theme.colors.$borderAlpha50}`,
});

const inputShadowStyles = (
Expand Down
6 changes: 3 additions & 3 deletions packages/types/src/appearance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

export type CssColorOrScale = string | ColorScaleWithRequiredBase;
export type CssColorOrAlphaScale = string | AlphaColorScale;
type CssColor = string | TransparentColor | BuiltInColors;

Check warning on line 54 in packages/types/src/appearance.ts

View workflow job for this annotation

GitHub Actions / Static analysis

"black" | "blue" | "red" | "green" | "grey" | "white" | "yellow" is overridden by string in this union type

Check warning on line 54 in packages/types/src/appearance.ts

View workflow job for this annotation

GitHub Actions / Static analysis

"transparent" is overridden by string in this union type
type CssLengthUnit = string;

type FontSizeScale = {
Expand Down Expand Up @@ -84,7 +84,7 @@
| 'Trebuchet MS'
| 'Verdana';

export type FontFamily = string | WebSafeFont;

Check warning on line 87 in packages/types/src/appearance.ts

View workflow job for this annotation

GitHub Actions / Static analysis

"Arial" | "Brush Script MT" | "Courier New" | "Garamond" | "Georgia" | "Helvetica" | "Tahoma" | "Times New Roman" | "Trebuchet MS" | "Verdana" is overridden by string in this union type

type LoadingState = 'loading';
type ErrorState = 'error';
Expand Down Expand Up @@ -738,7 +738,7 @@
*/
colorShimmer?: CssColor;
/**
* The color of the ring when an interactive element is focused.
* The color of the ring when an interactive element is focused rendered at 15% opacity.
* @default {@link Variables.colorNeutral} at 15% opacity
*/
colorRing?: CssColor;
Expand All @@ -753,8 +753,8 @@
*/
colorBorder?: CssColor;
/**
* The background color of the modal backdrop.
* @default {@link Variables.colorNeutral} at 70% opacity
* The background color of the modal backdrop rendered at 73% opacity.
* @default {@link Variables.colorNeutral} at 73% opacity
*/
colorModalBackdrop?: CssColor;
/**
Expand Down
Loading