Skip to content

docs: proper GitHub Dark theme for code blocks#507

Open
zubricks wants to merge 1 commit into
mainfrom
docs/code-block-fence-language-improvements
Open

docs: proper GitHub Dark theme for code blocks#507
zubricks wants to merge 1 commit into
mainfrom
docs/code-block-fence-language-improvements

Conversation

@zubricks
Copy link
Copy Markdown
Member

@zubricks zubricks commented Jun 2, 2026

The Code component ignored the MDX fence language and ran every block through Prism's TSX tokenizer, which produced incorrect highlighting for any non-TS language. This change honors the stored language field end-to-end and rebuilds the theme against the @primer/primitives dark palette used by GitHub and the official VS Code GitHub Dark theme.

  • thread the fence language through RichText → Code → prism-react-renderer
  • replace the hand-tuned palette with true GitHub Dark hex values
  • register Prism components: bash, scss, dockerfile, http, css-extras
  • delete the parallel :global CSS theme in index.module.scss that was competing with the JS theme

Examples

Current CSS Block

current-css-color-theme

Updated CSS Block

updated-css-color-theme

Current plaintext Block

current-plaintext-color-theme

Updated plaintext Block

updated-plaintext-color-theme

Current bash Block

current-bash-color-theme

Updated bash Block

updated-bash-color-theme

Current YML Block

Screenshot 2026-06-02 at 2 26 32 PM

Updated YML Block

Screenshot 2026-06-02 at 2 26 48 PM

… through Prism's TSX tokenizer, which produced incorrect highlighting for any non-TS language. This change honors the stored `language` field end-to-end and rebuilds the theme against the @primer/primitives dark palette used by GitHub and the official VS Code GitHub Dark theme.

- thread the fence language through RichText → Code → prism-react-renderer
- replace the hand-tuned palette with true GitHub Dark hex values
- register Prism components: bash, scss, dockerfile, http, css-extras
- delete the parallel :global CSS theme in index.module.scss that was
  competing with the JS theme
@zubricks zubricks requested a review from AlessioGr June 2, 2026 18:32
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