Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.97 KB | None | 0 0
  1. $mq-extend-flag: true !global;
  2.  
  3. /* ==========================================================================
  4. Responsive
  5. /* ========================================================================== */
  6.  
  7. $phone-min-size: 320px;
  8. $phone-max-size: 767px;
  9. $tablet-min-size: 768px;
  10. $tablet-max-size: 991px;
  11. $laptop-min-size: 992px;
  12. $laptop-max-size: 1279px;
  13. $desktop-min-size: 1280px;
  14. $desktop-max-size: 2520px;
  15. //*****************************************
  16. // MOBILE / MEDIA QUERIES
  17. //*****************************************
  18. @mixin mobile-detect() {
  19. display: none;
  20. @media (max-width: 1024px) and (orientation: landscape), (max-width: 1024px) and (orientation: portrait) {
  21. display: block;
  22. }
  23. }
  24.  
  25. @mixin mq( $mq) {
  26. $found: false;
  27. $mq-extend-flag: false !global;
  28. @each $name,
  29. $breakpoint in $breakpoints {
  30. @if $mq==$name {
  31. $found: true;
  32. @media (max-width: $breakpoint) {
  33. @content;
  34. }
  35. }
  36. }
  37. @if $found==false {
  38. @warn 'Breakpoint #{$mq} doesn\'t exist!';
  39. }
  40. $mq-extend-flag: false !global;
  41. }
  42.  
  43. @mixin retina() {
  44. $mq-extend-flag: false !global;
  45. @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and ( min--moz-device-pixel-ratio: 1.5), only screen and ( -o-min-device-pixel-ratio: 3/2), only screen and ( min-device-pixel-ratio: 1.5), only screen and (min-resolution: 192dpi) {
  46. @content;
  47. }
  48. $mq-extend-flag: true !global;
  49. }
  50. @mixin iphone5SEportrait() {
  51. @media only screen
  52. and (max-width : 350px)
  53. and (max-height : 600px)
  54. and (orientation : portrait) {
  55. @content;
  56. }
  57. }
  58. @mixin iphone6portrait() {
  59. @media only screen
  60. and (max-width : 450px)
  61. and (max-height : 700px)
  62. and (orientation : portrait) {
  63. @content;
  64. }
  65. }
  66. @mixin iphone6andXportrait() {
  67. @media only screen
  68. and (max-width : 450px)
  69. and (max-height : 850px)
  70. and (orientation : portrait) {
  71. @content;
  72. }
  73. }
  74. @mixin tabletPortrait() {
  75. @media only screen
  76. and (max-width: $tablet-max-size)
  77. and (min-width: $tablet-min-size)
  78. and (orientation:portrait) {
  79. @content;
  80. }
  81. }
  82. @mixin tabletLandscape() {
  83. @media only screen
  84. and (max-width: 1024px)
  85. and (min-height : 400px)
  86. and (min-width: $tablet-min-size)
  87. and (orientation:landscape) {
  88. @content;
  89. }
  90. }
  91.  
  92. @mixin middleHeight() {
  93. @media only screen
  94. and (min-height : 520px)
  95. and (max-height : 665px)
  96. and (min-width: $tablet-min-size) {
  97. @content;
  98. }
  99. }
  100.  
  101. @mixin smallLaptop() {
  102. @media only screen
  103. and (max-width: 1366px)
  104. and (min-width: $tablet-max-size)
  105. and (min-height : 665px) {
  106. @content;
  107. }
  108. }
  109.  
  110. // Responsive
  111. @mixin respond-to($media) {
  112. @if $media==phone-min {
  113. @media only screen and (min-width: $phone-min-size) {
  114. @content;
  115. }
  116. }
  117. @else if $media==phone-max {
  118. @media only screen and (max-width: $phone-max-size) {
  119. @content;
  120. }
  121. }
  122. @else if $media==tablet-min {
  123. @media only screen and (min-width: $tablet-min-size) {
  124. @content;
  125. }
  126. }
  127. @else if $media==tablet-max {
  128. @media only screen and (max-width: $tablet-max-size) {
  129. @content;
  130. }
  131. }
  132. @else if $media==tablet-only {
  133. @media only screen and (max-width: $tablet-max-size) and (min-width: $tablet-min-size) {
  134. @content;
  135. }
  136. }
  137. @else if $media==laptop-min {
  138. @media only screen and (min-width: $laptop-min-size) {
  139. @content;
  140. }
  141. }
  142. @else if $media==laptop-max {
  143. @media only screen and (max-width: $laptop-max-size) {
  144. @content;
  145. }
  146. }
  147. @else if $media==laptop-only {
  148. @media only screen and (max-width: $laptop-max-size) and (min-width: $laptop-min-size) {
  149. @content;
  150. }
  151. }
  152. @else if $media==desktop-min {
  153. @media only screen and (min-width: $desktop-min-size) {
  154. @content;
  155. }
  156. }
  157. @else if $media==desktop-max {
  158. @media only screen and (max-width: $desktop-max-size) {
  159. @content;
  160. }
  161. }
  162. @if $media==only-phone {
  163. @media only screen and (min-width: $phone-min-size) and (max-width: $phone-max-size) {
  164. @content;
  165. }
  166. }
  167. @else if $media==only-tablet {
  168. @media only screen and (min-width: $tablet-min-size) and (max-width: $tablet-max-size) {
  169. @content;
  170. }
  171. }
  172. @else if $media==only-laptop {
  173. @media only screen and (min-width: $laptop-min-size) and (max-width: $laptop-max-size) {
  174. @content;
  175. }
  176. }
  177. @else if $media==only-desktop {
  178. @media only screen and (min-width: $desktop-min-size) and (max-width: $desktop-max-size) {
  179. @content;
  180. }
  181. }
  182. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement