styled-components / vim-styled-components

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

cssAttrRegion problems #13

Closed fleischie closed 7 years ago

fleischie commented 7 years ago

The cssAttrRegion differentiates props and attributes from one-another as they both may have the same keywords. Basically it defines the region between an : and an ;/)/} to be an attr.

The problem now is in the form of a list of pseudo-classes/-elements:

  img::before,
  img::after {
    ...

resp.

  &:active,
  &:hover,
  &:focus,
  &:visited {
    ...

the first element is treated as an attribute (because it starts with a : but doesn't close with an appropriate element) and the following lines are thusly regarded as cssAttrRegion, rendering them as unknown and thus unhighlighted attributes.

I think we have to re-define the cssAttrRegion syntax item to solve this issue. I'm not sure how, yet.