-
- Notifications
You must be signed in to change notification settings - Fork 53
Add : green and red alpha colors #1606
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
base: main
Are you sure you want to change the base?
Conversation
|
WalkthroughAdds two new alpha color scales — Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (4)
src/design-systems/clarity/tokens/colors/index.ts (1)
66-68: Add trailing comma after 'orange' for consistency.A comma should be added after
orangeon line 66 to maintain consistency with the object formatting pattern used throughout the file.Apply this diff:
- orange, + orange, 'red-alpha': redAlpha, 'green-alpha': greenAlphasrc/design-systems/clarity/tokens/colors/red-alpha.ts (3)
1-2: Remove unnecessary blank lines.The file begins with two blank lines that should be removed for consistency with other color token files.
Apply this diff:
- - const redAlpha = {
35-37: Remove trailing blank lines.The file ends with three blank lines that should be removed for consistency with other color token files.
Apply this diff:
export default redAlpha; - - -
4-31: Remove extra space afterlight:- light: { + light: {
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/design-systems/clarity/tokens/colors/green-alpha.ts(1 hunks)src/design-systems/clarity/tokens/colors/index.ts(2 hunks)src/design-systems/clarity/tokens/colors/red-alpha.ts(1 hunks)
⏰ 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). (2)
- GitHub Check: coverage
- GitHub Check: Jest (2/2)
🔇 Additional comments (1)
src/design-systems/clarity/tokens/colors/index.ts (1)
32-33: LGTM!The imports follow the existing pattern and are correctly placed alphabetically by color family.
| light: { | ||
| 50: 'oklch(0.96 0.05 152 / 0.015)', | ||
| 100: 'oklch(0.91 0.07 151 / 0.04)', | ||
| 200: 'oklch(0.89 0.08 150 / 0.1)', | ||
| 300: 'oklch(0.88 0.09 150 / 0.16)', | ||
| 400: 'oklch(0.88 0.10 149 / 0.23)', | ||
| 500: 'oklch(0.82 0.12 149 / 0.32)', | ||
| 600: 'oklch(0.79 0.12 149 / 0.44)', | ||
| 700: 'oklch(0.79 0.12 149 / 0.64)', | ||
| 800: 'oklch(0.77 0.12 150 / 0.81)', | ||
| 900: 'oklch(0.74 0.12 150 / 0.83)', | ||
| 950: 'oklch(0.66 0.12 150 / 0.87)', | ||
| 1000: 'oklch(0.48 0.11 149 / 0.9)', | ||
| }, | ||
| dark: { | ||
| 50: 'oklch(0.96 0.05 152 / 0.015)', | ||
| 100: 'oklch(0.91 0.07 151 / 0.04)', | ||
| 200: 'oklch(0.89 0.08 150 / 0.1)', | ||
| 300: 'oklch(0.88 0.09 150 / 0.16)', | ||
| 400: 'oklch(0.88 0.10 149 / 0.23)', | ||
| 500: 'oklch(0.82 0.12 149 / 0.32)', | ||
| 600: 'oklch(0.79 0.12 149 / 0.44)', | ||
| 700: 'oklch(0.79 0.12 149 / 0.64)', | ||
| 800: 'oklch(0.77 0.12 150 / 0.81)', | ||
| 900: 'oklch(0.74 0.12 150 / 0.83)', | ||
| 950: 'oklch(0.66 0.12 150 / 0.87)', | ||
| 1000: 'oklch(0.48 0.11 149 / 0.9)', | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify: Light and dark themes are identical.
The light and dark theme color values are exactly the same (lines 3-14 match lines 17-28). This is unusual for color tokens, as dark mode typically requires different color values for proper contrast and readability.
Run the following script to check if other alpha or non-alpha color tokens also have identical light/dark themes:
🏁 Script executed:
#!/bin/bash # Description: Check if other color token files have identical light/dark themes # Find all color token files and check for identical light/dark sections fd -e ts -p 'src/design-systems/clarity/tokens/colors/.*\.ts$' --exec bash -c ' file="$1" if grep -q "light:" "$file" && grep -q "dark:" "$file"; then echo "Checking: $file" # Extract light and dark sections and compare light=$(awk "/light:/{flag=1; next} /dark:/{flag=0} flag" "$file") dark=$(awk "/dark:/{flag=1; next} /\} as const/{flag=0} flag" "$file") if [ "$light" = "$dark" ]; then echo " ⚠️ IDENTICAL light and dark themes" else echo " ✓ Different light and dark themes" fi fi ' _ {}Length of output: 3236
Distinct dark theme values for green-alpha.ts
The light and dark themes in src/design-systems/clarity/tokens/colors/green-alpha.ts are identical, unlike all other color tokens—please provide unique dark mode values for proper contrast.
🤖 Prompt for AI Agents
In src/design-systems/clarity/tokens/colors/green-alpha.ts around lines 2–29, the dark theme object currently duplicates the light theme values; replace the dark values with distinct Oklch colors tuned for dark UI contrast. For each key (50–1000) provide adjusted oklch values (increase lightness for lighter tokens and reduce alpha for very light stops, or lower lightness/match chroma for darker stops) so the palette reads clearly on dark backgrounds; ensure the same keys remain, preserve ordering, and test contrast against the dark background to meet visual parity with other token files.
Summary by CodeRabbit