styled-components / vim-styled-components

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

Classes are incorrectly highlighted #24

Closed fleischie closed 6 years ago

fleischie commented 7 years ago

Something I have not yet thought about: class definitions, that can be injected globally.

import { css, injectGlobal } from 'styled-components'

const globalCss = css`
  .very-small-margin {
    margin: 1000vw;
  }
`;

injectGlobal`
  ${globalCss}
`;

I should highlight class names (and ids for that matter) independent from the actual name and only outside of the definition region. And anyway, why is that not already handled correctly?

fleischie commented 7 years ago

After 2 minutes of research, re-defining cssClassName and cssIdentifier fixes this problem, but they are the same as the original file, why isn't it used in the @CSS cluster?

shelldandy commented 7 years ago

TIL that 💅 has global css thanks a lot!!

fleischie commented 6 years ago

See comment on issue #21 for a discussion on completely re-writing this plugin to be more robust on these kind of things.

fleischie commented 6 years ago

Please see, whether #30 fixes this issue.

fleischie commented 6 years ago

Bump: Should be fixed, when #30 is merged. Anyways, please create a new issue, when merged. 😛