Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix background color #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ebrayton
Copy link

@ebrayton ebrayton commented Dec 6, 2022

Dug into pygments a bit while trying to figure out why the background color wasn't showing on my code blocks. I discovered the need to specify the CSS class in the get_style_defs call so it'll be added to the CSS selectors.

Without the arg to get_style_defs('.highlight'), this line wasn't present in the generated CSS (I assume because there would've been no selector for it):

.highlight { background: #242933; color: #d8dee9 }

Also, since I want to be able to specify a custom CSS class, I added an optional config entry for pygments.cssclass. This could also support those who may have existing styles selecting for the previously-used .hll selector.

Resolves #12

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.

Background color missing
1 participant