-
Notifications
You must be signed in to change notification settings - Fork 77
Implement naming conventions in CSS grammar #167
base: master
Are you sure you want to change the base?
Conversation
35ffd30
to
6164c32
Compare
This looks like a valiant project. I like the idea. I haven't created themes before, so please enlighten me: if this gets accepted, won't themes break? |
Default themes have been updated already so they'll work fine with this PR. For other community themes, it depends on what the merging strategy is:
The TextMate documentation doesn't provide many useful scopes for CSS, so the scopes I listed above seem to have emerged from some sort of genetic process, selecting what works with existing themes. It's blatant with |
Description of the Change
This is a rewrite of the Tree-sitter grammar to implement naming conventions for syntax scopes.
Currently, Atom uses the TextMate grammar because the Tree-sitter grammar is lacking. This PR thoroughly updates the Tree-sitter grammar to be fully functional.
Benefits
Possible Drawbacks
The changes aim to facilitate theme development, filling the template is enough to ensure coherent highlighting across languages, instead of painfully creating styling rules for every language separately.
Regex grammar scopes vs homogenized Tree-sitter grammar scopes:
support.constant.property-value
->constant.style.support
entity.other.keyframe-offset
->constant.offset
support.type.property-name
->entity.property.support
variable.parameter.keyframe-list
->entity.keyframes
entity.name.tag
->entity.selector.tag
entity.other.attribute-name.class
->entity.selector.class
entity.other.attribute-name.id
->entity.selector.id
entity.other.attribute-name.pseudo-class
->entity.selector.pseudo-class
entity.other.attribute-name.pseudo-element
->entity.selector.pseudo-element
entity.other.attribute-name
->entity.selector.attribute
Applicable Issues
Related Pull Requests