responsive.less 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. /*!
  2. * Bootstrap Responsive v2.0.1
  3. *
  4. * Copyright 2012 Twitter, Inc
  5. * Licensed under the Apache License v2.0
  6. * http://www.apache.org/licenses/LICENSE-2.0
  7. *
  8. * Designed and built with all the love in the world @twitter by @mdo and @fat.
  9. */
  10. // Responsive.less
  11. // For phone and tablet devices
  12. // -------------------------------------------------------------
  13. // REPEAT VARIABLES & MIXINS
  14. // -------------------------
  15. // Required since we compile the responsive stuff separately
  16. @import "variables.less"; // Modify this for custom colors, font-sizes, etc
  17. @import "mixins.less";
  18. // RESPONSIVE CLASSES
  19. // ------------------
  20. // Hide from screenreaders and browsers
  21. // Credit: HTML5 Boilerplate
  22. .hidden {
  23. display: none;
  24. visibility: hidden;
  25. }
  26. // UP TO LANDSCAPE PHONE
  27. // ---------------------
  28. @media (max-width: 480px) {
  29. // Smooth out the collapsing/expanding nav
  30. .nav-collapse {
  31. -webkit-transform: translate3d(0, 0, 0); // activate the GPU
  32. }
  33. // Block level the page header small tag for readability
  34. .page-header h1 small {
  35. display: block;
  36. line-height: @baseLineHeight;
  37. }
  38. // Make span* classes full width
  39. input[class*="span"],
  40. select[class*="span"],
  41. textarea[class*="span"],
  42. .uneditable-input {
  43. display: block;
  44. width: 100%;
  45. min-height: 28px; /* Make inputs at least the height of their button counterpart */
  46. /* Makes inputs behave like true block-level elements */
  47. -webkit-box-sizing: border-box; /* Older Webkit */
  48. -moz-box-sizing: border-box; /* Older FF */
  49. -ms-box-sizing: border-box; /* IE8 */
  50. box-sizing: border-box; /* CSS3 spec*/
  51. }
  52. // But don't let it screw up prepend/append inputs
  53. .input-prepend input[class*="span"],
  54. .input-append input[class*="span"] {
  55. width: auto;
  56. }
  57. // Update checkboxes for iOS
  58. input[type="checkbox"],
  59. input[type="radio"] {
  60. border: 1px solid #ccc;
  61. }
  62. // Remove the horizontal form styles
  63. .form-horizontal .control-group > label {
  64. float: none;
  65. width: auto;
  66. padding-top: 0;
  67. text-align: left;
  68. }
  69. // Move over all input controls and content
  70. .form-horizontal .controls {
  71. margin-left: 0;
  72. }
  73. // Move the options list down to align with labels
  74. .form-horizontal .control-list {
  75. padding-top: 0; // has to be padding because margin collaspes
  76. }
  77. // Move over buttons in .form-actions to align with .controls
  78. .form-horizontal .form-actions {
  79. padding-left: 10px;
  80. padding-right: 10px;
  81. }
  82. // Modals
  83. .modal {
  84. position: absolute;
  85. top: 10px;
  86. left: 10px;
  87. right: 10px;
  88. width: auto;
  89. margin: 0;
  90. &.fade.in { top: auto; }
  91. }
  92. .modal-header .close {
  93. padding: 10px;
  94. margin: -10px;
  95. }
  96. // Carousel
  97. .carousel-caption {
  98. position: static;
  99. }
  100. }
  101. // LANDSCAPE PHONE TO SMALL DESKTOP & PORTRAIT TABLET
  102. // --------------------------------------------------
  103. @media (max-width: 767px) {
  104. // GRID & CONTAINERS
  105. // -----------------
  106. // Remove width from containers
  107. .container {
  108. width: auto;
  109. padding: 0 20px;
  110. }
  111. // Fluid rows
  112. .row-fluid {
  113. width: 100%;
  114. }
  115. // Undo negative margin on rows
  116. .row {
  117. margin-left: 0;
  118. }
  119. // Make all columns even
  120. .row > [class*="span"],
  121. .row-fluid > [class*="span"] {
  122. float: none;
  123. display: block;
  124. width: auto;
  125. margin: 0;
  126. }
  127. }
  128. // PORTRAIT TABLET TO DEFAULT DESKTOP
  129. // ----------------------------------
  130. @media (min-width: 768px) and (max-width: 979px) {
  131. // Fixed grid
  132. #gridSystem > .generate(12, 42px, 20px);
  133. // Fluid grid
  134. #fluidGridSystem > .generate(12, 5.801104972%, 2.762430939%);
  135. // Input grid
  136. #inputGridSystem > .generate(12, 42px, 20px);
  137. }
  138. // TABLETS AND BELOW
  139. // -----------------
  140. @media (max-width: 979px) {
  141. // UNFIX THE TOPBAR
  142. // ----------------
  143. // Remove any padding from the body
  144. body {
  145. padding-top: 0;
  146. }
  147. // Unfix the navbar
  148. .navbar-fixed-top {
  149. position: static;
  150. margin-bottom: @baseLineHeight;
  151. }
  152. .navbar-fixed-top .navbar-inner {
  153. padding: 5px;
  154. }
  155. .navbar .container {
  156. width: auto;
  157. padding: 0;
  158. }
  159. // Account for brand name
  160. .navbar .brand {
  161. padding-left: 10px;
  162. padding-right: 10px;
  163. margin: 0 0 0 -5px;
  164. }
  165. // Nav collapse clears brand
  166. .navbar .nav-collapse {
  167. clear: left;
  168. }
  169. // Block-level the nav
  170. .navbar .nav {
  171. float: none;
  172. margin: 0 0 (@baseLineHeight / 2);
  173. }
  174. .navbar .nav > li {
  175. float: none;
  176. }
  177. .navbar .nav > li > a {
  178. margin-bottom: 2px;
  179. }
  180. .navbar .nav > .divider-vertical {
  181. display: none;
  182. }
  183. .navbar .nav .nav-header {
  184. color: @navbarText;
  185. text-shadow: none;
  186. }
  187. // Nav and dropdown links in navbar
  188. .navbar .nav > li > a,
  189. .navbar .dropdown-menu a {
  190. padding: 6px 15px;
  191. font-weight: bold;
  192. color: @navbarLinkColor;
  193. .border-radius(3px);
  194. }
  195. .navbar .dropdown-menu li + li a {
  196. margin-bottom: 2px;
  197. }
  198. .navbar .nav > li > a:hover,
  199. .navbar .dropdown-menu a:hover {
  200. background-color: @navbarBackground;
  201. }
  202. // Dropdowns in the navbar
  203. .navbar .dropdown-menu {
  204. position: static;
  205. top: auto;
  206. left: auto;
  207. float: none;
  208. display: block;
  209. max-width: none;
  210. margin: 0 15px;
  211. padding: 0;
  212. background-color: transparent;
  213. border: none;
  214. .border-radius(0);
  215. .box-shadow(none);
  216. }
  217. .navbar .dropdown-menu:before,
  218. .navbar .dropdown-menu:after {
  219. display: none;
  220. }
  221. .navbar .dropdown-menu .divider {
  222. display: none;
  223. }
  224. // Forms in navbar
  225. .navbar-form,
  226. .navbar-search {
  227. float: none;
  228. padding: (@baseLineHeight / 2) 15px;
  229. margin: (@baseLineHeight / 2) 0;
  230. border-top: 1px solid @navbarBackground;
  231. border-bottom: 1px solid @navbarBackground;
  232. @shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);
  233. .box-shadow(@shadow);
  234. }
  235. // Pull right (secondary) nav content
  236. .navbar .nav.pull-right {
  237. float: none;
  238. margin-left: 0;
  239. }
  240. // Static navbar
  241. .navbar-static .navbar-inner {
  242. padding-left: 10px;
  243. padding-right: 10px;
  244. }
  245. // Navbar button
  246. .btn-navbar {
  247. display: block;
  248. }
  249. // Hide everything in the navbar save .brand and toggle button */
  250. .nav-collapse {
  251. overflow: hidden;
  252. height: 0;
  253. }
  254. }
  255. // DEFAULT DESKTOP
  256. // ---------------
  257. @media (min-width: 980px) {
  258. .nav-collapse.collapse {
  259. height: auto !important;
  260. }
  261. }
  262. // LARGE DESKTOP & UP
  263. // ------------------
  264. @media (min-width: 1200px) {
  265. // Fixed grid
  266. #gridSystem > .generate(12, 70px, 30px);
  267. // Fluid grid
  268. #fluidGridSystem > .generate(12, 5.982905983%, 2.564102564%);
  269. // Input grid
  270. #inputGridSystem > .generate(12, 70px, 30px);
  271. // Thumbnails
  272. .thumbnails {
  273. margin-left: -30px;
  274. }
  275. .thumbnails > li {
  276. margin-left: 30px;
  277. }
  278. }