Automattic / Automattic/syntaxhighlighter

Allow SyntaxHighlighter to reuse the theme's font family and size

Open
#198 2 comments 0 reactions 0 assignees View on GitHub
[Type] Enhancement
Dominant language
CSS
Stars
251
Forks
81
PR merge metrics
No merged PRs in 30d

Description

On my blog, SyntaxHighlighter block renders like this:

Screenshot 2021-03-04 at 10 14 45

Notice the size and font mismatch between the post text, especially the inline `` tags, and the syntax highlighted block. That's because the theme defines `font-family: monospace` for ``, and it resolves to Courier. While SyntaxHighlighter's own hardcoded styles set a custom `font-family`, which resolves to Monaco in my case.

I'd like to tell SyntaxHighlighter to only do syntax highlighting and nothing else. For non-related styles, just blend into the blog's theme defaults.

Also, almost all SyntaxHighlighter styles are specified with `!important` which makes them harder to override.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating SyntaxHighlighter's hardcoded font-family, font-size, and !important style declarations; the issue does not name a file or test. Compare the highlighted block with the theme's code and inline code styles. Done means highlighting remains intact while font family and size follow the theme, with unrelated styles easier to override.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, wordpress
Domain
design, frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.