_gradients.less 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Gradients
  2. #gradient-bg(@color) {
  3. & when (@enable-gradients) {
  4. background: @color linear-gradient(180deg, mix(@body-bg, @color, 15%), @color) repeat-x;
  5. }
  6. & when not (@enable-gradients) {
  7. background-color: @color;
  8. }
  9. }
  10. // Horizontal gradient, from left to right
  11. //
  12. // Creates two color stops, start and end, by specifying a color and position for each color stop.
  13. #gradient-x(@start-color: @gray-700, @end-color: @gray-800, @start-percent: 0%, @end-percent: 100%) {
  14. background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent);
  15. background-repeat: repeat-x;
  16. }
  17. // Vertical gradient, from top to bottom
  18. //
  19. // Creates two color stops, start and end, by specifying a color and position for each color stop.
  20. #gradient-y(@start-color: @gray-700, @end-color: @gray-800, @start-percent: 0%, @end-percent: 100%) {
  21. background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent);
  22. background-repeat: repeat-x;
  23. }
  24. #gradient-directional(@start-color: @gray-700, @end-color: @gray-800, @deg: 45deg) {
  25. background-image: linear-gradient(@deg, @start-color, @end-color);
  26. background-repeat: repeat-x;
  27. }
  28. #gradient-x-three-colors(@start-color: @blue, @mid-color: @purple, @color-stop: 50%, @end-color: @red) {
  29. background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color);
  30. background-repeat: no-repeat;
  31. }
  32. #gradient-y-three-colors(@start-color: @blue, @mid-color: @purple, @color-stop: 50%, @end-color: @red) {
  33. background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color);
  34. background-repeat: no-repeat;
  35. }
  36. #gradient-radial(@inner-color: @gray-700, @outer-color: @gray-800) {
  37. background-image: radial-gradient(circle, @inner-color, @outer-color);
  38. background-repeat: no-repeat;
  39. }
  40. #gradient-striped(@color: fade(@white, 15%), @angle: 45deg) {
  41. background-image: linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent);
  42. }