mixins.less 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. .gradient-text (@color: #808080, @color1: #999, @color2: #B3B3B3, @color3: #B3B3B3, @color4: #666) {
  2. // fallback for browsers that don't support this
  3. // color: @color;
  4. // makes simple gradient text in webkit browsers
  5. // background: -webkit-gradient(linear, left top, left bottom, from(@colorTop), to(@colorBottom));
  6. // makes a more complex background, allowing iPhone-like text gradients
  7. background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, @color1), color-stop(55%, @color2), color-stop(55%, @color3), color-stop(100%, @color4)); // Safari 4+, Chrome 2+
  8. background-image: -webkit-linear-gradient(top, @color1 0%, @color2 55%, @color3 55%, @color4 100%); // Safari 5.1+, Chrome 10+
  9. -webkit-background-clip: text;
  10. -webkit-text-fill-color: transparent;
  11. }
  12. // Mixin for generating button backgrounds
  13. // ---------------------------------------
  14. .buttonBackgroundThreeColors(@startColor, @midColor, @colorStop, @endColor) {
  15. // gradientBar will set the background to a pleasing blend of these, to support IE<=9
  16. #gradient > .vertical-three-colors(@startColor, @midColor, @colorStop, @endColor);
  17. border-color: @startColor @startColor darken(@endColor, 15%);
  18. border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%);
  19. .reset-filter();
  20. // in these cases the gradient won't cover the background, so we override
  21. &:hover, &:active, &.active, &.disabled, &[disabled] {
  22. background-color: @endColor;
  23. }
  24. // IE 7 + 8 can't handle box-shadow to show active, so we darken a bit ourselves
  25. &:active,
  26. &.active {
  27. background-color: darken(@endColor, 10%) e("\9");
  28. }
  29. }
  30. .icon-size (@size: 12px, @width-multiplier: .9, @height-multiplier: .95) {
  31. i { font-size: @size; }
  32. line-height: @size;
  33. height: @size * @height-multiplier;
  34. text-align: center;
  35. }