Skip to content

Conversation

@carlagn
Copy link
Contributor

@carlagn carlagn commented Aug 19, 2025

Color on code's spans is defined inline, in order to get token highlighting working.
From reports on the issue/slack thread, it seems that this highlighting was taking a bit more time to resolve, so I've added a default color to fall back on, which is the most contrasting for both light and dark mode.

This should minimise the visual impact.

Fixes #DC-4818

Summary by CodeRabbit

  • Style
    • Updated code block text color to align with the theme’s primary font color, improving visual consistency across the site.
    • Enhances readability and contrast in code blocks, especially across light/dark themes.
    • Purely a presentation change with no impact on functionality, layout, or interactions.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 19, 2025

Walkthrough

Adds a CSS rule setting color: var(--primary-font-color) for .codeBlockLines > span in CodeBlock content styles. No structural or logic changes.

Changes

Cohort / File(s) Summary of Changes
CodeBlock styles
src/theme/CodeBlock/Content/styles.module.scss
Set text color on .codeBlockLines > span to var(--primary-font-color); no other style or logic changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • fix: DC-4710 code color #7056 — Also updates CodeBlock styling (targets .codeBlockContent), likely related to consistent code block presentation.

Suggested reviewers

  • nikolasburk
  • mhessdev
  • aidankmcalister
  • ankur-arch

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/DC-4818-update-code-fcolor

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.

❤️ Share
🪧 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@cloudflare-workers-and-pages
Copy link

Deploying docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: aedfa05
Status: ✅  Deploy successful!
Preview URL: https://f1b2b5c5.docs-51g.pages.dev
Branch Preview URL: https://fix-dc-4818-update-code-fcol.docs-51g.pages.dev

View logs

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)
src/theme/CodeBlock/Content/styles.module.scss (1)

31-34: Add fallbacks in var() to avoid silent no-op if --primary-font-color is undefined

Good addition. To make this more resilient across themes, add a fallback chain so we gracefully fall back to Prism’s base code color or inheritance if --primary-font-color isn’t defined.

-    color: var(--primary-font-color);
+    color: var(--primary-font-color, var(--prism-color, inherit));
📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6fdd154 and aedfa05.

📒 Files selected for processing (1)
  • src/theme/CodeBlock/Content/styles.module.scss (1 hunks)
🔇 Additional comments (2)
src/theme/CodeBlock/Content/styles.module.scss (2)

31-34: LGTM on intent: minimal FOUC while token highlighting resolves

Selector scope and cascade behavior align with the goal: default line color until inline token colors apply. Non-invasive and consistent with existing theme vars.


31-34: Verify theme variable definitions and contrast for code blocks

  • Confirm that --primary-font-color is indeed declared in src/css/theming.css for both modes (light uses var(--gray-800), dark uses rgb(247,250,252)).
  • Note that --prism-background-color and --prism-color aren’t defined in our repo’s CSS—they come from the Prism theme shipped by Docusaurus. Please verify those variables are loaded at runtime.
  • In your browser’s devtools (light + dark), inspect a code block’s computed background-color/color to ensure the contrast ratio meets WCAG AA.
  • Finally, verify that Prism’s .token selectors (and any inline style="color:…" on <span>) still override the base > span rule as intended.

@github-actions
Copy link
Contributor

Redirect check

This PR probably requires the following redirects to be added to static/_redirects:

  • This PR does not change any pages in a way that would require a redirect.

@github-actions
Copy link
Contributor

Dangerous URL check

No absolute URLs to prisma.io/docs found.
No local URLs found.

@carlagn carlagn merged commit 6014b51 into main Aug 19, 2025
7 checks passed
@carlagn carlagn deleted the fix/DC-4818-update-code-fcolor branch August 19, 2025 16:29
jlecordier pushed a commit to jlecordier/docs-1 that referenced this pull request Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants