styled-components / vim-styled-components

Vim bundle for http://styled-components.com based javascript files.
300 stars 24 forks source link

Styling breaks when using passed prop with backticks helpers #81

Open pjg opened 2 years ago

pjg commented 2 years ago

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).

christopher-francisco commented 2 years ago

Same issue here

arantebw commented 1 year ago

I have that same problem as well.