responsive-utilities.less 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  1. // stylelint-disable declaration-no-important, at-rule-no-vendor-prefix
  2. //
  3. // Responsive: Utility classes
  4. // --------------------------------------------------
  5. // IE10 in Windows (Phone) 8
  6. //
  7. // Support for responsive views via media queries is kind of borked in IE10, for
  8. // Surface/desktop in split view and for Windows Phone 8. This particular fix
  9. // must be accompanied by a snippet of JavaScript to sniff the user agent and
  10. // apply some conditional CSS to *only* the Surface/desktop Windows 8. Look at
  11. // our Getting Started page for more information on this bug.
  12. //
  13. // For more information, see the following:
  14. //
  15. // Issue: https://github.com/twbs/bootstrap/issues/10497
  16. // Docs: https://getbootstrap.com/docs/3.4/getting-started/#support-ie10-width
  17. // Source: https://timkadlec.com/2013/01/windows-phone-8-and-device-width/
  18. // Source: https://timkadlec.com/2012/10/ie10-snap-mode-and-responsive-design/
  19. @-ms-viewport {
  20. width: device-width;
  21. }
  22. // Visibility utilities
  23. // Note: Deprecated .visible-xs, .visible-sm, .visible-md, and .visible-lg as of v3.2.0
  24. .visible-xs,
  25. .visible-sm,
  26. .visible-md,
  27. .visible-lg {
  28. .responsive-invisibility();
  29. }
  30. .visible-xs-block,
  31. .visible-xs-inline,
  32. .visible-xs-inline-block,
  33. .visible-sm-block,
  34. .visible-sm-inline,
  35. .visible-sm-inline-block,
  36. .visible-md-block,
  37. .visible-md-inline,
  38. .visible-md-inline-block,
  39. .visible-lg-block,
  40. .visible-lg-inline,
  41. .visible-lg-inline-block {
  42. display: none !important;
  43. }
  44. .visible-xs {
  45. @media (max-width: @screen-xs-max) {
  46. .responsive-visibility();
  47. }
  48. }
  49. .visible-xs-block {
  50. @media (max-width: @screen-xs-max) {
  51. display: block !important;
  52. }
  53. }
  54. .visible-xs-inline {
  55. @media (max-width: @screen-xs-max) {
  56. display: inline !important;
  57. }
  58. }
  59. .visible-xs-inline-block {
  60. @media (max-width: @screen-xs-max) {
  61. display: inline-block !important;
  62. }
  63. }
  64. .visible-sm {
  65. @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
  66. .responsive-visibility();
  67. }
  68. }
  69. .visible-sm-block {
  70. @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
  71. display: block !important;
  72. }
  73. }
  74. .visible-sm-inline {
  75. @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
  76. display: inline !important;
  77. }
  78. }
  79. .visible-sm-inline-block {
  80. @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
  81. display: inline-block !important;
  82. }
  83. }
  84. .visible-md {
  85. @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
  86. .responsive-visibility();
  87. }
  88. }
  89. .visible-md-block {
  90. @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
  91. display: block !important;
  92. }
  93. }
  94. .visible-md-inline {
  95. @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
  96. display: inline !important;
  97. }
  98. }
  99. .visible-md-inline-block {
  100. @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
  101. display: inline-block !important;
  102. }
  103. }
  104. .visible-lg {
  105. @media (min-width: @screen-lg-min) {
  106. .responsive-visibility();
  107. }
  108. }
  109. .visible-lg-block {
  110. @media (min-width: @screen-lg-min) {
  111. display: block !important;
  112. }
  113. }
  114. .visible-lg-inline {
  115. @media (min-width: @screen-lg-min) {
  116. display: inline !important;
  117. }
  118. }
  119. .visible-lg-inline-block {
  120. @media (min-width: @screen-lg-min) {
  121. display: inline-block !important;
  122. }
  123. }
  124. .hidden-xs {
  125. @media (max-width: @screen-xs-max) {
  126. .responsive-invisibility();
  127. }
  128. }
  129. .hidden-sm {
  130. @media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) {
  131. .responsive-invisibility();
  132. }
  133. }
  134. .hidden-md {
  135. @media (min-width: @screen-md-min) and (max-width: @screen-md-max) {
  136. .responsive-invisibility();
  137. }
  138. }
  139. .hidden-lg {
  140. @media (min-width: @screen-lg-min) {
  141. .responsive-invisibility();
  142. }
  143. }
  144. // Print utilities
  145. //
  146. // Media queries are placed on the inside to be mixin-friendly.
  147. // Note: Deprecated .visible-print as of v3.2.0
  148. .visible-print {
  149. .responsive-invisibility();
  150. @media print {
  151. .responsive-visibility();
  152. }
  153. }
  154. .visible-print-block {
  155. display: none !important;
  156. @media print {
  157. display: block !important;
  158. }
  159. }
  160. .visible-print-inline {
  161. display: none !important;
  162. @media print {
  163. display: inline !important;
  164. }
  165. }
  166. .visible-print-inline-block {
  167. display: none !important;
  168. @media print {
  169. display: inline-block !important;
  170. }
  171. }
  172. .hidden-print {
  173. @media print {
  174. .responsive-invisibility();
  175. }
  176. }