Skip to content

[docs] Style inline code parameters with background to distinguish from links#4043

Closed
CiscoFran10 wants to merge 1 commit intomui:masterfrom
CiscoFran10:style/inline-code-styling
Closed

[docs] Style inline code parameters with background to distinguish from links#4043
CiscoFran10 wants to merge 1 commit intomui:masterfrom
CiscoFran10:style/inline-code-styling

Conversation

@CiscoFran10
Copy link
Contributor

Summary

Inline terms like mergeProps were styled in blue without a background, so they looked like links. This change gives inline code that represents parameters a padded, colored background so it reads as code instead of a link, improving clarity and accessibility.

Changes

  • Added --syntax-parameter-background and a rule for [data-inline][data-syntax='parameter'] so inline parameter code gets a background, border-radius, and padding.
  • Inline code nodes that contain a parameter token are marked with data-syntax="parameter" so the new styles apply.

Captura de tela 2026-02-11 030711
Captura de tela 2026-02-11 030639

Closes: #4009

@CiscoFran10 CiscoFran10 marked this pull request as ready for review February 11, 2026 06:15
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 11, 2026

commit: c36484f

@mui-bot
Copy link

mui-bot commented Feb 11, 2026

Bundle size report

Bundle Parsed size Gzip size
@base-ui/react 0B(0.00%) 0B(0.00%)

Details of bundle changes


Check out the code infra dashboard for more information about this PR.

@netlify
Copy link

netlify bot commented Feb 11, 2026

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit c36484f
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/698c1e5eaa4cf400085216bd
😎 Deploy Preview https://deploy-preview-4043--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 11, 2026

Greptile Overview

Greptile Summary

This PR improves documentation readability by adding a background style to inline code parameters (like mergeProps), making them visually distinct from hyperlinks. The implementation adds a CSS variable --syntax-parameter-background and a styling rule that applies background color, border-radius, and padding to inline code elements marked with data-syntax="parameter". The rehype plugin was updated to detect inline code containing parameter tokens and mark them with the appropriate attribute.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are isolated to documentation styling with no impact on component logic. The implementation is clean, uses existing CSS variables, and follows established patterns in the codebase. The rehype plugin change is a simple, safe addition that marks elements for styling.
  • No files require special attention

Important Files Changed

Filename Overview
docs/src/syntax-highlighting/index.css Added CSS variable and styling rule to give inline code parameters a background, distinguishing them from links
docs/src/syntax-highlighting/rehypeInlineCode.mjs Added logic to detect and mark inline code containing parameter tokens with data-syntax="parameter" attribute

@mj12albert mj12albert added the docs Improvements or additions to the documentation. label Feb 11, 2026
@aarongarciah aarongarciah requested a review from Copilot February 12, 2026 14:26
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves Base UI docs readability/accessibility by visually distinguishing inline code (especially identifiers that were tokenized as “parameter”/variable tokens) from links, addressing confusion raised in #4009.

Changes:

  • Tag inline <code data-inline> nodes with data-syntax="parameter" when the inline-highlighted tokens include --syntax-parameter.
  • Add a new CSS custom property for the parameter background and apply background/padding/radius styling to [data-inline][data-syntax='parameter'].

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
docs/src/syntax-highlighting/rehypeInlineCode.mjs Adds data-syntax="parameter" to inline code nodes when parameter-colored tokens are present.
docs/src/syntax-highlighting/index.css Introduces --syntax-parameter-background and styles parameter inline code with a background + padding to avoid link-like appearance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@colmtuite
Copy link
Contributor

Hey @CiscoFran10, thanks for the help with this PR, but we're already working on a redesign + rebuild of the docs, which will include this improvement. So I'm gonna close this as we've got it covered, but thanks for the effort, I appreciate it.

@colmtuite colmtuite closed this Feb 16, 2026
@CiscoFran10
Copy link
Contributor Author

CiscoFran10 commented Feb 16, 2026

@colmtuite No problem at all, looking forward to the new docs 😁 .

Just to confirm, will all the points mentioned in the early feedback issue #2766 be addressed as part of the rebuild, or are there still some areas where contributions would be helpful? I was planning to continue fixing some of the items I could, such as the theme toggle.

Also, I currently have these two open PRs that were mentioned in #2766:

Should I expect those to be closed as well due to the redesign, or are they still relevant?

@CiscoFran10 CiscoFran10 deleted the style/inline-code-styling branch February 16, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to the documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docs] Talking about accessibility, why do you use the blue color for non-links?

5 participants