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

Highligth breaks when not using styled css helper

Open stg101 opened this issue 3 years ago • 3 comments

Describe the bug (including copyable syntax) Highligth breaks when not using styled css helper (see screenshots)

Screenshot Screenshots are alway useful!

whit css helper image

whiteout css helper image

To Reproduce

with css helper

export const S_DualInput = styled.div`
    display: flex;
    .left {
        border-radius: 5px 0px 0px 5px;
        ${props =>
            props.primary === 'left' &&
            css`
                background: ${colors.BLUE};
                color: white;
            `};
        ${props =>
            props.primary === 'right' &&
            css`
                background-color: white;
                color: ${colors.BLUE};
                border: solid;
                border-color: ${colors.BLUE};
                border-width: 1.5px;
            `};
    }
`

without css helper

export const S_DualInput = styled.div`
    display: flex;
    .left {
        border-radius: 5px 0px 0px 5px;
        ${props =>
            props.primary === 'left' &&
            `
                background: ${colors.BLUE};
                color: white;
            `};
        ${props =>
            props.primary === 'right' &&
            `
                background-color: white;
                color: ${colors.BLUE};
                border: solid;
                border-color: ${colors.BLUE};
                border-width: 1.5px;
            `};
    }
`

Expected behavior Highlight to work. Styled don't need the css helper to work there https://styled-components.com/docs/api#css

Build environment (please complete the following information):

  • OS: Windows 10 Pro
  • VSCode Version: 1.51.1
  • Extension Version 1.4.0

Additional context Add any other context about the problem here.

stg101 avatar Dec 07 '20 15:12 stg101

+1

Avivhdr avatar Dec 12 '20 13:12 Avivhdr

https://github.com/styled-components/vscode-styled-components/issues/261

Avivhdr avatar Dec 12 '20 13:12 Avivhdr

This will solve your problem: https://github.com/Microsoft/typescript-styled-plugin#tags

Profesor08 avatar Jun 14 '21 20:06 Profesor08