Improve CSS syntax highlighting (#25326)
Release Notes: - Improved CSS syntax highlighting | Zed 0.174.6 | With this PR | | --- | --- | |  |  | - `|`: `operator` - `and`, `or`, `not`, `only`: `operator` -> `keyword.operator`, as defined in other languages - `id_name`, `class_name`: `property`/`attribute` -> `selector`, not a property name. [CSS reference](https://www.w3.org/TR/selectors-3/#class-html) - `namespace_name`: `property` -> `namespace`, not a property name - `property_name`: `constant` -> `property`, like `feature_name` already defined - `(keyword_query)`: `property`, similar to `feature_name`. [CSS reference](https://www.w3.org/TR/mediaqueries-3/#media1) - `keyword_query`: `constant.builtin`, [CSS reference](https://www.w3.org/TR/mediaqueries-3/#media0) - `plain_value`, `keyframes_name`: `constant.builtin`, [CSS reference](https://www.w3.org/TR/css-values-3/#value-defs) - `unit`: `type` -> `type.unit`, [Atom](9e4afce058/grammars/tree-sitter-css.cson (L73)
) and [VS Code](336801752d/extensions/css/syntaxes/css.tmLanguage.json (L1393)
) also have a `unit` scope for this. [CSS reference](https://www.w3.org/TR/css3-values/#dimensions) ```css @media (keyword_query) and keyword_query {} @supports (feature_name: plain_value) {} @namespace namespace_name url("string"); namespace_name|tag_name {} @keyframes keyframes_name { to { top: 200unit; color: #c01045; } } tag_name::before, #id_name:nth-child(even), .class_name[attribute_name=plain_value] { property_name: 2em 1.2em; --variable: rgb(250, 0, 0); color: var(--variable); animation: keyframes_name 5s plain_value; } ```
This commit is contained in:
parent
cf5e76b1b9
commit
9e5f89dc26
4 changed files with 196 additions and 14 deletions
|
@ -261,6 +261,11 @@
|
|||
"font_style": null,
|
||||
"font_weight": null
|
||||
},
|
||||
"namespace": {
|
||||
"color": "#bfbdb6ff",
|
||||
"font_style": null,
|
||||
"font_weight": null
|
||||
},
|
||||
"number": {
|
||||
"color": "#d2a6ffff",
|
||||
"font_style": null,
|
||||
|
@ -316,6 +321,16 @@
|
|||
"font_style": null,
|
||||
"font_weight": null
|
||||
},
|
||||
"selector": {
|
||||
"color": "#d2a6ffff",
|
||||
"font_style": null,
|
||||
"font_weight": null
|
||||
},
|
||||
"selector.pseudo": {
|
||||
"color": "#5ac1feff",
|
||||
"font_style": null,
|
||||
"font_weight": null
|
||||
},
|
||||
"string": {
|
||||
"color": "#a9d94bff",
|
||||
"font_style": null,
|
||||
|
@ -632,6 +647,11 @@
|
|||
"font_style": null,
|
||||
"font_weight": null
|
||||
},
|
||||
"namespace": {
|
||||
"color": "#5c6166ff",
|
||||
"font_style": null,
|
||||
"font_weight": null
|
||||
},
|
||||
"number": {
|
||||
"color": "#a37accff",
|
||||
"font_style": null,
|
||||
|
@ -687,6 +707,16 @@
|
|||
"font_style": null,
|
||||
"font_weight": null
|
||||
},
|
||||
"selector": {
|
||||
"color": "#a37accff",
|
||||
"font_style": null,
|
||||
"font_weight": null
|
||||
},
|
||||
"selector.pseudo": {
|
||||
"color": "#3b9ee5ff",
|
||||
"font_style": null,
|
||||
"font_weight": null
|
||||
},
|
||||
"string": {
|
||||
"color": "#86b300ff",
|
||||
"font_style": null,
|
||||
|
@ -1003,6 +1033,11 @@
|
|||
"font_style": null,
|
||||
"font_weight": null
|
||||
},
|
||||
"namespace": {
|
||||
"color": "#cccac2ff",
|
||||
"font_style": null,
|
||||
"font_weight": null
|
||||
},
|
||||
"number": {
|
||||
"color": "#dfbfffff",
|
||||
"font_style": null,
|
||||
|
@ -1058,6 +1093,16 @@
|
|||
"font_style": null,
|
||||
"font_weight": null
|
||||
},
|
||||
"selector": {
|
||||
"color": "#dfbfffff",
|
||||
"font_style": null,
|
||||
"font_weight": null
|
||||
},
|
||||
"selector.pseudo": {
|
||||
"color": "#72cffeff",
|
||||
"font_style": null,
|
||||
"font_weight": null
|
||||
},
|
||||
"string": {
|
||||
"color": "#d4fe7fff",
|
||||
"font_style": null,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue