Skip to content

[docs] Unify syntax highlighting#4429

Draft
aarongarciah wants to merge 9 commits intomui:masterfrom
aarongarciah:docs-unify-syntax-highlighting
Draft

[docs] Unify syntax highlighting#4429
aarongarciah wants to merge 9 commits intomui:masterfrom
aarongarciah:docs-unify-syntax-highlighting

Conversation

@aarongarciah
Copy link
Copy Markdown
Member

@aarongarciah aarongarciah commented Mar 24, 2026

WIP - not ready for review

Preview: https://deploy-preview-4429--base-ui.netlify.app/react/handbook/animation

  • Removes rehype-pretty-code and custom Rehype plugins in favor of docs-infra Rehype plugins. This means we now only rely on PrettyLights CSS vars for syntax highlighting.
  • Removes shiki dependency.
  • Removes some dead code from the Demo component.

TODO

@aarongarciah aarongarciah self-assigned this Mar 24, 2026
@aarongarciah aarongarciah added the docs Improvements or additions to the documentation. label Mar 24, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 24, 2026

commit: f6d867f

@mui-bot
Copy link
Copy Markdown

mui-bot commented Mar 24, 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
Copy Markdown

netlify bot commented Mar 24, 2026

Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit f6d867f
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/69c662f717d71c00084a69b2
😎 Deploy Preview https://deploy-preview-4429--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.

@aarongarciah aarongarciah force-pushed the docs-unify-syntax-highlighting branch from df1dfa2 to b43cb59 Compare March 24, 2026 23:29
@atomiks
Copy link
Copy Markdown
Contributor

atomiks commented Mar 25, 2026

Before After
After Before

RHP has advanced character highlighting that I don't find in other code highlighting libs. Does PrettyLights have parity? Notice render isn't highlighted in this PR. You can also control which sets of chars get highlighted. Would be disappointing to lose this feature

@aarongarciah
Copy link
Copy Markdown
Member Author

Notice render isn't highlighted in this PR

@atomiks I noticed. This is still WIP, not ready for review. I need to chat to docs-infra about the missing/broken stuff, but the idea is that there's full feature parity e.g. being able to highlight different words per line.

@aarongarciah aarongarciah force-pushed the docs-unify-syntax-highlighting branch from 2d501f4 to 1ce3822 Compare March 25, 2026 06:41
In order to open a dialog using a menu, control the dialog state and open it imperatively using the `onClick` handler on the menu item.

```tsx {12-13,17-18,24-25,28-29} title="Connecting a dialog to a menu"
```tsx title="Connecting a dialog to a menu"
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixing the highlighted lines in this demo, and in Dialog and Menu as well since it's been broken since 5e474fe#diff-eb4681ff3f8398dcc2e093c4106508dcbdbd314339bb1ced876eab0b7e054633L59

{
name: basename(path),
content,
prettyContent,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Seems unused?

@aarongarciah aarongarciah requested a review from dav-is March 25, 2026 07:41
Comment on lines +50 to +60
figure: (props) => <figure className="MdFigure" {...props} />,
pre: ({ tabIndex, ...props }) => {
if ('data-precompute' in props) {
return (
<CodeBlock.Root className="MdFigure">
<CodeBlockPreComputed {...props} />
</CodeBlock.Root>
);
}

return <figure className="MdFigure" {...props} />;
return <CodeBlock.Pre {...props} />;
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I need to double check these changes.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged. label Mar 27, 2026
@aarongarciah aarongarciah force-pushed the docs-unify-syntax-highlighting branch from 0a47d7d to f6d867f Compare March 27, 2026 10:59
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged. label Mar 27, 2026
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.

3 participants