Last active
May 13, 2019 05:33
-
-
Save murokaco/4a708ce994ad8748784443d6e802a290 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// -------------------------------------------- | |
// media query | |
// -------------------------------------------- | |
$breakpoint-sm: 414px !default; /*iPhone XR*/ | |
$breakpoint-md: 768px !default; | |
$breakpoint-lg: 1000px !default; | |
$breakpoint-xl: 1240px !default; | |
$breakpoints: ( | |
sm: 'screen and (max-width: #{$breakpoint-sm})', | |
md: 'screen and (max-width: #{$breakpoint-md})', | |
lg: 'screen and (max-width: #{$breakpoint-lg})', | |
xl: 'screen and (max-width: #{$breakpoint-xl})'); | |
@mixin mq($breakpoint: md) { | |
@media #{map-get($breakpoints, $breakpoint)} { | |
@content; | |
} | |
} | |
// -------------------------------------------- | |
// how to use | |
// -------------------------------------------- | |
.hoge { | |
@include mq(sm){ | |
display: flex; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment