styled-components / vim-styled-components

Vim bundle for http://styled-components.com based javascript files.
300 stars 24 forks source link

Support nested block descriptions #3

Closed fleischie closed 7 years ago

fleischie commented 7 years ago

CSS only supports one layer of block definitions:

  main {
    article {
      section {
        padding: 25px 50px 0 1rem;
      }
    }
  }

Only the main is highlighted, the article and section is merely a string literal.

fleischie commented 7 years ago

The important keywords here are cssDefinition, cssBraces and transparent.

The cssDefinition is defined as transparent contained in a cssBraces definition. The transparent keyword is used to declare, that cssDefinition is itself not highlighted, but uses the highlighting of the item it is contained in.