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

Use a more noticeable color for highlight words in fenced code #2051

Closed
damithc opened this issue Dec 10, 2022 · 5 comments · Fixed by #2394
Closed

Use a more noticeable color for highlight words in fenced code #2051

damithc opened this issue Dec 10, 2022 · 5 comments · Fixed by #2394

Comments

@damithc
Copy link
Contributor

damithc commented Dec 10, 2022

Please confirm that you have searched existing issues in the repo

Yes, I have searched the existing issues

Any related issues?

No response

Tell us about your environment

n/a

MarkBind version

4.0.2

What did you do? Describe the bug

When the dark theme is used (which is the default) for fenced code, the highlighted words are not easy to spot.

image

Steps to reproduce

as above

Expected behavior

Use a color more easily visible in both dark and light themes, or use different colors for the two different themes?

Actual behavior

as abve

Anything else?

n/a

@tlylt
Copy link
Contributor

tlylt commented Dec 12, 2022

Agree that the contrast is not very high for the dark theme.

  • For the light theme, it seems quite visible so perhaps no change is needed here.
    image

Need to experiment or possibly check out other existing projects that have code block functionality to see if there's a more suitable color.

@yucheng11122017
Copy link
Contributor

yucheng11122017 commented Jan 30, 2023

The highlighting in other projects for the dark mode generally favors lighter colors such as react-code-blocks
image

Is something like this ok?
image

I noticed it is also quite common for other projects to allow users to choose their theme beyond dark and light. Will Markbind also need this use case? There are css files provided by highlight.js for different themes which can possibly used to support this

They also customize the theme of the code blocks for each block while Markbind is centralized to the site. Will Markbind also need this use case?

@damithc
Copy link
Contributor Author

damithc commented Jan 30, 2023

The highlighting in other projects for the dark mode generally favors lighter colors such as react-code-blocks
image

@yucheng11122017 Which part is highlighted in this screenshot? Or are you referring to syntax coloring (which is different from the highlighting feature mentioned in this issue)?

@yucheng11122017
Copy link
Contributor

@damithc Oh sorry professor, I misintepreted the issue.

@yucheng11122017
Copy link
Contributor

The dark and light themes already have different colors 474949 for their highlighting. (#474949 for dark and #e6e6fa for light)

Docusaurus uses a brighter color for their dark theme code highlighting (#646464). They allow users to override the default background color.

Using that value, this is what the code highlighting looks like which does seem a bit too bright making it hard to read the text
image

My suggestion would be to make the highlighting darker than the code, which makes the text stand out more by contrast.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants