ryboe / CSS3

The most complete CSS support for Sublime Text
MIT License
189 stars 28 forks source link

@layer statement at-rules break subsequent highlighting #227

Closed JohnnyQuest1983 closed 2 months ago

JohnnyQuest1983 commented 2 months ago

The @layer CSS at-rule supports two different syntaxes:

/* statement at-rules */
@layer layer-name;
@layer layer-name, layer-name, layer-name;

/* block at-rules */
@layer {rules}
@layer layer-name {rules}

It seems that CSS3 has problems with the first syntax, statement at-rules. Highlighting for any subsequent code seems to be semi-broken until it finds a suitable closing brace.

Using the CSS Demo code from the above linked page:

@layer module, state;

@layer state {
  .alert {
    background-color: brown;
  }
  p {
    border: medium solid limegreen;
  }
}

@layer module {
  .alert {
    border: medium solid violet;
    background-color: yellow;
    color: white;
  }
}

I get this, where the second @layer is unhighlighted (the same thing happens for any code immediately following that first @layer module, state; line:

image