Skip to content

feat: implement CSS-variable based syntax highlighting for dark mode#38

Merged
ThisIs-Developer merged 1 commit intoThisIs-Developer:mainfrom
LakshmanKishore:fix/syntax-highlight-dark-mode
Mar 7, 2026
Merged

feat: implement CSS-variable based syntax highlighting for dark mode#38
ThisIs-Developer merged 1 commit intoThisIs-Developer:mainfrom
LakshmanKishore:fix/syntax-highlight-dark-mode

Conversation

@LakshmanKishore
Copy link
Contributor

This pull request refactors how syntax highlighting is handled in the Markdown Viewer application. It removes the use of external Highlight.js theme stylesheets and manual highlighting logic in favor of CSS-based theming mapped to GitHub's color variables. This results in a more consistent appearance across light and dark themes and simplifies the codebase by relying on CSS for styling and automatic highlighting during Markdown parsing.

Syntax Highlighting Refactor:

  • Removed external Highlight.js theme stylesheets from index.html and export HTML generation, and replaced them with custom CSS rules for syntax highlighting. [1] [2]
  • Replaced manual code block highlighting in script.js with automatic highlighting during Markdown parsing, removing related code and comments. [1] [2] [3]
  • Added detailed syntax highlighting rules to styles.css, mapping Highlight.js classes to GitHub color variables for both light and dark themes.

Theme Consistency Improvements:

  • Ensured syntax highlighting colors adapt to theme changes by using CSS variables and dynamic color assignments in exported HTML.

Minor Changes:

  • Added a newline at the end of styles.css for formatting consistency.

@vercel
Copy link

vercel bot commented Mar 6, 2026

@LakshmanKishore is attempting to deploy a commit to the ThisIs-Developer Team on Vercel.

A member of the Team first needs to authorize it.

@vercel
Copy link

vercel bot commented Mar 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
markdown-viwer Ready Ready Preview, Comment Mar 7, 2026 5:19pm

@ThisIs-Developer ThisIs-Developer merged commit e1cc8a0 into ThisIs-Developer:main Mar 7, 2026
3 of 6 checks passed
@LakshmanKishore LakshmanKishore deleted the fix/syntax-highlight-dark-mode branch March 8, 2026 03:05
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.

2 participants