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

Does not support nested classes #2

Closed
itsMapleLeaf opened this issue Sep 28, 2017 · 4 comments · Fixed by #15
Closed

Does not support nested classes #2

itsMapleLeaf opened this issue Sep 28, 2017 · 4 comments · Fixed by #15

Comments

@itsMapleLeaf
Copy link
Contributor

itsMapleLeaf commented Sep 28, 2017

As shown here, regular CSS properties work, but nested classes fail with a syntax error.

const Wrapper = styled.div`
  .some-class {
    /* etc */
  }
`
@Jipperism
Copy link

Would like to see if I can contribute to this, but the repo is not compiling for me at the moment. Fails with:

src/logger.ts(4,33): error TS1005: ';' expected.
src/logger.ts(5,12): error TS1005: ',' expected.
src/logger.ts(5,21): error TS1005: ';' expected.
src/logger.ts(5,27): error TS1109: Expression expected.```

@mjbvz
Copy link
Contributor

mjbvz commented Oct 8, 2017

@Jipperism I suspect the wrong version of tsc is being use. I just pushed bdbf23b which should ensure the compile script uses typescript 2.5.3 for building

As for actually fixing the issue, I suspect the easiest approach will be to use the sass language service instead of the regular css language service. This has the drawback of enabling other sass features in the styled strings but I'm not sure how often these would be hit. Let me know if you have any other ideas on how to fix this or if you have any questions about the code.

@Jipperism
Copy link

It is compiling now, but tests are not running. Is this still due to issue #11? I will look into using the sass language service.

@mjbvz
Copy link
Contributor

mjbvz commented Oct 9, 2017

Yes that #11. As a workaround, try manually installing [email protected] locally into node_modules but compiling using a global version of typescript 2.5

asvetliakov added a commit to asvetliakov/typescript-styled-plugin that referenced this issue Oct 9, 2017
@mjbvz mjbvz closed this as completed in #15 Oct 9, 2017
mjbvz pushed a commit that referenced this issue Jan 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants