2d8b955e0153a7be1414b2ac27ab1ec3db7b2e2b.svn-base 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // Gradients
  2. // Horizontal gradient, from left to right
  3. //
  4. // Creates two color stops, start and end, by specifying a color and position for each color stop.
  5. // Color stops are not available in IE9.
  6. @mixin gradient-horizontal($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
  7. background-image: linear-gradient(to right, $start-color $start-percent, $end-color $end-percent);
  8. background-repeat: repeat-x;
  9. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9
  10. }
  11. // Vertical gradient, from top to bottom
  12. //
  13. // Creates two color stops, start and end, by specifying a color and position for each color stop.
  14. // Color stops are not available in IE9.
  15. @mixin gradient-vertical($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
  16. background-image: linear-gradient(to bottom, $start-color $start-percent, $end-color $end-percent);
  17. background-repeat: repeat-x;
  18. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9
  19. }
  20. @mixin gradient-directional($start-color: #555, $end-color: #333, $deg: 45deg) {
  21. background-repeat: repeat-x;
  22. background-image: linear-gradient($deg, $start-color, $end-color);
  23. }
  24. @mixin gradient-horizontal-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
  25. background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color);
  26. background-repeat: no-repeat;
  27. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 gets no color-stop at all for proper fallback
  28. }
  29. @mixin gradient-vertical-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
  30. background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color);
  31. background-repeat: no-repeat;
  32. filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 gets no color-stop at all for proper fallback
  33. }
  34. @mixin gradient-radial($inner-color: #555, $outer-color: #333) {
  35. background-image: radial-gradient(circle, $inner-color, $outer-color);
  36. background-repeat: no-repeat;
  37. }
  38. @mixin gradient-striped($color: rgba(255,255,255,.15), $angle: 45deg) {
  39. background-image: linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
  40. }