Closed chrisgrieser closed 1 year ago
Just writing to +1 this. I'm pulling my hair out trying to get it to look nice in .svelte
files with the Dracula theme. If I could figure out how to use the default syntax highlighting for css in the <style>
tag I 100% would.
Same, for this reason, I disable highlights for CSS. Is there any way I can help to get this resolved?
Got the same issue, if there is any way I can help to fix this I'm up.
UPDATE:
Got it working by introducing new queries in the highlights.scm file and by affecting them a hl group. I need to find where queries and hl groups are being matched so I will able to fix it.
Sounds great @Astanusic! I'm happy to test your changes once you have a patch available.
@Astanusic do you have a fix you could share? Is there anything I can do to help?
@amaanq Sorry to bother you, but may I ask what the reason is for this issue to be closed as "not planned"?
css is the only language I use where I am disabling treesitter highlighting because the colors are currently worse with it, and there seem to be several people who agree.
As this seems neovim-specific, let's cook up a version inside neovim first, shall we? Yes, nvim-treesitter is closely following (almost carbon copy of) tree-sitter-css highlight queries for captures. That doesn't mean it can't change. If you want the highlights to change, be the change you want to have :smile:. The queries were created 3 years ago, so not only the "default" captures have changed, so is the perception of what is better or not. So let's change the capture and pitch a PR for that.
Looks like the issue got fixed: https://github.com/nvim-treesitter/nvim-treesitter/commit/505a0e74cb82dfd1938dcc0eb2526c24abc345e2 🥳
Hm, @chrisgrieser do you know if we need to wait for some other part to update for us to benefit from the fix in https://github.com/nvim-treesitter/nvim-treesitter/commit/505a0e74cb82dfd1938dcc0eb2526c24abc345e2?
With nvim-treesitter updated to 8166080 I still get shitty CSS highlight colors:
Does things work for you?
@samhed It looks fine on my end. Didn't do anything other than upgrading nvim-treesitter and then updating the parser.
Have you updated the parsers via :TSUpdate
after the nvim-treesitter-update? Maybe reinstalling the css parser could fix the issue, if there is something stuck? Otherwise, I guess you'll have to report a bug at nivm-treesitter.
sorry for not responding before @chrisgrieser I forgot about this but yea this was an issue in nvim-treesitter (not here) that got resolved
Locking since it's unrelated, any other issues like this should be reported to nvim-treesitter, this is for the parser
This is noticeable when comparing the default css highlighting with the one from this TS parser:
default css syntax highlighting
TS css parser
the white color is simply a color scheme issue – the parser issue is that both, the classes in the selector and the property, both get the same group
@property
, which I checked with TS playground:Overall, this leads to worse syntax highlighting, regardless the theme.