facepaint icon indicating copy to clipboard operation
facepaint copied to clipboard

How can you pass props into a component?

Open Skytrobb opened this issue 6 years ago • 2 comments

I'm using facepaint with emotion and I want to be able to pass props into a styled component. With emotion you would normally do this: const TextColumnContainer = styled.div(props => ({ textAlign: props.align || 'center', })); adding a facepaint 'mq' object with all my media queries will break or ignore the css within it. How can I pass props into a styled component that is using facepaint and emotion?

Skytrobb avatar May 28 '19 20:05 Skytrobb

Here is an example. https://codesandbox.io/s/emotion-31vwj

tkh44 avatar Jun 20 '19 19:06 tkh44

tkh44, you are a lifesaver.

ghost avatar Dec 21 '19 10:12 ghost