[docs] Style inline code parameters with background to distinguish from links#4043
[docs] Style inline code parameters with background to distinguish from links#4043CiscoFran10 wants to merge 1 commit intomui:masterfrom
Conversation
commit: |
Bundle size report
Check out the code infra dashboard for more information about this PR. |
✅ Deploy Preview for base-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Greptile OverviewGreptile SummaryThis PR improves documentation readability by adding a background style to inline code parameters (like Confidence Score: 5/5
Important Files Changed
|
There was a problem hiding this comment.
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 withdata-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.
|
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 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? |
Summary
Inline terms like
mergePropswere 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
--syntax-parameter-backgroundand a rule for[data-inline][data-syntax='parameter']so inline parameter code gets a background, border-radius, and padding.data-syntax="parameter"so the new styles apply.Closes: #4009