No Description
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.

_buttons.scss 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. @mixin button-variant($background, $border, $hover-background: darken($background, 0%), $hover-border: darken($border, 0%), $active-background: darken($background, 10%), $active-border: darken($border, 0%)) {
  2. color: color-yiq($background);
  3. @include gradient-bg($background);
  4. border-color: $border;
  5. @include box-shadow($btn-box-shadow);
  6. @include hover {
  7. color: color-yiq($hover-background);
  8. @include gradient-bg($hover-background);
  9. border-color: $hover-border;
  10. }
  11. &:focus,
  12. &.focus {
  13. // Avoid using mixin so we can pass custom focus shadow properly
  14. @if $enable-shadows {
  15. box-shadow: $btn-box-shadow, 0 0 0 $btn-focus-width rgba($border, .5);
  16. }
  17. @else {
  18. box-shadow: 0 0 0 $btn-focus-width rgba($border, .5);
  19. }
  20. } // Disabled comes first so active can properly restyle
  21. &.disabled,
  22. &:disabled {
  23. color: color-yiq($background);
  24. background-color: $background;
  25. border-color: $border;
  26. }
  27. &:not(:disabled):not(.disabled):active,
  28. &:not(:disabled):not(.disabled).active,
  29. .show>&.dropdown-toggle {
  30. color: color-yiq($active-background);
  31. background-color: $active-background;
  32. @if $enable-gradients {
  33. background-image: none; // Remove the gradient for the pressed/active state
  34. }
  35. border-color: $active-border;
  36. &:focus {
  37. // Avoid using mixin so we can pass custom focus shadow properly
  38. @if $enable-shadows {
  39. box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($border, .5);
  40. }
  41. @else {
  42. box-shadow: 0 0 0 $btn-focus-width rgba($border, .5);
  43. }
  44. }
  45. }
  46. }
  47. @mixin button-outline-variant($color, $color-hover: color-yiq($color), $active-background: $color, $active-border: $color) {
  48. color: $color;
  49. background-color: transparent;
  50. background-image: none;
  51. border-color: $color;
  52. &:hover {
  53. color: $color-hover;
  54. background-color: $active-background;
  55. border-color: $active-border;
  56. }
  57. &:focus,
  58. &.focus {
  59. box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
  60. }
  61. &.disabled,
  62. &:disabled {
  63. color: $color;
  64. background-color: transparent;
  65. }
  66. &:not(:disabled):not(.disabled):active,
  67. &:not(:disabled):not(.disabled).active,
  68. .show>&.dropdown-toggle {
  69. color: color-yiq($active-background);
  70. background-color: $active-background;
  71. border-color: $active-border;
  72. &:focus {
  73. // Avoid using mixin so we can pass custom focus shadow properly
  74. @if $enable-shadows and $btn-active-box-shadow !=none {
  75. box-shadow: $btn-active-box-shadow, 0 0 0 $btn-focus-width rgba($color, .5);
  76. }
  77. @else {
  78. box-shadow: 0 0 0 $btn-focus-width rgba($color, .5);
  79. }
  80. }
  81. }
  82. }
  83. // Button sizes
  84. @mixin button-size($padding-y, $padding-x, $font-size, $line-height, $border-radius) {
  85. padding: $padding-y $padding-x;
  86. font-size: $font-size;
  87. line-height: $line-height; // Manually declare to provide an override to the browser default
  88. @if $enable-rounded {
  89. border-radius: $border-radius;
  90. }
  91. @else {
  92. border-radius: 0;
  93. }
  94. }