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

Problem with media queries #103

Open
jewe11er opened this issue Jan 21, 2022 · 1 comment
Open

Problem with media queries #103

jewe11er opened this issue Jan 21, 2022 · 1 comment

Comments

@jewe11er
Copy link

  • IDE name and version:
    Webstorm 2021.3.1
  • Styled-components plugin version:
    213.6461.79

Problem description:

Problem with media queries: @media ${({ theme }) => theme.devices.tablet} { margin-top: 0; }

Webstorm shows warning: Property 'margin-top' is allowed only in following media groups: visual

@fyayc-ddo
Copy link

fyayc-ddo commented Aug 12, 2022

  • IDE name and version:
    IntelliJ IDEA 2022.2 (Ultimate Edition)
  • Styled-components plugin version:
    222.3345.108

This works:

styled.div`
  @media (max-width: 1440px) {
    color: green;
  }
`;

whereas

const maxWidth = "(max-width: 1440px)";
styled.div`
  @media ${maxWidth} {
    color: green;
  }
`;

gives

Property 'color' is allowed only in following media groups: visual

This is probably connected to https://github.com/styled-components/webstorm-styled-components#faq

Why am I seeing syntax errors after a template argument?

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

2 participants