Created
October 18, 2019 18:40
-
-
Save fmoliveira/c826995b08f57add35a860678ae1e9e7 to your computer and use it in GitHub Desktop.
styled-components media queries
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
/* | |
* source: https://react-brasil.slack.com/archives/C1EDVPBQC/p1571423188462000?thread_ts=1571421080.458800&cid=C1EDVPBQC | |
* author: João Paulo Siqueira Lins | |
*/ | |
import styled from "styled-components" | |
import MediaPoint from "./MediaPoint" | |
const Container = styled.div` | |
display: flex; | |
justify-content: space-between; | |
flex-direction: column; | |
${MediaPoint.Tablet} { | |
flex-direction: row; | |
} | |
`; |
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
/* | |
* source: https://react-brasil.slack.com/archives/C1EDVPBQC/p1571423188462000?thread_ts=1571421080.458800&cid=C1EDVPBQC | |
* author: João Paulo Siqueira Lins | |
*/ | |
const MobileLg = '@media (min-width: 414px)'; | |
const Tablet = '@media (min-width: 768px)'; | |
const DesktopSm = '@media (min-width: 1024px)'; | |
const DesktopLg = '@media (min-width: 1366px)'; // Matches 1366 and 1440 resolutions | |
const DesktopXl = '@media (min-width: 1650px)'; | |
const MediaPoint = { | |
MobileOnly, | |
MobileLg, | |
Tablet, | |
DesktopSm, | |
DesktopLg, | |
DesktopXl | |
}; | |
export default MediaPoint; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment