add treesitter highlights

This commit is contained in:
Ray Elliott 2021-09-08 22:23:35 +01:00
parent a022178884
commit 7b13d73648
3 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,18 @@
(id_selector (id_name) @CssIdentifier)
(id_selector (id_name)) @CssIdSelector
(tag_name) @HtmlTagName
(class_selector (class_name) @CssClassName)
(selectors (pseudo_class_selector (class_name) @cssPseudoClass))
(nesting_selector) @cssNestingSelector
; need to find out how to make this more specific?
(universal_selector) @CssUniversalSelector
((property_name) (_)) @CssProp
(unit) @CssUnit
(declaration (property_name) (_) @CssPropertyValue)
(media_statement (feature_query (feature_name) @cssMediaFeatureName (_ (unit) @cssMediaQueryValueUnit) @cssMediaQueryValue) @cssMediaQuery)

View File

View File

@ -0,0 +1,17 @@
(start_tag
(attribute
(attribute_name) @ClassNameAttribute (#eq? @ClassNameAttribute "class")
(quoted_attribute_value
(attribute_value) @CssClassName )))
(start_tag
(attribute
(attribute_name) @IdAttribute (#eq? @IdAttribute "id")
(quoted_attribute_value
(attribute_value) @CssIdentifier )))
(start_tag
(attribute
(attribute_name) @DataAttribute (#match? @DataAttribute "^data-")
(quoted_attribute_value
(attribute_value) @DataAttributeValue )))