responsive-utilities.less 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. //
  2. // Responsive: Utility classes
  3. // --------------------------------------------------
  4. // IE10 Metro responsive
  5. // Required for Windows 8 Metro split-screen snapping with IE10
  6. //
  7. // Source: http://timkadlec.com/2012/10/ie10-snap-mode-and-responsive-design/
  8. @-ms-viewport{
  9. width: device-width;
  10. }
  11. // IE10 on Windows Phone 8
  12. // IE10 on WP8 doesn't report CSS pixels, but actual device pixels. In
  13. // other words, say on a Lumia, you'll get 768px as the device width,
  14. // meaning users will see the tablet styles and not phone styles.
  15. //
  16. // Alternatively you can override this with JS (see source below), but
  17. // we won't be doing that here given our limited scope.
  18. //
  19. // Source: http://timkadlec.com/2013/01/windows-phone-8-and-device-width/
  20. @media screen and (max-width: 400px) {
  21. @-ms-viewport{
  22. width: 320px;
  23. }
  24. }
  25. // Hide from screenreaders and browsers
  26. // Credit: HTML5 Boilerplate
  27. .hidden {
  28. display: none !important;
  29. visibility: hidden !important;
  30. }
  31. // Visibility utilities
  32. .visible-xs {
  33. .responsive-invisibility();
  34. @media (max-width: @screen-xs-max) {
  35. .responsive-visibility();
  36. }
  37. &.visible-sm {
  38. @media (min-width: @screen-sm) and (max-width: @screen-sm-max) {
  39. .responsive-visibility();
  40. }
  41. }
  42. &.visible-md {
  43. @media (min-width: @screen-md) and (max-width: @screen-md-max) {
  44. .responsive-visibility();
  45. }
  46. }
  47. &.visible-lg {
  48. @media (min-width: @screen-lg) {
  49. .responsive-visibility();
  50. }
  51. }
  52. }
  53. .visible-sm {
  54. .responsive-invisibility();
  55. &.visible-xs {
  56. @media (max-width: @screen-xs-max) {
  57. .responsive-visibility();
  58. }
  59. }
  60. @media (min-width: @screen-sm) and (max-width: @screen-sm-max) {
  61. .responsive-visibility();
  62. }
  63. &.visible-md {
  64. @media (min-width: @screen-md) and (max-width: @screen-md-max) {
  65. .responsive-visibility();
  66. }
  67. }
  68. &.visible-lg {
  69. @media (min-width: @screen-lg) {
  70. .responsive-visibility();
  71. }
  72. }
  73. }
  74. .visible-md {
  75. .responsive-invisibility();
  76. &.visible-xs {
  77. @media (max-width: @screen-xs-max) {
  78. .responsive-visibility();
  79. }
  80. }
  81. &.visible-sm {
  82. @media (min-width: @screen-sm) and (max-width: @screen-sm-max) {
  83. .responsive-visibility();
  84. }
  85. }
  86. @media (min-width: @screen-md) and (max-width: @screen-md-max) {
  87. .responsive-visibility();
  88. }
  89. &.visible-lg {
  90. @media (min-width: @screen-lg) {
  91. .responsive-visibility();
  92. }
  93. }
  94. }
  95. .visible-lg {
  96. .responsive-invisibility();
  97. &.visible-xs {
  98. @media (max-width: @screen-xs-max) {
  99. .responsive-visibility();
  100. }
  101. }
  102. &.visible-sm {
  103. @media (min-width: @screen-sm) and (max-width: @screen-sm-max) {
  104. .responsive-visibility();
  105. }
  106. }
  107. &.visible-md {
  108. @media (min-width: @screen-md) and (max-width: @screen-md-max) {
  109. .responsive-visibility();
  110. }
  111. }
  112. @media (min-width: @screen-lg) {
  113. .responsive-visibility();
  114. }
  115. }
  116. .hidden-xs {
  117. .responsive-visibility();
  118. @media (max-width: @screen-xs-max) {
  119. .responsive-invisibility();
  120. }
  121. &.hidden-sm {
  122. @media (min-width: @screen-sm) and (max-width: @screen-sm-max) {
  123. .responsive-invisibility();
  124. }
  125. }
  126. &.hidden-md {
  127. @media (min-width: @screen-md) and (max-width: @screen-md-max) {
  128. .responsive-invisibility();
  129. }
  130. }
  131. &.hidden-lg {
  132. @media (min-width: @screen-lg) {
  133. .responsive-invisibility();
  134. }
  135. }
  136. }
  137. .hidden-sm {
  138. .responsive-visibility();
  139. &.hidden-xs {
  140. @media (max-width: @screen-xs-max) {
  141. .responsive-invisibility();
  142. }
  143. }
  144. @media (min-width: @screen-sm) and (max-width: @screen-sm-max) {
  145. .responsive-invisibility();
  146. }
  147. &.hidden-md {
  148. @media (min-width: @screen-md) and (max-width: @screen-md-max) {
  149. .responsive-invisibility();
  150. }
  151. }
  152. &.hidden-lg {
  153. @media (min-width: @screen-lg) {
  154. .responsive-invisibility();
  155. }
  156. }
  157. }
  158. .hidden-md {
  159. .responsive-visibility();
  160. &.hidden-xs {
  161. @media (max-width: @screen-xs-max) {
  162. .responsive-invisibility();
  163. }
  164. }
  165. &.hidden-sm {
  166. @media (min-width: @screen-sm) and (max-width: @screen-sm-max) {
  167. .responsive-invisibility();
  168. }
  169. }
  170. @media (min-width: @screen-md) and (max-width: @screen-md-max) {
  171. .responsive-invisibility();
  172. }
  173. &.hidden-lg {
  174. @media (min-width: @screen-lg) {
  175. .responsive-invisibility();
  176. }
  177. }
  178. }
  179. .hidden-lg {
  180. .responsive-visibility();
  181. &.hidden-xs {
  182. @media (max-width: @screen-xs-max) {
  183. .responsive-invisibility();
  184. }
  185. }
  186. &.hidden-sm {
  187. @media (min-width: @screen-sm) and (max-width: @screen-sm-max) {
  188. .responsive-invisibility();
  189. }
  190. }
  191. &.hidden-md {
  192. @media (min-width: @screen-md) and (max-width: @screen-md-max) {
  193. .responsive-invisibility();
  194. }
  195. }
  196. @media (min-width: @screen-lg) {
  197. .responsive-invisibility();
  198. }
  199. }
  200. // Print utilities
  201. .visible-print {
  202. .responsive-invisibility();
  203. }
  204. @media print {
  205. .visible-print {
  206. .responsive-visibility();
  207. }
  208. .hidden-print {
  209. .responsive-invisibility();
  210. }
  211. }