Publish HTML quickly. https://html.house
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.
 
 
 
 

156 lines
5.8 KiB

  1. /*---------------------------------------------------
  2. LESS Elements 0.9
  3. ---------------------------------------------------
  4. A set of useful LESS mixins
  5. More info at: http://lesselements.com
  6. ---------------------------------------------------*/
  7. .gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
  8. background: @color;
  9. background: -webkit-gradient(linear,
  10. left bottom,
  11. left top,
  12. color-stop(0, @start),
  13. color-stop(1, @stop));
  14. background: -ms-linear-gradient(bottom,
  15. @start,
  16. @stop);
  17. background: -moz-linear-gradient(center bottom,
  18. @start 0%,
  19. @stop 100%);
  20. background: -o-linear-gradient(@stop,
  21. @start);
  22. filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",@stop,@start));
  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(@stop,@stop,@stop) 100%);
  34. background: -moz-linear-gradient(center bottom,
  35. rgb(@start,@start,@start) 0%,
  36. rgb(@stop,@stop,@stop) 100%);
  37. background: -o-linear-gradient(rgb(@stop,@stop,@stop),
  38. rgb(@start,@start,@start));
  39. filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",rgb(@stop,@stop,@stop),rgb(@start,@start,@start)));
  40. }
  41. .bordered(@top-color: #EEE, @right-color: #EEE, @bottom-color: #EEE, @left-color: #EEE) {
  42. border-top: solid 1px @top-color;
  43. border-left: solid 1px @left-color;
  44. border-right: solid 1px @right-color;
  45. border-bottom: solid 1px @bottom-color;
  46. }
  47. .drop-shadow(@x-axis: 0, @y-axis: 1px, @blur: 2px, @alpha: 0.1) {
  48. -webkit-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
  49. -moz-box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
  50. box-shadow: @x-axis @y-axis @blur rgba(0, 0, 0, @alpha);
  51. }
  52. .rounded(@radius: 2px) {
  53. -webkit-border-radius: @radius;
  54. -moz-border-radius: @radius;
  55. border-radius: @radius;
  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. .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. @opperc: @opacity * 100;
  78. -ms-filter: ~"progid:DXImageTransform.Microsoft.Alpha(opacity=@{opperc})";
  79. filter: ~"alpha(opacity=@{opperc})";
  80. }
  81. .transition-duration(@duration: 0.2s) {
  82. -moz-transition-duration: @duration;
  83. -webkit-transition-duration: @duration;
  84. -o-transition-duration: @duration;
  85. transition-duration: @duration;
  86. }
  87. .transform(...) {
  88. -webkit-transform: @arguments;
  89. -moz-transform: @arguments;
  90. -o-transform: @arguments;
  91. -ms-transform: @arguments;
  92. transform: @arguments;
  93. }
  94. .rotation(@deg:5deg){
  95. .transform(rotate(@deg));
  96. }
  97. .scale(@ratio:1.5){
  98. .transform(scale(@ratio));
  99. }
  100. .transition(@duration:0.2s, @ease:ease-out) {
  101. -webkit-transition: all @duration @ease;
  102. -moz-transition: all @duration @ease;
  103. -o-transition: all @duration @ease;
  104. transition: all @duration @ease;
  105. }
  106. .inner-shadow(@horizontal:0, @vertical:1px, @blur:2px, @alpha: 0.4) {
  107. -webkit-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
  108. -moz-box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
  109. box-shadow: inset @horizontal @vertical @blur rgba(0, 0, 0, @alpha);
  110. }
  111. .box-shadow(@arguments) {
  112. -webkit-box-shadow: @arguments;
  113. -moz-box-shadow: @arguments;
  114. box-shadow: @arguments;
  115. }
  116. .box-sizing(@sizing: border-box) {
  117. -ms-box-sizing: @sizing;
  118. -moz-box-sizing: @sizing;
  119. -webkit-box-sizing: @sizing;
  120. box-sizing: @sizing;
  121. }
  122. .user-select(@argument: none) {
  123. -webkit-user-select: @argument;
  124. -moz-user-select: @argument;
  125. -ms-user-select: @argument;
  126. user-select: @argument;
  127. }
  128. .columns(@colwidth: 250px, @colcount: 0, @colgap: 50px, @columnRuleColor: #EEE, @columnRuleStyle: solid, @columnRuleWidth: 1px) {
  129. -moz-column-width: @colwidth;
  130. -moz-column-count: @colcount;
  131. -moz-column-gap: @colgap;
  132. -moz-column-rule-color: @columnRuleColor;
  133. -moz-column-rule-style: @columnRuleStyle;
  134. -moz-column-rule-width: @columnRuleWidth;
  135. -webkit-column-width: @colwidth;
  136. -webkit-column-count: @colcount;
  137. -webkit-column-gap: @colgap;
  138. -webkit-column-rule-color: @columnRuleColor;
  139. -webkit-column-rule-style: @columnRuleStyle;
  140. -webkit-column-rule-width: @columnRuleWidth;
  141. column-width: @colwidth;
  142. column-count: @colcount;
  143. column-gap: @colgap;
  144. column-rule-color: @columnRuleColor;
  145. column-rule-style: @columnRuleStyle;
  146. column-rule-width: @columnRuleWidth;
  147. }
  148. .translate(@x:0, @y:0) {
  149. .transform(translate(@x, @y));
  150. }
  151. .background-clip(@argument: padding-box) {
  152. -moz-background-clip: @argument;
  153. -webkit-background-clip: @argument;
  154. background-clip: @argument;
  155. }