styled-components / vscode-styled-components

Syntax highlighting for styled-components
MIT License
917 stars 118 forks source link

Doesn't autocomplete when using styled-component's css prop #216

Open sulaiman1073 opened 4 years ago

sulaiman1073 commented 4 years ago

https://styled-components.com/docs/api#css-prop

<div
  css={`
    background: papayawhip;
    color: ${props => props.theme.colors.text};
  `}
/>

vscode

macrozone commented 4 years ago

just found out about that feature :-D

sad that it does not autocomplete in vscode

alexojegu commented 4 years ago

For now I am using:

<div
  css={css`
    background: papayawhip;
    color: ${props => props.theme.colors.text};
  `}
/>

I am not sure if this can fatten transpiled code.

jasonwilliams commented 4 years ago

dupe of https://github.com/styled-components/vscode-styled-components/issues/220

monotykamary commented 3 years ago

dupe of #220

It isn't a duplicate of #220 as the language server does not even recognize the template string to allow autocomplete despite it having syntax highlighting. The only workaround is wrapping the template string with the css function as suggested by @xeladejo.

image