responsive.less 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. /*!
  2. * Bootstrap Responsive v2.0.0
  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. 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: 980px) {
  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: 830px) {
  141. /* Don't do anything fancy to the navbar, just hide stuff
  142. // UNFIX THE TOPBAR
  143. // ----------------
  144. // Remove any padding from the body
  145. body {
  146. padding-top: 0;
  147. }
  148. // Unfix the navbar
  149. .navbar-fixed-top {
  150. position: static;
  151. margin-bottom: @baseLineHeight;
  152. }
  153. .navbar-fixed-top .navbar-inner {
  154. padding: 5px;
  155. }
  156. .navbar .container {
  157. width: auto;
  158. padding: 0;
  159. }
  160. // Account for brand name
  161. .navbar .brand {
  162. padding-left: 10px;
  163. padding-right: 10px;
  164. margin: 0 0 0 -5px;
  165. }
  166. // Nav collapse clears brand
  167. .navbar .nav-collapse {
  168. clear: left;
  169. }
  170. // Block-level the nav
  171. .navbar .nav {
  172. float: none;
  173. margin: 0 0 (@baseLineHeight / 2);
  174. }
  175. .navbar .nav > li {
  176. float: none;
  177. }
  178. .navbar .nav > li > a {
  179. margin-bottom: 2px;
  180. }
  181. .navbar .nav > .divider-vertical {
  182. display: none;
  183. }
  184. // Nav and dropdown links in navbar
  185. .navbar .nav > li > a,
  186. .navbar .dropdown-menu a {
  187. padding: 6px 15px;
  188. font-weight: bold;
  189. color: @navbarLinkColor;
  190. .border-radius(3px);
  191. }
  192. .navbar .dropdown-menu li + li a {
  193. margin-bottom: 2px;
  194. }
  195. .navbar .nav > li > a:hover,
  196. .navbar .dropdown-menu a:hover {
  197. background-color: @navbarBackground;
  198. }
  199. // Dropdowns in the navbar
  200. .navbar .dropdown-menu {
  201. position: static;
  202. top: auto;
  203. left: auto;
  204. float: none;
  205. display: block;
  206. max-width: none;
  207. margin: 0 15px;
  208. padding: 0;
  209. background-color: transparent;
  210. border: none;
  211. .border-radius(0);
  212. .box-shadow(none);
  213. }
  214. .navbar .dropdown-menu:before,
  215. .navbar .dropdown-menu:after {
  216. display: none;
  217. }
  218. .navbar .dropdown-menu .divider {
  219. display: none;
  220. }
  221. // Forms in navbar
  222. .navbar-form,
  223. .navbar-search {
  224. float: none;
  225. padding: (@baseLineHeight / 2) 15px;
  226. margin: (@baseLineHeight / 2) 0;
  227. border-top: 1px solid @navbarBackground;
  228. border-bottom: 1px solid @navbarBackground;
  229. @shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 1px 0 rgba(255,255,255,.1);
  230. .box-shadow(@shadow);
  231. }
  232. // Pull right (secondary) nav content
  233. .navbar .nav.pull-right {
  234. float: none;
  235. margin-left: 0;
  236. }
  237. // Static navbar
  238. .navbar-static .navbar-inner {
  239. padding-left: 10px;
  240. padding-right: 10px;
  241. }
  242. // Navbar button
  243. .btn-navbar {
  244. display: block;
  245. }
  246. */
  247. // Hide everything in the navbar save .brand and toggle button */
  248. .nav-collapse {
  249. overflow: hidden;
  250. height: 0;
  251. display: none !important;
  252. }
  253. }
  254. // DEFAULT DESKTOP
  255. // ---------------
  256. @media (min-width: 980px) {
  257. .nav-collapse.collapse {
  258. height: auto !important;
  259. }
  260. }
  261. // LARGE DESKTOP & UP
  262. // ------------------
  263. @media (min-width: 1200px) {
  264. // Fixed grid
  265. #gridSystem > .generate(12, 70px, 30px);
  266. // Fluid grid
  267. #fluidGridSystem > .generate(12, 5.982905983%, 2.564102564%);
  268. // Input grid
  269. #inputGridSystem > .generate(12, 70px, 30px);
  270. // Thumbnails
  271. .thumbnails {
  272. margin-left: -30px;
  273. }
  274. .thumbnails > li {
  275. margin-left: 30px;
  276. }
  277. }