Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. // ----
  2. // libsass (v3.1.0-beta)
  3. // ----
  4.  
  5. /*
  6. *
  7. * Media querie mixin
  8. *
  9. * Usage:
  10. * #header {
  11. * color: red;
  12. * @include tablet {
  13. * color: green;
  14. * }
  15. * }
  16. *
  17. */
  18.  
  19. // Breakpoints
  20.  
  21. $mobile-first: false;
  22. $phone-width: 400px;
  23. $tablet-width: 768px;
  24. $desktop-width: 1024px;
  25.  
  26. // Media queries
  27.  
  28. @mixin phone {
  29. @if($mobile-first == true) {
  30. @media only screen and (max-width: #{$tablet-width - 1px}) {
  31. @content;
  32. }
  33. } @else{
  34. @media only screen and (max-width: #{$phone-width}) {
  35. @content;
  36. }
  37. }
  38. }
  39.  
  40. @mixin tablet {
  41. @if($mobile-first == true) {
  42. @media only screen and (min-width: #{$tablet-width}) and (max-width: #{$desktop-width - 1px}) {
  43. @content;
  44. }
  45. } @else{
  46. @media only screen and (max-width: #{$tablet-width}) {
  47. @content;
  48. }
  49. }
  50. }
  51.  
  52. @mixin desktop {
  53. @if ($mobile-first == true) {
  54. @media only screen and (min-width: #{$desktop-width}) {
  55. @content;
  56. }
  57. } @else {
  58. @media only screen and (max-width: #{$tablet-width}) {
  59. @content;
  60. }
  61. }
  62. }
  63.  
  64.  
  65. // retina
  66.  
  67.  
  68. @mixin retina {
  69. @media
  70. only screen and (-webkit-min-device-pixel-ratio: 2),
  71. only screen and (min--moz-device-pixel-ratio: 2),
  72. only screen and (-o-min-device-pixel-ratio: 2/1),
  73. only screen and (min-device-pixel-ratio: 2),
  74. only screen and (min-resolution: 192dpi),
  75. only screen and (min-resolution: 2dppx) {
  76. @content;
  77. }
  78. }
  79.  
  80.  
  81. // print
  82. @mixin print {
  83. @media print {
  84. @content;
  85. }
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement