grid.less 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. //
  2. // Grid system
  3. // --------------------------------------------------
  4. // Set the container width, and override it for fixed navbars in media queries
  5. .container {
  6. .container-fixed();
  7. }
  8. // mobile first defaults
  9. .row {
  10. .make-row();
  11. }
  12. // Common styles for small and large grid columns
  13. .col-xs-1,
  14. .col-xs-2,
  15. .col-xs-3,
  16. .col-xs-4,
  17. .col-xs-5,
  18. .col-xs-6,
  19. .col-xs-7,
  20. .col-xs-8,
  21. .col-xs-9,
  22. .col-xs-10,
  23. .col-xs-11,
  24. .col-xs-12,
  25. .col-sm-1,
  26. .col-sm-2,
  27. .col-sm-3,
  28. .col-sm-4,
  29. .col-sm-5,
  30. .col-sm-6,
  31. .col-sm-7,
  32. .col-sm-8,
  33. .col-sm-9,
  34. .col-sm-10,
  35. .col-sm-11,
  36. .col-sm-12,
  37. .col-md-1,
  38. .col-md-2,
  39. .col-md-3,
  40. .col-md-4,
  41. .col-md-5,
  42. .col-md-6,
  43. .col-md-7,
  44. .col-md-8,
  45. .col-md-9,
  46. .col-md-10,
  47. .col-md-11,
  48. .col-md-12,
  49. .col-lg-1,
  50. .col-lg-2,
  51. .col-lg-3,
  52. .col-lg-4,
  53. .col-lg-5,
  54. .col-lg-6,
  55. .col-lg-7,
  56. .col-lg-8,
  57. .col-lg-9,
  58. .col-lg-10,
  59. .col-lg-11,
  60. .col-lg-12 {
  61. position: relative;
  62. // Prevent columns from collapsing when empty
  63. min-height: 1px;
  64. // Inner gutter via padding
  65. padding-left: (@grid-gutter-width / 2);
  66. padding-right: (@grid-gutter-width / 2);
  67. }
  68. // Extra small grid
  69. //
  70. // Grid classes for extra small devices like smartphones. No offset, push, or
  71. // pull classes are present here due to the size of the target.
  72. //
  73. // Note that `.col-xs-12` doesn't get floated on purpose—there's no need since
  74. // it's full-width.
  75. .col-xs-1,
  76. .col-xs-2,
  77. .col-xs-3,
  78. .col-xs-4,
  79. .col-xs-5,
  80. .col-xs-6,
  81. .col-xs-7,
  82. .col-xs-8,
  83. .col-xs-9,
  84. .col-xs-10,
  85. .col-xs-11 {
  86. float: left;
  87. }
  88. .col-xs-1 { width: percentage((1 / @grid-columns)); }
  89. .col-xs-2 { width: percentage((2 / @grid-columns)); }
  90. .col-xs-3 { width: percentage((3 / @grid-columns)); }
  91. .col-xs-4 { width: percentage((4 / @grid-columns)); }
  92. .col-xs-5 { width: percentage((5 / @grid-columns)); }
  93. .col-xs-6 { width: percentage((6 / @grid-columns)); }
  94. .col-xs-7 { width: percentage((7 / @grid-columns)); }
  95. .col-xs-8 { width: percentage((8 / @grid-columns)); }
  96. .col-xs-9 { width: percentage((9 / @grid-columns)); }
  97. .col-xs-10 { width: percentage((10/ @grid-columns)); }
  98. .col-xs-11 { width: percentage((11/ @grid-columns)); }
  99. .col-xs-12 { width: 100%; }
  100. // Small grid
  101. //
  102. // Columns, offsets, pushes, and pulls for the small device range, from phones
  103. // to tablets.
  104. //
  105. // Note that `.col-sm-12` doesn't get floated on purpose—there's no need since
  106. // it's full-width.
  107. @media (min-width: @screen-tablet) {
  108. .container {
  109. max-width: @container-tablet;
  110. }
  111. .col-sm-1,
  112. .col-sm-2,
  113. .col-sm-3,
  114. .col-sm-4,
  115. .col-sm-5,
  116. .col-sm-6,
  117. .col-sm-7,
  118. .col-sm-8,
  119. .col-sm-9,
  120. .col-sm-10,
  121. .col-sm-11 {
  122. float: left;
  123. }
  124. .col-sm-1 { width: percentage((1 / @grid-columns)); }
  125. .col-sm-2 { width: percentage((2 / @grid-columns)); }
  126. .col-sm-3 { width: percentage((3 / @grid-columns)); }
  127. .col-sm-4 { width: percentage((4 / @grid-columns)); }
  128. .col-sm-5 { width: percentage((5 / @grid-columns)); }
  129. .col-sm-6 { width: percentage((6 / @grid-columns)); }
  130. .col-sm-7 { width: percentage((7 / @grid-columns)); }
  131. .col-sm-8 { width: percentage((8 / @grid-columns)); }
  132. .col-sm-9 { width: percentage((9 / @grid-columns)); }
  133. .col-sm-10 { width: percentage((10/ @grid-columns)); }
  134. .col-sm-11 { width: percentage((11/ @grid-columns)); }
  135. .col-sm-12 { width: 100%; }
  136. // Push and pull columns for source order changes
  137. .col-sm-push-1 { left: percentage((1 / @grid-columns)); }
  138. .col-sm-push-2 { left: percentage((2 / @grid-columns)); }
  139. .col-sm-push-3 { left: percentage((3 / @grid-columns)); }
  140. .col-sm-push-4 { left: percentage((4 / @grid-columns)); }
  141. .col-sm-push-5 { left: percentage((5 / @grid-columns)); }
  142. .col-sm-push-6 { left: percentage((6 / @grid-columns)); }
  143. .col-sm-push-7 { left: percentage((7 / @grid-columns)); }
  144. .col-sm-push-8 { left: percentage((8 / @grid-columns)); }
  145. .col-sm-push-9 { left: percentage((9 / @grid-columns)); }
  146. .col-sm-push-10 { left: percentage((10/ @grid-columns)); }
  147. .col-sm-push-11 { left: percentage((11/ @grid-columns)); }
  148. .col-sm-pull-1 { right: percentage((1 / @grid-columns)); }
  149. .col-sm-pull-2 { right: percentage((2 / @grid-columns)); }
  150. .col-sm-pull-3 { right: percentage((3 / @grid-columns)); }
  151. .col-sm-pull-4 { right: percentage((4 / @grid-columns)); }
  152. .col-sm-pull-5 { right: percentage((5 / @grid-columns)); }
  153. .col-sm-pull-6 { right: percentage((6 / @grid-columns)); }
  154. .col-sm-pull-7 { right: percentage((7 / @grid-columns)); }
  155. .col-sm-pull-8 { right: percentage((8 / @grid-columns)); }
  156. .col-sm-pull-9 { right: percentage((9 / @grid-columns)); }
  157. .col-sm-pull-10 { right: percentage((10/ @grid-columns)); }
  158. .col-sm-pull-11 { right: percentage((11/ @grid-columns)); }
  159. // Offsets
  160. .col-sm-offset-1 { margin-left: percentage((1 / @grid-columns)); }
  161. .col-sm-offset-2 { margin-left: percentage((2 / @grid-columns)); }
  162. .col-sm-offset-3 { margin-left: percentage((3 / @grid-columns)); }
  163. .col-sm-offset-4 { margin-left: percentage((4 / @grid-columns)); }
  164. .col-sm-offset-5 { margin-left: percentage((5 / @grid-columns)); }
  165. .col-sm-offset-6 { margin-left: percentage((6 / @grid-columns)); }
  166. .col-sm-offset-7 { margin-left: percentage((7 / @grid-columns)); }
  167. .col-sm-offset-8 { margin-left: percentage((8 / @grid-columns)); }
  168. .col-sm-offset-9 { margin-left: percentage((9 / @grid-columns)); }
  169. .col-sm-offset-10 { margin-left: percentage((10/ @grid-columns)); }
  170. .col-sm-offset-11 { margin-left: percentage((11/ @grid-columns)); }
  171. }
  172. // Medium grid
  173. //
  174. // Columns, offsets, pushes, and pulls for the desktop device range.
  175. //
  176. // Note that `.col-md-12` doesn't get floated on purpose—there's no need since
  177. // it's full-width.
  178. @media (min-width: @screen-desktop) {
  179. .container {
  180. max-width: @container-desktop;
  181. }
  182. .col-md-1,
  183. .col-md-2,
  184. .col-md-3,
  185. .col-md-4,
  186. .col-md-5,
  187. .col-md-6,
  188. .col-md-7,
  189. .col-md-8,
  190. .col-md-9,
  191. .col-md-10,
  192. .col-md-11 {
  193. float: left;
  194. }
  195. .col-md-1 { width: percentage((1 / @grid-columns)); }
  196. .col-md-2 { width: percentage((2 / @grid-columns)); }
  197. .col-md-3 { width: percentage((3 / @grid-columns)); }
  198. .col-md-4 { width: percentage((4 / @grid-columns)); }
  199. .col-md-5 { width: percentage((5 / @grid-columns)); }
  200. .col-md-6 { width: percentage((6 / @grid-columns)); }
  201. .col-md-7 { width: percentage((7 / @grid-columns)); }
  202. .col-md-8 { width: percentage((8 / @grid-columns)); }
  203. .col-md-9 { width: percentage((9 / @grid-columns)); }
  204. .col-md-10 { width: percentage((10/ @grid-columns)); }
  205. .col-md-11 { width: percentage((11/ @grid-columns)); }
  206. .col-md-12 { width: 100%; }
  207. // Push and pull columns for source order changes
  208. .col-md-push-0 { left: auto; }
  209. .col-md-push-1 { left: percentage((1 / @grid-columns)); }
  210. .col-md-push-2 { left: percentage((2 / @grid-columns)); }
  211. .col-md-push-3 { left: percentage((3 / @grid-columns)); }
  212. .col-md-push-4 { left: percentage((4 / @grid-columns)); }
  213. .col-md-push-5 { left: percentage((5 / @grid-columns)); }
  214. .col-md-push-6 { left: percentage((6 / @grid-columns)); }
  215. .col-md-push-7 { left: percentage((7 / @grid-columns)); }
  216. .col-md-push-8 { left: percentage((8 / @grid-columns)); }
  217. .col-md-push-9 { left: percentage((9 / @grid-columns)); }
  218. .col-md-push-10 { left: percentage((10/ @grid-columns)); }
  219. .col-md-push-11 { left: percentage((11/ @grid-columns)); }
  220. .col-md-pull-0 { right: auto; }
  221. .col-md-pull-1 { right: percentage((1 / @grid-columns)); }
  222. .col-md-pull-2 { right: percentage((2 / @grid-columns)); }
  223. .col-md-pull-3 { right: percentage((3 / @grid-columns)); }
  224. .col-md-pull-4 { right: percentage((4 / @grid-columns)); }
  225. .col-md-pull-5 { right: percentage((5 / @grid-columns)); }
  226. .col-md-pull-6 { right: percentage((6 / @grid-columns)); }
  227. .col-md-pull-7 { right: percentage((7 / @grid-columns)); }
  228. .col-md-pull-8 { right: percentage((8 / @grid-columns)); }
  229. .col-md-pull-9 { right: percentage((9 / @grid-columns)); }
  230. .col-md-pull-10 { right: percentage((10/ @grid-columns)); }
  231. .col-md-pull-11 { right: percentage((11/ @grid-columns)); }
  232. // Offsets
  233. .col-md-offset-0 { margin-left: 0; }
  234. .col-md-offset-1 { margin-left: percentage((1 / @grid-columns)); }
  235. .col-md-offset-2 { margin-left: percentage((2 / @grid-columns)); }
  236. .col-md-offset-3 { margin-left: percentage((3 / @grid-columns)); }
  237. .col-md-offset-4 { margin-left: percentage((4 / @grid-columns)); }
  238. .col-md-offset-5 { margin-left: percentage((5 / @grid-columns)); }
  239. .col-md-offset-6 { margin-left: percentage((6 / @grid-columns)); }
  240. .col-md-offset-7 { margin-left: percentage((7 / @grid-columns)); }
  241. .col-md-offset-8 { margin-left: percentage((8 / @grid-columns)); }
  242. .col-md-offset-9 { margin-left: percentage((9 / @grid-columns)); }
  243. .col-md-offset-10 { margin-left: percentage((10/ @grid-columns)); }
  244. .col-md-offset-11 { margin-left: percentage((11/ @grid-columns)); }
  245. }
  246. // Large grid
  247. //
  248. // Columns, offsets, pushes, and pulls for the large desktop device range.
  249. //
  250. // Note that `.col-lg-12` doesn't get floated on purpose—there's no need since
  251. // it's full-width.
  252. @media (min-width: @screen-lg-desktop) {
  253. .container {
  254. max-width: @container-lg-desktop;
  255. }
  256. .col-lg-1,
  257. .col-lg-2,
  258. .col-lg-3,
  259. .col-lg-4,
  260. .col-lg-5,
  261. .col-lg-6,
  262. .col-lg-7,
  263. .col-lg-8,
  264. .col-lg-9,
  265. .col-lg-10,
  266. .col-lg-11 {
  267. float: left;
  268. }
  269. .col-lg-1 { width: percentage((1 / @grid-columns)); }
  270. .col-lg-2 { width: percentage((2 / @grid-columns)); }
  271. .col-lg-3 { width: percentage((3 / @grid-columns)); }
  272. .col-lg-4 { width: percentage((4 / @grid-columns)); }
  273. .col-lg-5 { width: percentage((5 / @grid-columns)); }
  274. .col-lg-6 { width: percentage((6 / @grid-columns)); }
  275. .col-lg-7 { width: percentage((7 / @grid-columns)); }
  276. .col-lg-8 { width: percentage((8 / @grid-columns)); }
  277. .col-lg-9 { width: percentage((9 / @grid-columns)); }
  278. .col-lg-10 { width: percentage((10/ @grid-columns)); }
  279. .col-lg-11 { width: percentage((11/ @grid-columns)); }
  280. .col-lg-12 { width: 100%; }
  281. // Push and pull columns for source order changes
  282. .col-lg-push-0 { left: auto; }
  283. .col-lg-push-1 { left: percentage((1 / @grid-columns)); }
  284. .col-lg-push-2 { left: percentage((2 / @grid-columns)); }
  285. .col-lg-push-3 { left: percentage((3 / @grid-columns)); }
  286. .col-lg-push-4 { left: percentage((4 / @grid-columns)); }
  287. .col-lg-push-5 { left: percentage((5 / @grid-columns)); }
  288. .col-lg-push-6 { left: percentage((6 / @grid-columns)); }
  289. .col-lg-push-7 { left: percentage((7 / @grid-columns)); }
  290. .col-lg-push-8 { left: percentage((8 / @grid-columns)); }
  291. .col-lg-push-9 { left: percentage((9 / @grid-columns)); }
  292. .col-lg-push-10 { left: percentage((10/ @grid-columns)); }
  293. .col-lg-push-11 { left: percentage((11/ @grid-columns)); }
  294. .col-lg-pull-0 { right: auto; }
  295. .col-lg-pull-1 { right: percentage((1 / @grid-columns)); }
  296. .col-lg-pull-2 { right: percentage((2 / @grid-columns)); }
  297. .col-lg-pull-3 { right: percentage((3 / @grid-columns)); }
  298. .col-lg-pull-4 { right: percentage((4 / @grid-columns)); }
  299. .col-lg-pull-5 { right: percentage((5 / @grid-columns)); }
  300. .col-lg-pull-6 { right: percentage((6 / @grid-columns)); }
  301. .col-lg-pull-7 { right: percentage((7 / @grid-columns)); }
  302. .col-lg-pull-8 { right: percentage((8 / @grid-columns)); }
  303. .col-lg-pull-9 { right: percentage((9 / @grid-columns)); }
  304. .col-lg-pull-10 { right: percentage((10/ @grid-columns)); }
  305. .col-lg-pull-11 { right: percentage((11/ @grid-columns)); }
  306. // Offsets
  307. .col-lg-offset-0 { margin-left: 0; }
  308. .col-lg-offset-1 { margin-left: percentage((1 / @grid-columns)); }
  309. .col-lg-offset-2 { margin-left: percentage((2 / @grid-columns)); }
  310. .col-lg-offset-3 { margin-left: percentage((3 / @grid-columns)); }
  311. .col-lg-offset-4 { margin-left: percentage((4 / @grid-columns)); }
  312. .col-lg-offset-5 { margin-left: percentage((5 / @grid-columns)); }
  313. .col-lg-offset-6 { margin-left: percentage((6 / @grid-columns)); }
  314. .col-lg-offset-7 { margin-left: percentage((7 / @grid-columns)); }
  315. .col-lg-offset-8 { margin-left: percentage((8 / @grid-columns)); }
  316. .col-lg-offset-9 { margin-left: percentage((9 / @grid-columns)); }
  317. .col-lg-offset-10 { margin-left: percentage((10/ @grid-columns)); }
  318. .col-lg-offset-11 { margin-left: percentage((11/ @grid-columns)); }
  319. }