Skip to content

Override default styles with styles from language #314

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

Merged
merged 1 commit into from
Oct 7, 2020
Merged

Override default styles with styles from language #314

merged 1 commit into from
Oct 7, 2020

Conversation

karlhorky
Copy link
Contributor

@karlhorky karlhorky commented Oct 6, 2020

The styles from prism-themes@1.4.1 have been updated in #313 (thanks @simmerer!). And due to #305, they are using more nested token styles.

However, they are missing some default styling (eg. JavaScript code blocks should have #9cdcfe as the default color), which I have found to be a limitation of react-syntax-highlighter. The default styles for a theme are not being overridden by those by the current language.

This pull request is a possible solution to that issue.

@simmerer
Copy link
Collaborator

simmerer commented Oct 7, 2020

Looks like a very clean fix, @karlhorky.

Would you consider this "breaking," in the same way that #305 was "breaking" by causing a long-broken thing to start working? Or do you anticipate most users perceiving this as a bugfix?

@karlhorky
Copy link
Contributor Author

karlhorky commented Oct 7, 2020

Good question. I suppose I would see it as a semver minor (not just a patch), because:

  • it adds a new feature
  • it doesn't change the public API in a way that causes old code to break (like you mentioned, now themes will be displayed more accurately according to their styles)

So 15.2.0 maybe? What do you think?

@simmerer simmerer merged commit 8e1f771 into react-syntax-highlighter:master Oct 7, 2020
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