-
Notifications
You must be signed in to change notification settings - Fork 8
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
CSS syntax highlighter #89
Comments
While I'm all in favour of colourful stuff (which was the main reason I got involved in GitHub Linguist stuff in the first place), I suspect the colours in the screenshot may be a bit overkill. 😅 I'd at least have avoided the green colouring. |
This is just a test version, but it follows the default CSS color scheme almost completely |
Generally, in VSCode it's up to choose you which colors will be used for highlighting. The task of a highlighter is to define what "type" the token belongs to. |
I'll copy my answer from Slack here as well
|
A lot of adblock filter rules use CSS, so we should consider implementing a good CSS highlighter according to our goals (this doesn't necessarily mean full CSS support, e.g. we don't have to support comments).
The benefits of this are:
Because of "Extended CSS syntax", we should definitely think about creating our own highlighter, rather than integrating an existing CSS highlighter. In addition, this will ensure consistent results, since VSCode doesn't use the same CSS scope as GitHub.
I started implementing this earlier (last year), here is a demo of what it would look like:
In the case of CSS injection rules, at-rules and declaration block should also be handled, but the development can be done step-by-step, so e.g. in the first round, we only implement the CSS selectors for element hiding rules.
Reference:
The text was updated successfully, but these errors were encountered: