elements.less 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*---------------------------------------------------
  2. LESS Elements 0.6
  3. ---------------------------------------------------
  4. A set of useful LESS mixins by Dmitry Fadeyev
  5. Special thanks for mixin suggestions to:
  6. Kris Van Herzeele,
  7. Benoit Adam,
  8. Portenart Emile-Victor,
  9. Ryan Faerman
  10. More info at: http://lesselements.com
  11. -----------------------------------------------------*/
  12. .gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
  13. background: @color;
  14. background: -webkit-gradient(linear,
  15. left bottom,
  16. left top,
  17. color-stop(0, @start),
  18. color-stop(1, @stop));
  19. background: -ms-linear-gradient(bottom,
  20. @start,
  21. @stop);
  22. background: -moz-linear-gradient(center bottom,
  23. @start 0%,
  24. @stop 100%);
  25. }
  26. .bw-gradient(@color: #F5F5F5, @start: 0, @stop: 255) {
  27. background: @color;
  28. background: -webkit-gradient(linear,
  29. left bottom,
  30. left top,
  31. color-stop(0, rgb(@start,@start,@start)),
  32. color-stop(1, rgb(@stop,@stop,@stop)));
  33. background: -ms-linear-gradient(bottom,
  34. rgb(@start,@start,@start) 0%,
  35. rgb(@start,@start,@start) 100%);
  36. background: -moz-linear-gradient(center bottom,
  37. rgb(@start,@start,@start) 0%,
  38. rgb(@stop,@stop,@stop) 100%);
  39. }
  40. .bordered(@top-color: #EEE, @right-color: #EEE, @bottom-color: #EEE, @left-color: #EEE) {
  41. border-top: solid 1px @top-color;
  42. border-left: solid 1px @left-color;
  43. border-right: solid 1px @right-color;
  44. border-bottom: solid 1px @bottom-color;
  45. }
  46. .drop-shadow(@x-axis: 0, @y-axis: 1px, @blur: 2px, @alpha: 0.1) {
  47. -webkit-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
  48. -moz-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
  49. box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
  50. }
  51. .rounded(@radius: 2px) {
  52. -webkit-border-radius: @radius;
  53. -moz-border-radius: @radius;
  54. border-radius: @radius;
  55. -moz-background-clip: padding; -webkit-background-clip: padding-box; background-clip: padding-box;
  56. }
  57. .border-radius(@topright: 0, @bottomright: 0, @bottomleft: 0, @topleft: 0) {
  58. -webkit-border-top-right-radius: @topright;
  59. -webkit-border-bottom-right-radius: @bottomright;
  60. -webkit-border-bottom-left-radius: @bottomleft;
  61. -webkit-border-top-left-radius: @topleft;
  62. -moz-border-radius-topright: @topright;
  63. -moz-border-radius-bottomright: @bottomright;
  64. -moz-border-radius-bottomleft: @bottomleft;
  65. -moz-border-radius-topleft: @topleft;
  66. border-top-right-radius: @topright;
  67. border-bottom-right-radius: @bottomright;
  68. border-bottom-left-radius: @bottomleft;
  69. border-top-left-radius: @topleft;
  70. -moz-background-clip: padding; -webkit-background-clip: padding-box; background-clip: padding-box;
  71. }
  72. .opacity(@opacity: 0.5) {
  73. -moz-opacity: @opacity;
  74. -khtml-opacity: @opacity;
  75. -webkit-opacity: @opacity;
  76. opacity: @opacity;
  77. }
  78. .transition-duration(@duration: 0.2s) {
  79. -moz-transition-duration: @duration;
  80. -webkit-transition-duration: @duration;
  81. transition-duration: @duration;
  82. }
  83. .rotation(@deg:5deg){
  84. -webkit-transform: rotate(@deg);
  85. -moz-transform: rotate(@deg);
  86. transform: rotate(@deg);
  87. }
  88. .scale(@ratio:1.5){
  89. -webkit-transform:scale(@ratio);
  90. -moz-transform:scale(@ratio);
  91. transform:scale(@ratio);
  92. }
  93. .transition(@duration:0.2s, @ease:ease-out) {
  94. -webkit-transition: all @duration @ease;
  95. -moz-transition: all @duration @ease;
  96. transition: all @duration @ease;
  97. }
  98. .inner-shadow(@horizontal:0, @vertical:1px, @blur:2px, @alpha: 0.4) {
  99. -webkit-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
  100. -moz-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
  101. box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
  102. }
  103. .box-shadow(@arguments) {
  104. -webkit-box-shadow: @arguments;
  105. -moz-box-shadow: @arguments;
  106. box-shadow: @arguments;
  107. }
  108. .columns(@colwidth: 250px, @colcount: 0, @colgap: 50px, @columnRuleColor: #EEE, @columnRuleStyle: solid, @columnRuleWidth: 1px) {
  109. -moz-column-width: @colwidth;
  110. -moz-column-count: @colcount;
  111. -moz-column-gap: @colgap;
  112. -moz-column-rule-color: @columnRuleColor;
  113. -moz-column-rule-style: @columnRuleStyle;
  114. -moz-column-rule-width: @columnRuleWidth;
  115. -webkit-column-width: @colwidth;
  116. -webkit-column-count: @colcount;
  117. -webkit-column-gap: @colgap;
  118. -webkit-column-rule-color: @columnRuleColor;
  119. -webkit-column-rule-style: @columnRuleStyle;
  120. -webkit-column-rule-width: @columnRuleWidth;
  121. column-width: @colwidth;
  122. column-count: @colcount;
  123. column-gap: @colgap;
  124. column-rule-color: @columnRuleColor;
  125. column-rule-style: @columnRuleStyle;
  126. column-rule-width: @columnRuleWidth;
  127. }
  128. .translate(@x:0, @y:0) {
  129. -moz-transform: translate(@x, @y);
  130. -webkit-transform: translate(@x, @y);
  131. -o-transform: translate(@x, @y);
  132. -ms-transform: translate(@x, @y);
  133. transform: translate(@x, @y);
  134. }