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

Styling breaks when using passed prop with backticks helpers

Open pjg opened this issue 2 years ago • 2 comments

Minimal reproducible testcase:

import styled from 'styled-components'

const media = {}

const Container = styled.main`
  padding: 10px;

  transform: translateX(var(--menu-${({ state }) => state}-width));

  ${media.md`
    transform: translateX(0);
  `}
`

const Content = () => {
  const state = 'open'

  return <Container state={state}>X</Container>
}

export default Content

Results in the following breaking of styling right after the backtick for the styled component definition (for the rest of the file):

image

(media is an external helper that I just replaced with an empty object for the purpose of documenting this issue).

pjg avatar Oct 01 '21 12:10 pjg

Same issue here

christopher-francisco avatar Jan 11 '22 08:01 christopher-francisco

I have that same problem as well.

arantebw avatar Mar 07 '23 13:03 arantebw