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

How can you pass props into a component? #19

Open
Skytrobb opened this issue May 28, 2019 · 2 comments
Open

How can you pass props into a component? #19

Skytrobb opened this issue May 28, 2019 · 2 comments

Comments

@Skytrobb
Copy link

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?

@tkh44
Copy link
Member

tkh44 commented Jun 20, 2019

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

@ghost
Copy link

ghost commented Dec 21, 2019

tkh44, you are a lifesaver.

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