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;
}
```