elements.less 4.5 KB

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