Skip to content

Instantly share code, notes, and snippets.

@cazuki
Created September 1, 2016 18:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cazuki/6d1605154be1240e8bd312db006bb2ec to your computer and use it in GitHub Desktop.
Save cazuki/6d1605154be1240e8bd312db006bb2ec to your computer and use it in GitHub Desktop.
$width-desktop:1024px;
$width-tablet:768px;
$width-smartphone:568px;
$width-scrollbar:20px;
// Media Queries
@mixin desktop {
//PC表示: 768+20=788px〜
@media only screen and (min-width: $width-tablet + $width-scrollbar) {
@content;
}
}
@mixin tablet {
//タブレット表示: 568+20=588px 〜 768+20–1=787px
@media only screen and (min-width: $width-smartphone + $width-scrollbar) and (max-width: $width-tablet + $width-scrollbar - 1) {
@content;
}
}
@mixin smartphone {
//スマホ表示: 568+20–1=587px 〜
@media only screen and (max-width: $width-smartphone + $width-scrollbar - 1) {
@content;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment