Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ----
- // libsass (v3.1.0-beta)
- // ----
- /*
- *
- * Media querie mixin
- *
- * Usage:
- * #header {
- * color: red;
- * @include tablet {
- * color: green;
- * }
- * }
- *
- */
- // Breakpoints
- $mobile-first: false;
- $phone-width: 400px;
- $tablet-width: 768px;
- $desktop-width: 1024px;
- // Media queries
- @mixin phone {
- @if($mobile-first == true) {
- @media only screen and (max-width: #{$tablet-width - 1px}) {
- @content;
- }
- } @else{
- @media only screen and (max-width: #{$phone-width}) {
- @content;
- }
- }
- }
- @mixin tablet {
- @if($mobile-first == true) {
- @media only screen and (min-width: #{$tablet-width}) and (max-width: #{$desktop-width - 1px}) {
- @content;
- }
- } @else{
- @media only screen and (max-width: #{$tablet-width}) {
- @content;
- }
- }
- }
- @mixin desktop {
- @if ($mobile-first == true) {
- @media only screen and (min-width: #{$desktop-width}) {
- @content;
- }
- } @else {
- @media only screen and (max-width: #{$tablet-width}) {
- @content;
- }
- }
- }
- // retina
- @mixin retina {
- @media
- only screen and (-webkit-min-device-pixel-ratio: 2),
- only screen and (min--moz-device-pixel-ratio: 2),
- only screen and (-o-min-device-pixel-ratio: 2/1),
- only screen and (min-device-pixel-ratio: 2),
- only screen and (min-resolution: 192dpi),
- only screen and (min-resolution: 2dppx) {
- @content;
- }
- }
- // print
- @mixin print {
- @media print {
- @content;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement