Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Styling breaks when using passed prop with backticks helpers #81

Open
pjg opened this issue Oct 1, 2021 · 2 comments
Open

Styling breaks when using passed prop with backticks helpers #81

pjg opened this issue Oct 1, 2021 · 2 comments

Comments

@pjg
Copy link

pjg commented Oct 1, 2021

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
Copy link

Same issue here

@arantebw
Copy link

arantebw commented Mar 7, 2023

I have that same problem as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants