fix: improve light theme code block variable contrast - #2373
Conversation
|
@Ibochkarev is attempting to deploy a commit to the Nuxt Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughAdds a local Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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.
🧹 Nitpick comments (1)
themes/material-theme-lighter-contrast.mjs (1)
12-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd regression coverage for comment and docstring preservation.
Test default, variable, comment, and docstring token scopes. This protects the contrast rule from changing comment colors in future theme updates.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@themes/material-theme-lighter-contrast.mjs` around lines 12 - 26, Add regression tests for patchTokenColors covering default, variable, comment, and docstring token scopes. Verify that the contrast transformation preserves comment and docstring colors while applying the expected foreground adjustment only to eligible non-comment tokens.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@themes/material-theme-lighter-contrast.mjs`:
- Around line 12-26: Add regression tests for patchTokenColors covering default,
variable, comment, and docstring token scopes. Verify that the contrast
transformation preserves comment and docstring colors while applying the
expected foreground adjustment only to eligible non-comment tokens.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 685db608-184c-4be9-bd5c-cd6819fe31a1
📒 Files selected for processing (3)
helpers/mdc-parser.mjsnuxt.config.tsthemes/material-theme-lighter-contrast.mjs
🔗 Linked issue
Fixes #2217
📚 Description
On the light theme, Material Theme Lighter paints variables and comments the same gray (
#90A4AE), so names likedataandsignallook muted on docs pages.I added a small patched theme that keeps comments muted and darkens other
#90A4AEtokens (plus default foreground) to#455A64, then wired it in for content highlighting and the MDC parser. Dark theme staysmaterial-theme-palenight.