_backgrounds.scss 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // Mixins: Backgrounds
  3. //
  4. // Background Variant
  5. @mixin background-variant($name, $color) {
  6. #{if(&, "&.bg-#{$name}",".bg-#{$name}")} {
  7. background-color: #{$color} !important;
  8. &,
  9. > a {
  10. color: color-yiq($color) !important;
  11. }
  12. &.btn {
  13. &:hover {
  14. border-color: darken($color, 10%);
  15. color: darken(color-yiq($color), 7.5%);
  16. }
  17. &:not(:disabled):not(.disabled):active,
  18. &:not(:disabled):not(.disabled).active,
  19. &:active,
  20. &.active {
  21. background-color: darken($color, 10%) !important;
  22. border-color: darken($color, 12.5%);
  23. color: color-yiq(darken($color, 10%));
  24. }
  25. }
  26. }
  27. }
  28. // Background Gradient Variant
  29. @mixin background-gradient-variant($name, $color) {
  30. .bg-gradient-#{$name} {
  31. background: $color linear-gradient(180deg, mix($body-bg, $color, 15%), $color) repeat-x !important;
  32. color: color-yiq($color);
  33. &.btn {
  34. &:not(:disabled):not(.disabled):active,
  35. &:not(:disabled):not(.disabled).active,
  36. .show > &.dropdown-toggle {
  37. background-image: none !important;
  38. }
  39. &:hover {
  40. background: $color linear-gradient(180deg, mix($body-bg, darken($color, 7.5%), 15%), darken($color, 7.5%)) repeat-x !important;
  41. border-color: darken($color, 10%);
  42. color: darken(color-yiq($color), 7.5%);
  43. }
  44. &:not(:disabled):not(.disabled):active,
  45. &:not(:disabled):not(.disabled).active,
  46. &:active,
  47. &.active {
  48. background: $color linear-gradient(180deg, mix($body-bg, darken($color, 10%), 15%), darken($color, 10%)) repeat-x !important;
  49. border-color: darken($color, 12.5%);
  50. color: color-yiq(darken($color, 10%));
  51. }
  52. &:disabled,
  53. &.disabled {
  54. background-image: none !important;
  55. border-color: $color;
  56. color: color-yiq($color);
  57. }
  58. }
  59. }
  60. }