emotion-js / emotion-js/facepaint

Can We Used with a Named Object?

Open
#21 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
594
Forks
12
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.