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

Typescript: using the css helper with generics breaks syntax highlighting

Open stevematney opened this issue 2 years ago • 3 comments

Syntax highlighting breaks and reverts to simple string coloration when writing code like this:

export const backgroundColorStyles = css<BackgroundColorStyles>`
  background-color: ${({ backgroundColor }) => backgroundColor};
`;

I've been able to work around the problem by writing nested css calls like this:

export const backgroundColorStyles = css<BackgroundColorStyles>`
  ${({ backgroundColor }) => css`
    background-color: ${backgroundColor};
  `}
`;

stevematney avatar Jun 29 '23 16:06 stevematney

@JESii this might be a good one to take a shot at if you're still interested in trying it out!

stevematney avatar Jun 29 '23 16:06 stevematney

Thanks, @stevematney -- I'm kinda buried ATM, but will see what I can do!

JESii avatar Jun 30 '23 12:06 JESii

No worries! Thanks!

stevematney avatar Jun 30 '23 15:06 stevematney