Skip to content
This repository has been archived by the owner on May 14, 2021. It is now read-only.

No Interpolation Tag For Media Query #217

Closed
Undistraction opened this issue Sep 12, 2018 · 1 comment
Closed

No Interpolation Tag For Media Query #217

Undistraction opened this issue Sep 12, 2018 · 1 comment

Comments

@Undistraction
Copy link

Undistraction commented Sep 12, 2018

Problem

The following code gives three errors:

  • [stylelint] Unexpected duplicate selector ".selector283 ", first used at line 1 (no-duplicate-selectors)
  • [stylelint] Unexpected duplicate selector ".selector283 ", first used at line 1 (no-duplicate-selectors)
  • [stylelint] Unexpected duplicate selector ".selector283 > *", first used at line 4 (no-duplicate-selectors)

screenshot 2018-09-12 18 13 53

const Layout = styled.div`
  ${getQuery(SMALL_UP)} {
    > * {
      flex: 0 1 50%;
    }
  }

  ${getQuery(MEDIUM_UP)} {
    > * {
      flex: 0 1 25%;
    }
  }
`

It would appear that the solution would be to use interpolation tagging, however there is no tag available for a media query. The closest would be selector, however that only removes the error from the first block:

const Layout = styled.div`
  ${/* sc-selector */ getQuery(SMALL_UP)} {
    > * {
      flex: 0 1 50%;
    }
  }

  ${/* sc-selector */ getQuery(MEDIUM_UP)} {
    > * {
      flex: 0 1 25%;
    }
  }
`

screenshot 2018-09-12 18 27 14

@chinesedfan
Copy link
Member

Duplicated of #202.

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

No branches or pull requests

2 participants