Last active
June 25, 2018 08:12
-
-
Save drenther/286eff05fd08fa8cfcbe8020456f6bc6 to your computer and use it in GitHub Desktop.
Media queries in styled-components
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* src/components/UserProfile.js */ | |
. | |
. | |
. | |
/* line 44 */ | |
const breakPoint = '600px'; | |
. | |
. | |
. | |
/* line 53 - 65 */ | |
const Details = styled.div` | |
width: 350px; | |
height: 200px; | |
display: row; | |
margin: 10px; | |
jusify-content: center; | |
align-items: flex-start; | |
color: black; | |
@media (max-width: ${breakPoint}) { | |
width: 280px; | |
} | |
`; | |
. | |
. | |
. | |
/* line 85 - 99 */ | |
export default styled(UserProfile)` | |
padding: 10px; | |
margin: 40px 0; | |
display: flex; | |
position: relative; | |
background: ${getColor('secondary')}; | |
border-radius: 5px; | |
box-sizing: border-box; | |
@media (max-width: ${breakPoint}) { | |
flex-direction: column; | |
justify-content: center; | |
align-items: center; | |
} | |
`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment