Add @layer syntax highlighting#52
Conversation
|
@microsoft-github-policy-service agree |
|
@aeschli @dmitrivMS hi! Could you please take a look at PR #52 when you have a chance? It adds CSS TextMate grammar support for |
|
@lszomoru sorry for the extra ping — would you be able to help route this PR to the right reviewers? It touches only |
There was a problem hiding this comment.
Pull request overview
Adds TextMate grammar and accompanying spec tests to support CSS cascade layer syntax highlighting, covering @layer statements/blocks (including anonymous and nested layers) and layer / layer(...) in @import.
Changes:
- Extend the CSS TextMate grammar to tokenize
@layerat-rules (header + optional body) and layer name lists. - Extend
@importtokenization to recognizelayerandlayer(<layer-name>)segments. - Add spec tests validating token scopes for
@layerand@import ... layer...cases.
Show a summary per file
| File | Description |
|---|---|
| spec/css-spec.mjs | Adds tokenization tests for @layer and @import ... layer... highlighting scopes. |
| grammars/css.cson | Introduces @layer grammar rule plus #layer-import / #layer-name-list patterns for highlighting cascade layer syntax. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Low
Fixes #17
Fixes #24
Part of #20
Related to #7
This adds TextMate grammar support for CSS cascade layers.
Covered syntax:
@layer reset, framework.theme;@layer framework { ... }@layer { ... }@layer foo { @layer bar { ... } }@import "theme.css" layer;@import url("theme.css") layer(framework.theme);This intentionally keeps the scope limited to cascade layer syntax. Broader latest
@importsyntax support from #20 can be handled separately.Testing
npm testResult:
Screenshots
Before:

After:
