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

Can We Used with a Named Object? #21

Open
ghost opened this issue Jan 20, 2020 · 0 comments
Open

Can We Used with a Named Object? #21

ghost opened this issue Jan 20, 2020 · 0 comments

Comments

@ghost
Copy link

ghost commented Jan 20, 2020

The following does not work:

const mq = facepaint({
  _: '@media(min-width: 0px)',
  xs: '@media(min-width: 480px)',
  sm: '@media(min-width: 768px)',
  md: '@media(min-width: 992px)',
  lg: '@media(min-width: 1200px)',
  xl: '@media(min-width: 1600px)',
})

const Test = styled.div`
  background-color: orange;

  ${mq({
    width: { _: '15px', xs: '30px', md: '95px', xl: '158px' },
    height: { _: '15px', xs: '30px', md: '95px', xl: '158px' },
  })};
`

I am wondering, though -- is something like this possible? I.e., is it possible to create an object with named keys that I can use to reference which breakpoints I want to use?

If so, how?

Thanks.

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

0 participants