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

Multiple referenced styled-components selectors break highlighting for the rest of the file #240

Open
bostrom opened this issue Oct 15, 2019 · 2 comments
Labels

Comments

@bostrom
Copy link

bostrom commented Oct 15, 2019

Referencing multiple child styled-components on the same row breaks syntax highlighting for the rest of the file.

image

Example:

const StyledSection = styled.div`
  background-color: ${({ theme }) => theme.colors.primary};
  text-align: center;
  ${P}, ${H2}, ${H3} {
    color: ${({ theme }) => theme.colors.white};
  }
`;
const HeaderIcon = styled.div`
  display: block;
  align-items: center;
  ${H3} {
    @media (min-width: ${({ theme }) => theme.breakpoints.tablet}) {
      font-size: 1.1rem;
    }
    @media (min-width: ${({ theme }) => theme.breakpoints.desktop}) {
      font-size: 1.5rem;
    }
    font-size: 1.6875rem;
    margin: 0;
  }
`;
@bostrom
Copy link
Author

bostrom commented Oct 17, 2019

Apparently the same applies for using +.

const StyledP = styled.p`
  text-align: center;
  + ${P} {
    color: ${({ theme }) => theme.colors.white};
  }
`;

@borela borela added the bug label Oct 29, 2019
@joshuapaling
Copy link

Related issue with styled components and specific nesting issues:

Screen Shot 2019-11-15 at 10 32 37 am

Screen Shot 2019-11-15 at 10 32 47 am

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

No branches or pull requests

3 participants