Skip to content

feat: replace highlight.js with Shiki for blog code blocks - #597

Open
Debbl wants to merge 1 commit into
solidjs:devfrom
Debbl:feat/shiki
Open

Debbl wants to merge 1 commit into
solidjs:devfrom
Debbl:feat/shiki

Conversation

@Debbl

@Debbl Debbl commented Nov 12, 2026

Copy link
Copy Markdown

README credits Shiki for code highlighting, but blog MDX currently uses rehype-highlight (highlight.js). This switches to @shikijs/rehype with github-light / github-dark dual themes, matching the existing GitHub-style colors in hljs.css.

  • Build-time only, no Shiki runtime shipped to the client
  • More accurate TSX/JSX highlighting (JSX expressions like {user().name} are now tokenized)
  • Colors are inline per token, so global .hljs styles can't interfere
  • Keeps the transparent code block background, padding and .dark class switching

Verified light/dark on the Solid 2.0 RC post locally; pnpm build:vite passes.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​shikijs/​rehype@​4.6.01001006995100
Addedshiki@​4.6.01001007795100

View full report

@Debbl

Debbl commented Nov 12, 2026

Copy link
Copy Markdown
Author

I targeted dev since the newer blog posts (Solid 2.0 RC series, with the most TSX code blocks) currently live there, and I used them to verify the change. Happy to rebase onto main instead if that's the preferred target — the change applies cleanly to both, since vite.config.ts and main.css are identical on the two branches.

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.

1 participant