Skip to content

Conversation

@alexcarpenter
Copy link
Member

@alexcarpenter alexcarpenter commented Jul 16, 2025

Description

  • 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

Checklist

  • pnpm test runs as expected.
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

  • New Features

    • Improved rendering of avatar background and border colors, now using neutral color tones for better appearance.
  • Style

    • Applied partial transparency to ring and modal backdrop colors for a more refined visual effect.
    • Updated card content shadow color for enhanced visual consistency.
  • Documentation

    • Clarified opacity levels in documentation for ring and modal backdrop color properties.
  • Chores

    • Increased allowed bundle size limits in configuration to accommodate recent changes.

@vercel
Copy link

vercel bot commented Jul 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 16, 2025 5:49pm

@changeset-bot
Copy link

changeset-bot bot commented Jul 16, 2025

🦋 Changeset detected

Latest commit: 5b2490a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 22 packages
Name Type
@clerk/clerk-js Patch
@clerk/types Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch
@clerk/agent-toolkit Patch
@clerk/astro Patch
@clerk/backend Patch
@clerk/elements Patch
@clerk/expo-passkeys Patch
@clerk/express Patch
@clerk/fastify Patch
@clerk/localizations Patch
@clerk/nextjs Patch
@clerk/nuxt Patch
@clerk/react-router Patch
@clerk/clerk-react Patch
@clerk/remix Patch
@clerk/shared Patch
@clerk/tanstack-react-start Patch
@clerk/testing Patch
@clerk/themes Patch
@clerk/vue Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@alexcarpenter alexcarpenter marked this pull request as draft July 16, 2025 15:23
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 16, 2025

📝 Walkthrough

Walkthrough

The changes introduce adjustments to the handling and rendering of color properties within the codebase. Specifically, the colorRing and colorModalBackdrop colors are now rendered with partial transparency—at 15% and 73% opacity, respectively—rather than as fully opaque colors. This is achieved through changes in both utility functions and the color constants. Two new color properties, avatarBackground and avatarBorder, are added, utilizing parsed neutral colors when available. Documentation comments for relevant color variables are updated to clarify the new opacity levels. Additionally, the box shadow color in card content styles is updated, and bundle size limits are slightly increased in the configuration. No public API or type signatures are changed.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9899422 and 5b2490a.

📒 Files selected for processing (1)
  • packages/clerk-js/bundlewatch.config.json (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/clerk-js/bundlewatch.config.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: semgrep-cloud-platform/scan
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: Build Packages
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (javascript-typescript)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jul 16, 2025

Open in StackBlitz

@clerk/agent-toolkit

npm i https://pkg.pr.new/@clerk/agent-toolkit@6334

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@6334

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@6334

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@6334

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@6334

@clerk/dev-cli

npm i https://pkg.pr.new/@clerk/dev-cli@6334

@clerk/elements

npm i https://pkg.pr.new/@clerk/elements@6334

@clerk/clerk-expo

npm i https://pkg.pr.new/@clerk/clerk-expo@6334

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@6334

@clerk/express

npm i https://pkg.pr.new/@clerk/express@6334

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@6334

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@6334

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@6334

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@6334

@clerk/clerk-react

npm i https://pkg.pr.new/@clerk/clerk-react@6334

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@6334

@clerk/remix

npm i https://pkg.pr.new/@clerk/remix@6334

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@6334

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@6334

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@6334

@clerk/themes

npm i https://pkg.pr.new/@clerk/themes@6334

@clerk/types

npm i https://pkg.pr.new/@clerk/types@6334

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@6334

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@6334

commit: 5b2490a

@alexcarpenter alexcarpenter marked this pull request as ready for review July 16, 2025 15:45
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (3)
packages/clerk-js/src/ui/foundations/colors.ts (2)

91-91: Consider extracting magic numbers as named constants.

The transparency values 0.27 and 0.85 are magic numbers that would benefit from descriptive names to improve code readability and maintainability.

Consider extracting these values as named constants:

+const MODAL_BACKDROP_TRANSPARENCY = 0.27; // 73% opacity
+const RING_TRANSPARENCY = 0.85; // 15% opacity
+
 const colors = Object.freeze({
   avatarBorder: neutralAlphaScale.neutralAlpha200,
   avatarBackground: neutralAlphaScale.neutralAlpha400,
-  colorModalBackdrop: colorUtils.makeTransparent(clerkCssVar('color-modal-backdrop', defaultColorNeutral), 0.27),
+  colorModalBackdrop: colorUtils.makeTransparent(clerkCssVar('color-modal-backdrop', defaultColorNeutral), MODAL_BACKDROP_TRANSPARENCY),
   colorBackground: clerkCssVar('color-background', 'white'),
   colorInput: clerkCssVar('color-input', 'white'),
   colorForeground,
   colorMutedForeground,
   colorMuted: undefined,
-  colorRing: colorUtils.makeTransparent(clerkCssVar('color-ring', defaultColorNeutral), 0.85),
+  colorRing: colorUtils.makeTransparent(clerkCssVar('color-ring', defaultColorNeutral), RING_TRANSPARENCY),

Also applies to: 97-97


91-91: Consider adding error handling for transparency operations.

The makeTransparent function calls should handle potential failures gracefully, especially since color parsing can fail with invalid input.

Consider adding fallback values for transparency operations:

-  colorModalBackdrop: colorUtils.makeTransparent(clerkCssVar('color-modal-backdrop', defaultColorNeutral), 0.27),
+  colorModalBackdrop: colorUtils.makeTransparent(clerkCssVar('color-modal-backdrop', defaultColorNeutral), 0.27) || 'rgba(0, 0, 0, 0.73)',
-  colorRing: colorUtils.makeTransparent(clerkCssVar('color-ring', defaultColorNeutral), 0.85),
+  colorRing: colorUtils.makeTransparent(clerkCssVar('color-ring', defaultColorNeutral), 0.85) || 'rgba(0, 0, 0, 0.15)',

Also applies to: 97-97

.changeset/nine-worms-count.md (1)

1-9: Suggest adding visual regression testing.

Since this PR modifies UI color rendering, visual regression testing should be performed to ensure the changes don't introduce unexpected visual artifacts.

Based on the coding guidelines for UI components, please ensure visual regression testing is performed for these color changes. You may want to:

  1. Test the appearance of modal backdrops at 73% opacity
  2. Test the appearance of ring colors at 15% opacity
  3. Test avatar colors with neutral color variations
  4. Verify color accessibility standards are maintained

Would you like me to help generate test cases or documentation for the visual regression testing requirements?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 11aa1bb and dcd8d14.

📒 Files selected for processing (4)
  • .changeset/nine-worms-count.md (1 hunks)
  • packages/clerk-js/src/ui/customizables/parseVariables.ts (1 hunks)
  • packages/clerk-js/src/ui/foundations/colors.ts (1 hunks)
  • packages/types/src/appearance.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/clerk-js/src/ui/customizables/parseVariables.ts
  • packages/types/src/appearance.ts
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{js,jsx,ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/development.mdc
packages/**/*.ts

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/development.mdc
packages/**/*.{ts,tsx,d.ts}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/development.mdc
**/*.{ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/development.mdc
  • .cursor/rules/typescript.mdc
packages/{clerk-js,elements,themes}/**/*

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/monorepo.mdc
**/*

Instructions used from:

Sources:
⚙️ CodeRabbit Configuration File

🧠 Learnings (3)
📓 Common learnings
Learnt from: alexcarpenter
PR: clerk/javascript#6275
File: packages/clerk-js/src/ui/foundations/colors.ts:85-113
Timestamp: 2025-07-14T17:14:28.864Z
Learning: In the Clerk JavaScript repository, the `colorMuted` property in the colors definition can be undefined intentionally, as it's handled by the `common.mutedBackground` utility function which provides appropriate fallback logic when the muted color is not defined.
Learnt from: dstaley
PR: clerk/javascript#6100
File: packages/clerk-js/src/ui/components/OAuthConsent/OAuthConsent.tsx:121-124
Timestamp: 2025-06-16T17:08:58.414Z
Learning: The @clerk/clerk-js package only supports browsers released in the last two years (since May 8, 2023), so modern CSS features like color-mix() are fully supported across all target browsers without requiring fallbacks.
Learnt from: dstaley
PR: clerk/javascript#6116
File: .changeset/tangy-garlics-say.md:1-2
Timestamp: 2025-06-13T16:09:53.061Z
Learning: In the Clerk JavaScript repository, contributors create intentionally empty changeset files (containing only the YAML delimiters) when a PR touches only non-published parts of the codebase (e.g., sandbox assets). This signals that no package release is required, so such changesets should not be flagged as missing content.
Learnt from: CR
PR: clerk/javascript#0
File: .cursor/rules/monorepo.mdc:0-0
Timestamp: 2025-06-30T10:30:56.197Z
Learning: Applies to packages/{clerk-js,elements,themes}/**/* : Visual regression testing should be performed for UI components.
Learnt from: CR
PR: clerk/javascript#0
File: .cursor/rules/development.mdc:0-0
Timestamp: 2025-06-30T10:29:42.997Z
Learning: Update documentation for API changes
.changeset/nine-worms-count.md (7)
Learnt from: dstaley
PR: clerk/javascript#6100
File: packages/clerk-js/src/ui/components/OAuthConsent/OAuthConsent.tsx:121-124
Timestamp: 2025-06-16T17:08:58.414Z
Learning: The @clerk/clerk-js package only supports browsers released in the last two years (since May 8, 2023), so modern CSS features like color-mix() are fully supported across all target browsers without requiring fallbacks.
Learnt from: dstaley
PR: clerk/javascript#6116
File: .changeset/tangy-garlics-say.md:1-2
Timestamp: 2025-06-13T16:09:53.061Z
Learning: In the Clerk JavaScript repository, contributors create intentionally empty changeset files (containing only the YAML delimiters) when a PR touches only non-published parts of the codebase (e.g., sandbox assets). This signals that no package release is required, so such changesets should not be flagged as missing content.
Learnt from: CR
PR: clerk/javascript#0
File: .cursor/rules/monorepo.mdc:0-0
Timestamp: 2025-06-30T10:30:56.197Z
Learning: Applies to packages/{clerk-js,elements,themes}/**/* : Visual regression testing should be performed for UI components.
Learnt from: alexcarpenter
PR: clerk/javascript#6275
File: packages/clerk-js/src/ui/foundations/colors.ts:85-113
Timestamp: 2025-07-14T17:14:28.864Z
Learning: In the Clerk JavaScript repository, the `colorMuted` property in the colors definition can be undefined intentionally, as it's handled by the `common.mutedBackground` utility function which provides appropriate fallback logic when the muted color is not defined.
Learnt from: jacekradko
PR: clerk/javascript#5905
File: .changeset/six-ears-wash.md:1-3
Timestamp: 2025-06-26T03:27:05.535Z
Learning: In the Clerk JavaScript repository, changeset headers support single quotes syntax (e.g., '@clerk/backend': minor) and work fine with their current changesets integration, so there's no need to change them to double quotes.
Learnt from: CR
PR: clerk/javascript#0
File: .cursor/rules/react.mdc:0-0
Timestamp: 2025-06-30T10:32:37.848Z
Learning: Applies to **/*.{jsx,tsx} : Use proper state normalization
Learnt from: CR
PR: clerk/javascript#0
File: .cursor/rules/monorepo.mdc:0-0
Timestamp: 2025-06-30T10:30:56.197Z
Learning: Applies to packages/clerk-react/**/*.{test,spec}.{js,ts,tsx} : Component testing should use React Testing Library.
packages/clerk-js/src/ui/foundations/colors.ts (3)
Learnt from: alexcarpenter
PR: clerk/javascript#6275
File: packages/clerk-js/src/ui/foundations/colors.ts:85-113
Timestamp: 2025-07-14T17:14:28.864Z
Learning: In the Clerk JavaScript repository, the `colorMuted` property in the colors definition can be undefined intentionally, as it's handled by the `common.mutedBackground` utility function which provides appropriate fallback logic when the muted color is not defined.
Learnt from: dstaley
PR: clerk/javascript#6100
File: packages/clerk-js/src/ui/components/OAuthConsent/OAuthConsent.tsx:121-124
Timestamp: 2025-06-16T17:08:58.414Z
Learning: The @clerk/clerk-js package only supports browsers released in the last two years (since May 8, 2023), so modern CSS features like color-mix() are fully supported across all target browsers without requiring fallbacks.
Learnt from: CR
PR: clerk/javascript#0
File: .cursor/rules/monorepo.mdc:0-0
Timestamp: 2025-06-30T10:30:56.197Z
Learning: Applies to packages/{clerk-js,elements,themes}/**/* : Visual regression testing should be performed for UI components.
🧬 Code Graph Analysis (1)
packages/clerk-js/src/ui/foundations/colors.ts (1)
packages/clerk-js/src/ui/utils/cssVariables.ts (1)
  • clerkCssVar (252-252)
🔇 Additional comments (1)
packages/clerk-js/src/ui/foundations/colors.ts (1)

89-90: LGTM: Avatar colors correctly use neutral alpha scales.

The implementation correctly uses neutralAlphaScale values for avatar colors, which aligns with the PR objective to ensure avatars render with parsed neutral colors when colorNeutral is provided.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@tmilewski
Copy link
Member

💭 @alexcarpenter Some of the percentages/descriptions don't seem to be matching up here and CoderRabbit seems to think the same. Mind confirming that they're correct?

…olors, update template styles, and adjust variable parsing. Disable modern color support check.
@alexcarpenter alexcarpenter enabled auto-merge (squash) July 16, 2025 17:48
@alexcarpenter alexcarpenter merged commit 6041c39 into main Jul 16, 2025
37 of 38 checks passed
@alexcarpenter alexcarpenter deleted the alexcarpenter/color-follow-up-fixes branch July 16, 2025 17:59
jacekradko pushed a commit that referenced this pull request Jul 24, 2025
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants