webstorm-styled-components icon indicating copy to clipboard operation
webstorm-styled-components copied to clipboard

[Feature] - highlighting for styled component function signatures

Open pr1ntr opened this issue 6 years ago • 2 comments

I was wondering if its possible to make IntelliJ recognize a styled component interpolator based on the function signature?

something like:

export const breakpoint = (gt = 'xs', lte) => (strings, ...interpolation) => css`
  @media (min-width: ${grid[gt]}px) ${lte && grid[lte] ? `(max-width: ${grid[lte]})` : ''} {
    ${css(strings, ...interpolation)}
  }
`

Since it returns css`` and has a signature of (strings, ...interpolation) maybe then the plugin will highlight it as a styled component. I can submit this a feature request too if you have a GitHub

#47

pr1ntr avatar Aug 07 '18 01:08 pr1ntr

@pr1ntr do you know about this configuration feature https://github.com/styled-components/webstorm-styled-components/#configuration? It allows u to set up custom tag function names that will be recognized as CSS and thus highlighted.

I know that's not what you exatcly was asking, just for the case you have encountered a problem and needed any solution.

VitalyKrenel avatar Jun 17 '19 12:06 VitalyKrenel

I discovered this recently. Thanks

pr1ntr avatar Jun 19 '19 20:06 pr1ntr