Skip to content

refactor(clerk-js): Improve NavButton contrast #6351

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alexcarpenter
Copy link
Member

@alexcarpenter alexcarpenter commented Jul 18, 2025

Description

Improve NavButton contrast by using colorMutedForeground and removing the opacity change.

Default and dark theme before/after

BEFORE AFTER
Screenshot 2025-07-18 at 3 49 10 PM Screenshot 2025-07-18 at 3 48 26 PM
Screenshot 2025-07-18 at 3 52 20 PM Screenshot 2025-07-18 at 3 51 44 PM

Contrast ratios before/after

3.38:1 7.18:1
Screenshot 2025-07-18 at 4 19 10 PM Screenshot 2025-07-18 at 4 19 40 PM

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

  • Style
    • Improved the color contrast of navigation bar buttons in profile components for better visibility and readability.

Copy link

changeset-bot bot commented Jul 18, 2025

⚠️ No Changeset found

Latest commit: b1493ff

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

Copy link

vercel bot commented Jul 18, 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 18, 2025 7:55pm

Copy link
Contributor

coderabbitai bot commented Jul 18, 2025

📝 Walkthrough

Walkthrough

The color styling for the inactive state of the NavButton component in the Navbar was updated. The text color for inactive buttons now uses t.colors.$colorMutedForeground instead of t.colors.$neutralAlpha600. Additionally, the conditional opacity of 0.6 for inactive buttons was removed. There were no changes to hover, focus, or active state behaviors, and no alterations were made to exported or public entities.


📜 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 b1493ff and fb8522c.

📒 Files selected for processing (1)
  • .changeset/wicked-badgers-know.md (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .changeset/wicked-badgers-know.md
⏰ 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: Build Packages
  • GitHub Check: Formatting | Dedupe | Changeset
  • 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.

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: 0

🧹 Nitpick comments (1)
packages/clerk-js/src/ui/elements/Navbar.tsx (1)

266-306: Consider adding tests for the NavButton color changes.

Since this PR modifies the visual styling of the NavButton component, particularly the contrast improvements, consider adding tests to ensure:

  • The correct color tokens are applied for active vs inactive states
  • The accessibility contrast ratios meet WCAG standards
  • The visual changes render correctly across different themes
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 6080456 and b1493ff.

📒 Files selected for processing (1)
  • packages/clerk-js/src/ui/elements/Navbar.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (10)
packages/clerk-js/src/ui/**/*.{ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/clerk-js-ui.mdc
**/*.{js,jsx,ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/development.mdc
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

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

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
**/*.{jsx,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

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

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

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

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/react.mdc
**/*

Instructions used from:

Sources:
⚙️ CodeRabbit Configuration File

⏰ 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: Build Packages
  • GitHub Check: Formatting | Dedupe | Changeset
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (1)
packages/clerk-js/src/ui/elements/Navbar.tsx (1)

282-282: Good improvement to use semantic color tokens for better contrast.

The change from $neutralAlpha600 to $colorMutedForeground is a positive improvement that:

  • Uses a more semantic color token that better represents the intent
  • Should provide improved contrast for inactive navigation buttons
  • Follows the coding guidelines' emphasis on using the theme token system
  • Makes the color choice more maintainable and consistent with the design system

Copy link

pkg-pr-new bot commented Jul 18, 2025

Open in StackBlitz

@clerk/agent-toolkit

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

@clerk/astro

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

@clerk/backend

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

@clerk/chrome-extension

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

@clerk/clerk-js

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

@clerk/dev-cli

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

@clerk/elements

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

@clerk/clerk-expo

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

@clerk/expo-passkeys

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

@clerk/express

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

@clerk/fastify

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

@clerk/localizations

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

@clerk/nextjs

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

@clerk/nuxt

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

@clerk/clerk-react

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

@clerk/react-router

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

@clerk/remix

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

@clerk/shared

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

@clerk/tanstack-react-start

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

@clerk/testing

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

@clerk/themes

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

@clerk/types

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

@clerk/upgrade

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

@clerk/vue

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

commit: fb8522c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants