elements.less 4.5 KB

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