Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Throwing a "semi-colon expected" error on a seemingly valid syntax #71

@GabeDuarteM

Description

@GabeDuarteM

I have the code below, and ts-styled-plugin is complaining about it, even though it appears to be syntactically valid...

const CardSize = styled.div`
  width: 400px;
  height: 400px;

  @media (max-width: 575px) {
    width: 200px;
    height: 400px;
  }
`

const FlipContainer = styled(CardSize)`
  perspective: 1000px;
`

const Flipper = styled.div`
  transition: 0.6s;
  transform-style: preserve-3d;
  position: relative;
  ${FlipContainer}:hover & { // [ts-styled-plugin] semi-colon expected (on the '{')
    transform: rotateY(180deg);
  } // [ts-styled-plugin] at-rule or selector expected (on the '}')
`

On the Flipper variable, it complains about the { and }, the first error being [ts-styled-plugin] semi-colon expected and the second being [ts-styled-plugin] at-rule or selector expected.

Not sure if it's related, but if I change the Flipper to the code below, it stops complaining about the last line (on the })

const Flipper = styled.div`
  ${FlipContainer}:hover & {
    transform: rotateY(180deg);
  }
`

Any idea why this is happening?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions