Skip to content

Typescript: using the css helper with generics breaks syntax highlighting #82

@stevematney

Description

@stevematney

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};
  `}
`;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions