You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mixins.less 20KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  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;
  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: 5px, @width: 5px) {
  63. width: @width;
  64. height: @height;
  65. }
  66. .square(@size: 5px) {
  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. // FONTS
  80. // --------------------------------------------------
  81. #font {
  82. #family {
  83. .serif() {
  84. font-family: Georgia, "Times New Roman", Times, serif;
  85. }
  86. .sans-serif() {
  87. font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  88. }
  89. .monospace() {
  90. font-family: Menlo, Monaco, "Courier New", monospace;
  91. }
  92. }
  93. .shorthand(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
  94. font-size: @size;
  95. font-weight: @weight;
  96. line-height: @lineHeight;
  97. }
  98. .serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
  99. #font > #family > .serif;
  100. #font > .shorthand(@size, @weight, @lineHeight);
  101. }
  102. .sans-serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
  103. #font > #family > .sans-serif;
  104. #font > .shorthand(@size, @weight, @lineHeight);
  105. }
  106. .monospace(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) {
  107. #font > #family > .monospace;
  108. #font > .shorthand(@size, @weight, @lineHeight);
  109. }
  110. }
  111. // GRID SYSTEM
  112. // --------------------------------------------------
  113. // Site container
  114. // -------------------------
  115. .container-fixed() {
  116. width: @gridRowWidth;
  117. margin-left: auto;
  118. margin-right: auto;
  119. .clearfix();
  120. }
  121. // Le grid system
  122. // -------------------------
  123. #gridSystem {
  124. // Setup the mixins to be used
  125. .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, @columns) {
  126. width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1));
  127. }
  128. .offset(@gridColumnWidth, @gridGutterWidth, @columns) {
  129. margin-left: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1)) + (@gridGutterWidth * 2);
  130. }
  131. .gridColumn(@gridGutterWidth) {
  132. float: left;
  133. margin-left: @gridGutterWidth;
  134. }
  135. // Take these values and mixins, and make 'em do their thang
  136. .generate(@gridColumns, @gridColumnWidth, @gridGutterWidth) {
  137. // Row surrounds the columns
  138. .row {
  139. margin-left: @gridGutterWidth * -1;
  140. .clearfix();
  141. }
  142. // Find all .span# classes within .row and give them the necessary properties for grid columns (supported by all browsers back to IE7, thanks @dhg)
  143. [class*="span"] {
  144. #gridSystem > .gridColumn(@gridGutterWidth);
  145. }
  146. // Default columns
  147. .span1 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 1); }
  148. .span2 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 2); }
  149. .span3 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 3); }
  150. .span4 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 4); }
  151. .span5 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 5); }
  152. .span6 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 6); }
  153. .span7 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 7); }
  154. .span8 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 8); }
  155. .span9 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 9); }
  156. .span10 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 10); }
  157. .span11 { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 11); }
  158. .span12,
  159. .container { #gridSystem > .columns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 12); }
  160. // Offset column options
  161. .offset1 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 1); }
  162. .offset2 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 2); }
  163. .offset3 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 3); }
  164. .offset4 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 4); }
  165. .offset5 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 5); }
  166. .offset6 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 6); }
  167. .offset7 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 7); }
  168. .offset8 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 8); }
  169. .offset9 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 9); }
  170. .offset10 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 10); }
  171. .offset11 { #gridSystem > .offset(@gridColumnWidth, @gridGutterWidth, 11); }
  172. }
  173. }
  174. // Fluid grid system
  175. // -------------------------
  176. #fluidGridSystem {
  177. // Setup the mixins to be used
  178. .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, @columns) {
  179. width: 1% * (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1));
  180. }
  181. .gridColumn(@fluidGridGutterWidth) {
  182. float: left;
  183. margin-left: @fluidGridGutterWidth;
  184. }
  185. // Take these values and mixins, and make 'em do their thang
  186. .generate(@gridColumns, @fluidGridColumnWidth, @fluidGridGutterWidth) {
  187. // Row surrounds the columns
  188. .row-fluid {
  189. width: 100%;
  190. .clearfix();
  191. // Find all .span# classes within .row and give them the necessary properties for grid columns (supported by all browsers back to IE7, thanks @dhg)
  192. > [class*="span"] {
  193. #fluidGridSystem > .gridColumn(@fluidGridGutterWidth);
  194. }
  195. > [class*="span"]:first-child {
  196. margin-left: 0;
  197. }
  198. // Default columns
  199. .span1 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 1); }
  200. .span2 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 2); }
  201. .span3 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 3); }
  202. .span4 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 4); }
  203. .span5 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 5); }
  204. .span6 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 6); }
  205. .span7 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 7); }
  206. .span8 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 8); }
  207. .span9 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 9); }
  208. .span10 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 10); }
  209. .span11 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 11); }
  210. .span12 { #fluidGridSystem > .columns(@fluidGridGutterWidth, @fluidGridColumnWidth, 12); }
  211. }
  212. }
  213. }
  214. // Input grid system
  215. // -------------------------
  216. #inputGridSystem {
  217. .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, @columns) {
  218. width: ((@gridColumnWidth) * @columns) + (@gridGutterWidth * (@columns - 1)) - 10;
  219. }
  220. .generate(@gridColumns, @gridColumnWidth, @gridGutterWidth) {
  221. input,
  222. textarea,
  223. .uneditable-input {
  224. &.span1 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 1); }
  225. &.span2 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 2); }
  226. &.span3 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 3); }
  227. &.span4 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 4); }
  228. &.span5 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 5); }
  229. &.span6 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 6); }
  230. &.span7 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 7); }
  231. &.span8 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 8); }
  232. &.span9 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 9); }
  233. &.span10 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 10); }
  234. &.span11 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 11); }
  235. &.span12 { #inputGridSystem > .inputColumns(@gridGutterWidth, @gridColumnWidth, @gridRowWidth, 12); }
  236. }
  237. }
  238. }
  239. // CSS3 PROPERTIES
  240. // --------------------------------------------------
  241. // Border Radius
  242. .border-radius(@radius: 5px) {
  243. -webkit-border-radius: @radius;
  244. -moz-border-radius: @radius;
  245. border-radius: @radius;
  246. }
  247. // Drop shadows
  248. .box-shadow(@shadow: 0 1px 3px rgba(0,0,0,.25)) {
  249. -webkit-box-shadow: @shadow;
  250. -moz-box-shadow: @shadow;
  251. box-shadow: @shadow;
  252. }
  253. // Transitions
  254. .transition(@transition) {
  255. -webkit-transition: @transition;
  256. -moz-transition: @transition;
  257. -ms-transition: @transition;
  258. -o-transition: @transition;
  259. transition: @transition;
  260. }
  261. // Transformations
  262. .rotate(@degrees) {
  263. -webkit-transform: rotate(@degrees);
  264. -moz-transform: rotate(@degrees);
  265. -ms-transform: rotate(@degrees);
  266. -o-transform: rotate(@degrees);
  267. transform: rotate(@degrees);
  268. }
  269. .scale(@ratio) {
  270. -webkit-transform: scale(@ratio);
  271. -moz-transform: scale(@ratio);
  272. -ms-transform: scale(@ratio);
  273. -o-transform: scale(@ratio);
  274. transform: scale(@ratio);
  275. }
  276. .translate(@x: 0, @y: 0) {
  277. -webkit-transform: translate(@x, @y);
  278. -moz-transform: translate(@x, @y);
  279. -ms-transform: translate(@x, @y);
  280. -o-transform: translate(@x, @y);
  281. transform: translate(@x, @y);
  282. }
  283. .skew(@x: 0, @y: 0) {
  284. -webkit-transform: translate(@x, @y);
  285. -moz-transform: translate(@x, @y);
  286. -ms-transform: translate(@x, @y);
  287. -o-transform: translate(@x, @y);
  288. transform: translate(@x, @y);
  289. }
  290. .skew(@x: 0, @y: 0) {
  291. -webkit-transform: skew(@x, @y);
  292. -moz-transform: skew(@x, @y);
  293. -ms-transform: skew(@x, @y);
  294. -o-transform: skew(@x, @y);
  295. transform: skew(@x, @y);
  296. }
  297. // Background clipping
  298. // Heads up: FF 3.6 and under need "padding" instead of "padding-box"
  299. .background-clip(@clip) {
  300. -webkit-background-clip: @clip;
  301. -moz-background-clip: @clip;
  302. background-clip: @clip;
  303. }
  304. // Background sizing
  305. .background-size(@size){
  306. -webkit-background-size: @size;
  307. -moz-background-size: @size;
  308. -o-background-size: @size;
  309. background-size: @size;
  310. }
  311. // Box sizing
  312. .box-sizing(@boxmodel) {
  313. -webkit-box-sizing: @boxmodel;
  314. -moz-box-sizing: @boxmodel;
  315. box-sizing: @boxmodel;
  316. }
  317. // User select
  318. // For selecting text on the page
  319. .user-select(@select) {
  320. -webkit-user-select: @select;
  321. -moz-user-select: @select;
  322. -o-user-select: @select;
  323. user-select: @select;
  324. }
  325. // Resize anything
  326. .resizable(@direction: both) {
  327. resize: @direction; // Options: horizontal, vertical, both
  328. overflow: auto; // Safari fix
  329. }
  330. // CSS3 Content Columns
  331. .content-columns(@columnCount, @columnGap: @gridColumnGutter) {
  332. -webkit-column-count: @columnCount;
  333. -moz-column-count: @columnCount;
  334. column-count: @columnCount;
  335. -webkit-column-gap: @columnGap;
  336. -moz-column-gap: @columnGap;
  337. column-gap: @columnGap;
  338. }
  339. // Opacity
  340. .opacity(@opacity: 100) {
  341. opacity: @opacity / 100;
  342. filter: e(%("alpha(opacity=%d)", @opacity));
  343. }
  344. // BACKGROUNDS
  345. // --------------------------------------------------
  346. // Add an alphatransparency value to any background or border color (via Elyse Holladay)
  347. #translucent {
  348. .background(@color: @white, @alpha: 1) {
  349. background-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha);
  350. }
  351. .border(@color: @white, @alpha: 1) {
  352. border-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha);
  353. .background-clip(padding-box);
  354. }
  355. }
  356. // Gradient Bar Colors for buttons and alerts
  357. .gradientBar(@primaryColor, @secondaryColor) {
  358. #gradient > .vertical(@primaryColor, @secondaryColor);
  359. border-color: @secondaryColor @secondaryColor darken(@secondaryColor, 15%);
  360. border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);
  361. }
  362. // Gradients
  363. #gradient {
  364. .horizontal(@startColor: #555, @endColor: #333) {
  365. background-color: @endColor;
  366. background-image: -moz-linear-gradient(left, @startColor, @endColor); // FF 3.6+
  367. background-image: -ms-linear-gradient(left, @startColor, @endColor); // IE10
  368. background-image: -webkit-gradient(linear, 0 0, 100% 0, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
  369. background-image: -webkit-linear-gradient(left, @startColor, @endColor); // Safari 5.1+, Chrome 10+
  370. background-image: -o-linear-gradient(left, @startColor, @endColor); // Opera 11.10
  371. background-image: linear-gradient(left, @startColor, @endColor); // Le standard
  372. background-repeat: repeat-x;
  373. filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",@startColor,@endColor)); // IE9 and down
  374. }
  375. .vertical(@startColor: #555, @endColor: #333) {
  376. background-color: mix(@startColor, @endColor, 60%);
  377. background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+
  378. background-image: -ms-linear-gradient(top, @startColor, @endColor); // IE10
  379. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+
  380. background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+
  381. background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10
  382. background-image: linear-gradient(top, @startColor, @endColor); // The standard
  383. background-repeat: repeat-x;
  384. filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@startColor,@endColor)); // IE9 and down
  385. }
  386. .directional(@startColor: #555, @endColor: #333, @deg: 45deg) {
  387. background-color: @endColor;
  388. background-repeat: repeat-x;
  389. background-image: -moz-linear-gradient(@deg, @startColor, @endColor); // FF 3.6+
  390. background-image: -ms-linear-gradient(@deg, @startColor, @endColor); // IE10
  391. background-image: -webkit-linear-gradient(@deg, @startColor, @endColor); // Safari 5.1+, Chrome 10+
  392. background-image: -o-linear-gradient(@deg, @startColor, @endColor); // Opera 11.10
  393. background-image: linear-gradient(@deg, @startColor, @endColor); // The standard
  394. }
  395. .vertical-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) {
  396. background-color: mix(@midColor, @endColor, 80%);
  397. background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor));
  398. background-image: -webkit-linear-gradient(@startColor, @midColor @colorStop, @endColor);
  399. background-image: -moz-linear-gradient(top, @startColor, @midColor @colorStop, @endColor);
  400. background-image: -ms-linear-gradient(@startColor, @midColor @colorStop, @endColor);
  401. background-image: -o-linear-gradient(@startColor, @midColor @colorStop, @endColor);
  402. background-image: linear-gradient(@startColor, @midColor @colorStop, @endColor);
  403. background-repeat: no-repeat;
  404. 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
  405. }
  406. .radial(@innerColor: #555, @outerColor: #333) {
  407. background-color: @outerColor;
  408. background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@innerColor), to(@outerColor));
  409. background-image: -webkit-radial-gradient(circle, @innerColor, @outerColor);
  410. background-image: -moz-radial-gradient(circle, @innerColor, @outerColor);
  411. background-image: -ms-radial-gradient(circle, @innerColor, @outerColor);
  412. background-repeat: no-repeat;
  413. // Opera cannot do radial gradients yet
  414. }
  415. .striped(@color, @angle: -45deg) {
  416. background-color: @color;
  417. 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));
  418. 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);
  419. 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);
  420. 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);
  421. 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);
  422. 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);
  423. }
  424. }
  425. // Reset filters for IE
  426. .reset-filter() {
  427. filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)"));
  428. }
  429. // Mixin for generating button backgrounds
  430. // ---------------------------------------
  431. .buttonBackground(@startColor, @endColor) {
  432. // gradientBar will set the background to a pleasing blend of these, to support IE<=9
  433. .gradientBar(@startColor, @endColor);
  434. .reset-filter();
  435. // in these cases the gradient won't cover the background, so we override
  436. &:hover, &:active, &.active, &.disabled, &[disabled] {
  437. background-color: @endColor;
  438. }
  439. // IE 7 + 8 can't handle box-shadow to show active, so we darken a bit ourselves
  440. &:active,
  441. &.active {
  442. background-color: darken(@endColor, 10%) e("\9");
  443. }
  444. }
  445. // COMPONENT MIXINS
  446. // --------------------------------------------------
  447. // POPOVER ARROWS
  448. // -------------------------
  449. // For tipsies and popovers
  450. #popoverArrow {
  451. .top(@arrowWidth: 5px) {
  452. bottom: 0;
  453. left: 50%;
  454. margin-left: -@arrowWidth;
  455. border-left: @arrowWidth solid transparent;
  456. border-right: @arrowWidth solid transparent;
  457. border-top: @arrowWidth solid @black;
  458. }
  459. .left(@arrowWidth: 5px) {
  460. top: 50%;
  461. right: 0;
  462. margin-top: -@arrowWidth;
  463. border-top: @arrowWidth solid transparent;
  464. border-bottom: @arrowWidth solid transparent;
  465. border-left: @arrowWidth solid @black;
  466. }
  467. .bottom(@arrowWidth: 5px) {
  468. top: 0;
  469. left: 50%;
  470. margin-left: -@arrowWidth;
  471. border-left: @arrowWidth solid transparent;
  472. border-right: @arrowWidth solid transparent;
  473. border-bottom: @arrowWidth solid @black;
  474. }
  475. .right(@arrowWidth: 5px) {
  476. top: 50%;
  477. left: 0;
  478. margin-top: -@arrowWidth;
  479. border-top: @arrowWidth solid transparent;
  480. border-bottom: @arrowWidth solid transparent;
  481. border-right: @arrowWidth solid @black;
  482. }
  483. }