mixins.less.svn-base 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. // Mixins.less
  2. // Snippets of reusable CSS to develop faster and keep code readable
  3. // -----------------------------------------------------------------
  4. // UTILITY MIXINS
  5. // --------------------------------------------------
  6. // Clearfix
  7. // --------
  8. // For clearing floats like a boss h5bp.com/q
  9. .clearfix {
  10. *zoom: 1;
  11. &:before,
  12. &:after {
  13. display: table;
  14. content: "";
  15. }
  16. &:after {
  17. clear: both;
  18. }
  19. }
  20. // Webkit-style focus
  21. // ------------------
  22. .tab-focus() {
  23. // Default
  24. outline: thin dotted #333;
  25. // Webkit
  26. outline: 5px auto -webkit-focus-ring-color;
  27. outline-offset: -2px;
  28. }
  29. // Center-align a block level element
  30. // ----------------------------------
  31. .center-block() {
  32. display: block;
  33. margin-left: auto;
  34. margin-right: auto;
  35. }
  36. // IE7 inline-block
  37. // ----------------
  38. .ie7-inline-block() {
  39. *display: inline; /* IE7 inline-block hack */
  40. *zoom: 1;
  41. }
  42. // IE7 likes to collapse whitespace on either side of the inline-block elements.
  43. // Ems because we're attempting to match the width of a space character. Left
  44. // version is for form buttons, which typically come after other elements, and
  45. // right version is for icons, which come before. Applying both is ok, but it will
  46. // mean that space between those elements will be .6em (~2 space characters) in IE7,
  47. // instead of the 1 space in other browsers.
  48. .ie7-restore-left-whitespace() {
  49. *margin-left: .3em;
  50. &:first-child {
  51. *margin-left: 0;
  52. }
  53. }
  54. .ie7-restore-right-whitespace() {
  55. *margin-right: .3em;
  56. &:last-child {
  57. *margin-left: 0;
  58. }
  59. }
  60. // Sizing shortcuts
  61. // -------------------------
  62. .size(@height, @width) {
  63. width: @width;
  64. height: @height;
  65. }
  66. .square(@size) {
  67. .size(@size, @size);
  68. }
  69. // Placeholder text
  70. // -------------------------
  71. .placeholder(@color: @placeholderText) {
  72. :-moz-placeholder {
  73. color: @color;
  74. }
  75. ::-webkit-input-placeholder {
  76. color: @color;
  77. }
  78. }
  79. // Text overflow
  80. // -------------------------
  81. // Requires inline-block or block for proper styling
  82. .text-overflow() {
  83. overflow: hidden;
  84. text-overflow: ellipsis;
  85. white-space: nowrap;
  86. }
  87. // CSS image replacement
  88. // -------------------------
  89. // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
  90. .hide-text {
  91. font: 0/0 a;
  92. color: transparent;
  93. text-shadow: none;
  94. background-color: transparent;
  95. border: 0;
  96. }
  97. // FONTS
  98. // --------------------------------------------------
  99. #font {
  100. #family {
  101. .serif() {
  102. font-family: @serifFontFamily;
  103. }
  104. .sans-serif() {
  105. font-family: @sansFontFamily;
  106. }
  107. .monospace() {
  108. font-family: @monoFontFamily;
  109. }
  110. }
  111. .shorthand(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
  112. font-size: @size;
  113. font-weight: @weight;
  114. line-height: @lineHeight;
  115. }
  116. .serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
  117. #font > #family > .serif;
  118. #font > .shorthand(@size, @weight, @lineHeight);
  119. }
  120. .sans-serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
  121. #font > #family > .sans-serif;
  122. #font > .shorthand(@size, @weight, @lineHeight);
  123. }
  124. .monospace(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
  125. #font > #family > .monospace;
  126. #font > .shorthand(@size, @weight, @lineHeight);
  127. }
  128. }
  129. // FORMS
  130. // --------------------------------------------------
  131. // Block level inputs
  132. .input-block-level {
  133. display: block;
  134. width: 100%;
  135. min-height: 28px; // Make inputs at least the height of their button counterpart
  136. .box-sizing(border-box); // Makes inputs behave like true block-level elements
  137. }
  138. // Mixin for form field states
  139. .formFieldState(@textColor: #555, @borderColor: #ccc, @backgroundColor: #f5f5f5) {
  140. // Set the text color
  141. > label,
  142. .help-block,
  143. .help-inline {
  144. color: @textColor;
  145. }
  146. // Style inputs accordingly
  147. input,
  148. select,
  149. textarea {
  150. color: @textColor;
  151. border-color: @borderColor;
  152. &:focus {
  153. border-color: darken(@borderColor, 10%);
  154. .box-shadow(0 0 6px lighten(@borderColor, 20%));
  155. }
  156. }
  157. // Give a small background color for input-prepend/-append
  158. .input-prepend .add-on,
  159. .input-append .add-on {
  160. color: @textColor;
  161. background-color: @backgroundColor;
  162. border-color: @textColor;
  163. }
  164. }
  165. // CSS3 PROPERTIES
  166. // --------------------------------------------------
  167. // Border Radius
  168. .border-radius(@radius) {
  169. -webkit-border-radius: @radius;
  170. -moz-border-radius: @radius;
  171. border-radius: @radius;
  172. }
  173. // Drop shadows
  174. .box-shadow(@shadow) {
  175. -webkit-box-shadow: @shadow;
  176. -moz-box-shadow: @shadow;
  177. box-shadow: @shadow;
  178. }
  179. // Transitions
  180. .transition(@transition) {
  181. -webkit-transition: @transition;
  182. -moz-transition: @transition;
  183. -ms-transition: @transition;
  184. -o-transition: @transition;
  185. transition: @transition;
  186. }
  187. // Transformations
  188. .rotate(@degrees) {
  189. -webkit-transform: rotate(@degrees);
  190. -moz-transform: rotate(@degrees);
  191. -ms-transform: rotate(@degrees);
  192. -o-transform: rotate(@degrees);
  193. transform: rotate(@degrees);
  194. }
  195. .scale(@ratio) {
  196. -webkit-transform: scale(@ratio);
  197. -moz-transform: scale(@ratio);
  198. -ms-transform: scale(@ratio);
  199. -o-transform: scale(@ratio);
  200. transform: scale(@ratio);
  201. }
  202. .translate(@x, @y) {
  203. -webkit-transform: translate(@x, @y);
  204. -moz-transform: translate(@x, @y);
  205. -ms-transform: translate(@x, @y);
  206. -o-transform: translate(@x, @y);
  207. transform: translate(@x, @y);
  208. }
  209. .skew(@x, @y) {
  210. -webkit-transform: skew(@x, @y);
  211. -moz-transform: skew(@x, @y);
  212. -ms-transform: skew(@x, @y);
  213. -o-transform: skew(@x, @y);
  214. transform: skew(@x, @y);
  215. }
  216. .translate3d(@x, @y, @z) {
  217. -webkit-transform: translate(@x, @y, @z);
  218. -moz-transform: translate(@x, @y, @z);
  219. -ms-transform: translate(@x, @y, @z);
  220. -o-transform: translate(@x, @y, @z);
  221. transform: translate(@x, @y, @z);
  222. }
  223. // Backface visibility
  224. // Prevent browsers from flickering when using CSS 3D transforms.
  225. // Default value is `visible`, but can be changed to `hidden
  226. // See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples
  227. .backface-visibility(@visibility){
  228. -webkit-backface-visibility: @visibility;
  229. -moz-backface-visibility: @visibility;
  230. -ms-backface-visibility: @visibility;
  231. backface-visibility: @visibility;
  232. }
  233. // Background clipping
  234. // Heads up: FF 3.6 and under need "padding" instead of "padding-box"
  235. .background-clip(@clip) {
  236. -webkit-background-clip: @clip;
  237. -moz-background-clip: @clip;
  238. background-clip: @clip;
  239. }
  240. // Background sizing
  241. .background-size(@size){
  242. -webkit-background-size: @size;
  243. -moz-background-size: @size;
  244. -o-background-size: @size;
  245. background-size: @size;
  246. }
  247. // Box sizing
  248. .box-sizing(@boxmodel) {
  249. -webkit-box-sizing: @boxmodel;
  250. -moz-box-sizing: @boxmodel;
  251. -ms-box-sizing: @boxmodel;
  252. box-sizing: @boxmodel;
  253. }
  254. // User select
  255. // For selecting text on the page
  256. .user-select(@select) {
  257. -webkit-user-select: @select;
  258. -moz-user-select: @select;
  259. -ms-user-select: @select;
  260. -o-user-select: @select;
  261. user-select: @select;
  262. }
  263. // Resize anything
  264. .resizable(@direction) {
  265. resize: @direction; // Options: horizontal, vertical, both
  266. overflow: auto; // Safari fix
  267. }
  268. // CSS3 Content Columns
  269. .content-columns(@columnCount, @columnGap: @gridGutterWidth) {
  270. -webkit-column-count: @columnCount;
  271. -moz-column-count: @columnCount;
  272. column-count: @columnCount;
  273. -webkit-column-gap: @columnGap;
  274. -moz-column-gap: @columnGap;
  275. column-gap: @columnGap;
  276. }
  277. // Opacity
  278. .opacity(@opacity) {
  279. opacity: @opacity / 100;
  280. filter: ~"alpha(opacity=@{opacity})";
  281. }
  282. // BACKGROUNDS
  283. // --------------------------------------------------
  284. // Add an alphatransparency value to any background or border color (via Elyse Holladay)
  285. #translucent {
  286. .background(@color: @white, @alpha: 1) {
  287. background-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha);
  288. }
  289. .border(@color: @white, @alpha: 1) {
  290. border-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha);
  291. .background-clip(padding-box);
  292. }
  293. }
  294. // Gradient Bar Colors for buttons and alerts
  295. .gradientBar(@primaryColor, @secondaryColor) {
  296. #gradient > .vertical(@primaryColor, @secondaryColor);
  297. border-color: @secondaryColor @secondaryColor darken(@secondaryColor, 15%);
  298. border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);
  299. }
  300. // Gradients
  301. #gradient {
  302. .horizontal(@startColor: #555, @endColor: #333) {
  303. background-color: @endColor;
  304. background-image: -moz-linear-gradient(left, @startColor, @endColor); // FF 3.6+
  305. background-image: -ms-linear-gradient(left, @startColor, @endColor); // IE10
  306. background-image: -webkit-gradient(linear, 0 0, 100% 0, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
  307. background-image: -webkit-linear-gradient(left, @startColor, @endColor); // Safari 5.1+, Chrome 10+
  308. background-image: -o-linear-gradient(left, @startColor, @endColor); // Opera 11.10
  309. background-image: linear-gradient(left, @startColor, @endColor); // Le standard
  310. background-repeat: repeat-x;
  311. filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",@startColor,@endColor)); // IE9 and down
  312. }
  313. .vertical(@startColor: #555, @endColor: #333) {
  314. background-color: mix(@startColor, @endColor, 60%);
  315. background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+
  316. background-image: -ms-linear-gradient(top, @startColor, @endColor); // IE10
  317. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
  318. background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+
  319. background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10
  320. background-image: linear-gradient(top, @startColor, @endColor); // The standard
  321. background-repeat: repeat-x;
  322. filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@startColor,@endColor)); // IE9 and down
  323. }
  324. .directional(@startColor: #555, @endColor: #333, @deg: 45deg) {
  325. background-color: @endColor;
  326. background-repeat: repeat-x;
  327. background-image: -moz-linear-gradient(@deg, @startColor, @endColor); // FF 3.6+
  328. background-image: -ms-linear-gradient(@deg, @startColor, @endColor); // IE10
  329. background-image: -webkit-linear-gradient(@deg, @startColor, @endColor); // Safari 5.1+, Chrome 10+
  330. background-image: -o-linear-gradient(@deg, @startColor, @endColor); // Opera 11.10
  331. background-image: linear-gradient(@deg, @startColor, @endColor); // The standard
  332. }
  333. .vertical-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) {
  334. background-color: mix(@midColor, @endColor, 80%);
  335. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
  336. background-image: -webkit-linear-gradient(@startColor, @midColor @colorStop, @endColor);
  337. background-image: -moz-linear-gradient(top, @startColor, @midColor @colorStop, @endColor);
  338. background-image: -ms-linear-gradient(@startColor, @midColor @colorStop, @endColor);
  339. background-image: -o-linear-gradient(@startColor, @midColor @colorStop, @endColor);
  340. background-image: linear-gradient(@startColor, @midColor @colorStop, @endColor);
  341. background-repeat: no-repeat;
  342. filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@startColor,@endColor)); // IE9 and down, gets no color-stop at all for proper fallback
  343. }
  344. .radial(@innerColor: #555, @outerColor: #333) {
  345. background-color: @outerColor;
  346. background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@innerColor), to(@outerColor));
  347. background-image: -webkit-radial-gradient(circle, @innerColor, @outerColor);
  348. background-image: -moz-radial-gradient(circle, @innerColor, @outerColor);
  349. background-image: -ms-radial-gradient(circle, @innerColor, @outerColor);
  350. background-image: -o-radial-gradient(circle, @innerColor, @outerColor);
  351. background-repeat: no-repeat;
  352. }
  353. .striped(@color, @angle: -45deg) {
  354. background-color: @color;
  355. background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent));
  356. background-image: -webkit-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
  357. background-image: -moz-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
  358. background-image: -ms-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
  359. background-image: -o-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
  360. background-image: linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
  361. }
  362. }
  363. // Reset filters for IE
  364. .reset-filter() {
  365. filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
  366. }
  367. // COMPONENT MIXINS
  368. // --------------------------------------------------
  369. // Horizontal dividers
  370. // -------------------------
  371. // Dividers (basically an hr) within dropdowns and nav lists
  372. .nav-divider() {
  373. // IE7 needs a set width since we gave a height. Restricting just
  374. // to IE7 to keep the 1px left/right space in other browsers.
  375. // It is unclear where IE is getting the extra space that we need
  376. // to negative-margin away, but so it goes.
  377. *width: 100%;
  378. height: 1px;
  379. margin: ((@baseLineHeight / 2) - 1) 1px; // 8px 1px
  380. *margin: -5px 0 5px;
  381. overflow: hidden;
  382. background-color: #e5e5e5;
  383. border-bottom: 1px solid @white;
  384. }
  385. // Button backgrounds
  386. // ------------------
  387. .buttonBackground(@startColor, @endColor) {
  388. // gradientBar will set the background to a pleasing blend of these, to support IE<=9
  389. .gradientBar(@startColor, @endColor);
  390. *background-color: @endColor; /* Darken IE7 buttons by default so they stand out more given they won't have borders */
  391. .reset-filter();
  392. // in these cases the gradient won't cover the background, so we override
  393. &:hover, &:active, &.active, &.disabled, &[disabled] {
  394. background-color: @endColor;
  395. *background-color: darken(@endColor, 5%);
  396. }
  397. // IE 7 + 8 can't handle box-shadow to show active, so we darken a bit ourselves
  398. &:active,
  399. &.active {
  400. background-color: darken(@endColor, 10%) e("\9");
  401. }
  402. }
  403. // Navbar vertical align
  404. // -------------------------
  405. // Vertically center elements in the navbar.
  406. // Example: an element has a height of 30px, so write out `.navbarVerticalAlign(30px);` to calculate the appropriate top margin.
  407. .navbarVerticalAlign(@elementHeight) {
  408. margin-top: (@navbarHeight - @elementHeight) / 2;
  409. }
  410. // Popover arrows
  411. // -------------------------
  412. // For tipsies and popovers
  413. #popoverArrow {
  414. .top(@arrowWidth: 5px, @color: @black) {
  415. bottom: 0;
  416. left: 50%;
  417. margin-left: -@arrowWidth;
  418. border-left: @arrowWidth solid transparent;
  419. border-right: @arrowWidth solid transparent;
  420. border-top: @arrowWidth solid @color;
  421. }
  422. .left(@arrowWidth: 5px, @color: @black) {
  423. top: 50%;
  424. right: 0;
  425. margin-top: -@arrowWidth;
  426. border-top: @arrowWidth solid transparent;
  427. border-bottom: @arrowWidth solid transparent;
  428. border-left: @arrowWidth solid @color;
  429. }
  430. .bottom(@arrowWidth: 5px, @color: @black) {
  431. top: 0;
  432. left: 50%;
  433. margin-left: -@arrowWidth;
  434. border-left: @arrowWidth solid transparent;
  435. border-right: @arrowWidth solid transparent;
  436. border-bottom: @arrowWidth solid @color;
  437. }
  438. .right(@arrowWidth: 5px, @color: @black) {
  439. top: 50%;
  440. left: 0;
  441. margin-top: -@arrowWidth;
  442. border-top: @arrowWidth solid transparent;
  443. border-bottom: @arrowWidth solid transparent;
  444. border-right: @arrowWidth solid @color;
  445. }
  446. }
  447. // Grid System
  448. // -----------
  449. // Centered container element
  450. .container-fixed() {
  451. margin-right: auto;
  452. margin-left: auto;
  453. .clearfix();
  454. }
  455. // Table columns
  456. .tableColumns(@columnSpan: 1) {
  457. float: none; // undo default grid column styles
  458. width: ((@gridColumnWidth) * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1)) - 16; // 16 is total padding on left and right of table cells
  459. margin-left: 0; // undo default grid column styles
  460. }
  461. // Make a Grid
  462. // Use .makeRow and .makeColumn to assign semantic layouts grid system behavior
  463. .makeRow() {
  464. margin-left: @gridGutterWidth * -1;
  465. .clearfix();
  466. }
  467. .makeColumn(@columns: 1, @offset: 0) {
  468. float: left;
  469. margin-left: (@gridColumnWidth * @offset) + (@gridGutterWidth * (@offset - 1)) + (@gridGutterWidth * 2);
  470. width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
  471. }
  472. // The Grid
  473. #grid {
  474. .core (@gridColumnWidth, @gridGutterWidth) {
  475. .spanX (@index) when (@index > 0) {
  476. (~".span@{index}") { .span(@index); }
  477. .spanX(@index - 1);
  478. }
  479. .spanX (0) {}
  480. .offsetX (@index) when (@index > 0) {
  481. (~".offset@{index}") { .offset(@index); }
  482. .offsetX(@index - 1);
  483. }
  484. .offsetX (0) {}
  485. .offset (@columns) {
  486. margin-left: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns + 1));
  487. }
  488. .span (@columns) {
  489. width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
  490. }
  491. .row {
  492. margin-left: @gridGutterWidth * -1;
  493. .clearfix();
  494. }
  495. [class*="span"] {
  496. float: left;
  497. margin-left: @gridGutterWidth;
  498. }
  499. // Set the container width, and override it for fixed navbars in media queries
  500. .container,
  501. .navbar-fixed-top .container,
  502. .navbar-fixed-bottom .container { .span(@gridColumns); }
  503. // generate .spanX and .offsetX
  504. .spanX (@gridColumns);
  505. .offsetX (@gridColumns);
  506. }
  507. .fluid (@fluidGridColumnWidth, @fluidGridGutterWidth) {
  508. .spanX (@index) when (@index > 0) {
  509. (~".span@{index}") { .span(@index); }
  510. .spanX(@index - 1);
  511. }
  512. .spanX (0) {}
  513. .span (@columns) {
  514. width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1));
  515. *width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%);
  516. }
  517. .row-fluid {
  518. width: 100%;
  519. .clearfix();
  520. [class*="span"] {
  521. .input-block-level();
  522. float: left;
  523. margin-left: @fluidGridGutterWidth;
  524. *margin-left: @fluidGridGutterWidth - (.5 / @gridRowWidth * 100 * 1%);
  525. }
  526. [class*="span"]:first-child {
  527. margin-left: 0;
  528. }
  529. // generate .spanX
  530. .spanX (@gridColumns);
  531. }
  532. }
  533. .input(@gridColumnWidth, @gridGutterWidth) {
  534. .spanX (@index) when (@index > 0) {
  535. (~"input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index}") { .span(@index); }
  536. .spanX(@index - 1);
  537. }
  538. .spanX (0) {}
  539. .span(@columns) {
  540. width: ((@gridColumnWidth) * @columns) + (@gridGutterWidth * (@columns - 1)) - 10;
  541. }
  542. input,
  543. textarea,
  544. .uneditable-input {
  545. margin-left: 0; // override margin-left from core grid system
  546. }
  547. // generate .spanX
  548. .spanX (@gridColumns);
  549. }
  550. }