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

Many different kinds of elements just don't have styles attached to them #48

Open
fabricepallaud opened this issue Dec 25, 2023 · 2 comments

Comments

@fabricepallaud
Copy link

fabricepallaud commented Dec 25, 2023

No matter the theme I select, some elements like .hljs-function, .hljs-params, .hljs-property among others just don't have styles attached to them hence must be styled manually.

Screenshot_29

Is it normal?

@joshgoebel
Copy link
Member

joshgoebel commented Dec 25, 2023

No matter the theme I select

I'd say you're having some bad luck perhaps - check the source files here and you'll see these scopes are definitively present in SOME themes. But more specifically:

.hljs-property

https://highlightjs.readthedocs.io/en/latest/css-classes-reference.html#a-note-on-newer-scopes

.hljs-function

This has fallen out of favor vs the new title-function scope - though many themes just alias both scopes to the same color... (for backwards compatibility)

.hljs-params

This has also fallen out of favor because it's often used as a block scope and just thrown around () which can look pretty bad. Some new grammars don't even try to figure out where params starts and ends and just match patterns to highlight any interesting elements there - just like anywhere else in the code.


I don't think there is any sign of a real problem here. If anything adding property (as part of #2500) might be a priority but it's hard to find theme maintainers and just anyone coming in and adding random colors to existing themes to cover new scopes is kind of a hard thing to do. If someone had a generic proposal dealing with how to handle this is some type of automated fashion that could be interesting though.

@fabricepallaud
Copy link
Author

Got it, thanks! I just styled these elements myself which was quick and easy anyway.

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

No branches or pull requests

2 participants