mixins.less 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. //============================================================
  2. //
  3. // LESS CSS3 Mixins by @soyjavi
  4. //
  5. // @description CSS3 mixins for LESS projects
  6. // @version 1.0.1
  7. //
  8. //============================================================
  9. //============================================================
  10. // Variables
  11. //
  12. @white: #fff;
  13. @black: #000;
  14. @black-active: #000;
  15. @grey: #ccc;
  16. @grey-active: #b5b5b5;
  17. @red: #e33100;
  18. @red-active: #c5280f;
  19. @lightgreen: #91bd09;
  20. @lightgreen-active: #7ea41a;
  21. @green: #009600;
  22. @green-active: #00770e;
  23. @blue: #237fd7;
  24. @blue-active: #1a69b6;
  25. @arcticblue: #2daebf;
  26. @arcticblue-active: #238e9e;
  27. @orange: #ff5c00;
  28. @orange-active: #da4e15;
  29. @purple: #7b658d;
  30. @purple-active: #574765;
  31. @magenta: #a9014b;
  32. @magenta-active: #831239;
  33. @pink: #ff007f;
  34. @pink-active: #de2870;
  35. @yellow: #ffb515;
  36. @yellow-active: #dfa020;
  37. @twitter: #35cdff;
  38. @twitter-active: #2bafda;
  39. @facebook: #3b5998;
  40. @facebook-active: #2c4579;
  41. //============================================================
  42. //============================================================
  43. //
  44. // border-radius
  45. //
  46. // @param top-left-radius : px, em, %;
  47. // @param top-right-radius : px, em, %;
  48. // @param bottom-right-radius : px, em, %;
  49. // @param bottom-left-radius : px, em, %;
  50. //
  51. // @see http://www.w3.org/TR/css3-background/#border-radius
  52. //
  53. //============================================================
  54. .border-radius() {
  55. -webkit-border-radius: @arguments;
  56. border-radius: @arguments;
  57. -webkit-background-clip: padding-box;
  58. background-clip: padding-box;
  59. }
  60. //============================================================
  61. //
  62. // box-shadow
  63. //
  64. // @param colour : #000, rgba, hsla;
  65. // @param horizontal-offset : px, em;
  66. // @param vertical-offset : px, em;
  67. // @param blur-radius : px, em;
  68. // @param spread-distance : px, em,
  69. // @param inset : inset;
  70. //
  71. // @see http://www.w3.org/TR/css3-background/#box-shadow
  72. //
  73. //============================================================
  74. .box-shadow() {
  75. -webkit-box-shadow: @arguments;
  76. box-shadow: @arguments;
  77. }
  78. //============================================================
  79. //
  80. // transform
  81. //
  82. // @param functions : matrix()
  83. // : translate()
  84. // : scale()
  85. // : rotate()
  86. // : skew()
  87. //
  88. // @see http://www.w3.org/TR/css3-2d-transforms/
  89. //
  90. //============================================================
  91. .transform() {
  92. -webkit-transform: @arguments;
  93. transform: @arguments;
  94. }
  95. //============================================================
  96. //
  97. // translate
  98. //
  99. // @param translate-x : px;
  100. // @param translate-y : px;
  101. //
  102. // @see http://www.w3.org/TR/css3-2d-transforms/
  103. //
  104. //============================================================
  105. .translate() {
  106. -webkit-transform: translate(@arguments);
  107. transform: translate(@arguments);
  108. }
  109. //============================================================
  110. //
  111. // scale
  112. //
  113. // @param scale-x : 0.5, 2, etc;
  114. // @param scale-y : 0.5, 2, etc;
  115. //
  116. // @see http://www.w3.org/TR/css3-2d-transforms/
  117. //
  118. //============================================================
  119. .scale() {
  120. -webkit-transform: scale(@arguments);
  121. transform: scale(@arguments);
  122. }
  123. //============================================================
  124. //
  125. // rotate
  126. //
  127. // @param angle : 0deg;
  128. //
  129. // @see http://www.w3.org/TR/css3-2d-transforms/
  130. //
  131. //============================================================
  132. .rotate() {
  133. -webkit-transform: rotate(@arguments);
  134. transform: rotate(@arguments);
  135. }
  136. //============================================================
  137. //
  138. // backface-visibility
  139. //
  140. // @param visibility : visible | hidden;
  141. //
  142. // @see http://www.w3.org/TR/css3-3d-transforms/
  143. //
  144. //============================================================
  145. .backface-visibility() {
  146. -webkit-backface-visibility: @arguments;
  147. backface-visibility: @arguments;
  148. }
  149. //============================================================
  150. //
  151. // transition
  152. //
  153. // @param properties : all, left, opacity, etc;
  154. // @param duration : 1s, 1000ms;
  155. // @param delay : 1s, 1000ms;
  156. // @param easing : linear, ease-in-out, etc;
  157. //
  158. // @see http://www.w3.org/TR/css3-transitions/
  159. //
  160. //============================================================
  161. .transition() {
  162. -webkit-transition: @arguments;
  163. transition: @arguments;
  164. }
  165. //============================================================
  166. //
  167. // transition
  168. //
  169. // @param properties : all, left, opacity, etc;
  170. // @param duration : 1s, 1000ms;
  171. // @param delay : 1s, 1000ms;
  172. // @param easing : linear, ease-in-out, etc;
  173. //
  174. // @see http://www.w3.org/TR/css3-transitions/
  175. //
  176. //============================================================
  177. .user-select() {
  178. -webkit-user-select: @arguments;
  179. user-select: @arguments;
  180. }
  181. //============================================================
  182. //
  183. // easing
  184. //
  185. // Thanks to Robert Penner for his sterling work on easing,
  186. // and to Matthew Lein for converting these functions into
  187. // approximated cubic-bezier functions. Respect.
  188. //
  189. // @see http://robertpenner.com/
  190. // @see http://matthewlein.com/ceaser/
  191. //
  192. //============================================================
  193. // Cubic
  194. @easeInCubic : cubic-bezier(0.550, 0.055, 0.675, 0.190);
  195. @easeOutCubic : cubic-bezier(0.215, 0.610, 0.355, 1.000);
  196. @easeInOutCubic : cubic-bezier(0.645, 0.045, 0.355, 1.000);
  197. // Circ
  198. @easeInCirc : cubic-bezier(0.600, 0.040, 0.980, 0.335);
  199. @easeOutCirc : cubic-bezier(0.075, 0.820, 0.165, 1.000);
  200. @easeInOutCirc : cubic-bezier(0.785, 0.135, 0.150, 0.860);
  201. // Expo
  202. @easeInExpo : cubic-bezier(0.950, 0.050, 0.795, 0.035);
  203. @easeOutExpo : cubic-bezier(0.190, 1.000, 0.220, 1.000);
  204. @easeInOutExpo : cubic-bezier(1.000, 0.000, 0.000, 1.000);
  205. // Quad
  206. @easeInQuad : cubic-bezier(0.550, 0.085, 0.680, 0.530);
  207. @easeOutQuad : cubic-bezier(0.250, 0.460, 0.450, 0.940);
  208. @easeInOutQuad : cubic-bezier(0.455, 0.030, 0.515, 0.955);
  209. // Quart
  210. @easeInQuart : cubic-bezier(0.895, 0.030, 0.685, 0.220);
  211. @easeOutQuart : cubic-bezier(0.165, 0.840, 0.440, 1.000);
  212. @easeInOutQuart : cubic-bezier(0.770, 0.000, 0.175, 1.000);
  213. // Quint
  214. @easeInQuint : cubic-bezier(0.755, 0.050, 0.855, 0.060);
  215. @easeOutQuint : cubic-bezier(0.230, 1.000, 0.320, 1.000);
  216. @easeInOutQuint : cubic-bezier(0.860, 0.000, 0.070, 1.000);
  217. // Sine
  218. @easeInSine : cubic-bezier(0.470, 0.000, 0.745, 0.715);
  219. @easeOutSine : cubic-bezier(0.390, 0.575, 0.565, 1.000);
  220. @easeInOutSine : cubic-bezier(0.445, 0.050, 0.550, 0.950);