_buttons.scss 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. //
  2. // Buttons
  3. // --------------------------------------------------
  4. // Base styles
  5. // --------------------------------------------------
  6. // Core
  7. .btn {
  8. display: inline-block;
  9. font-weight: $btn-font-weight;
  10. line-height: $btn-line-height;
  11. font-size: $font-size-base;
  12. text-align: center;
  13. vertical-align: middle;
  14. cursor: pointer;
  15. border: $input-btn-border-width solid transparent;
  16. @include button-size($btn-padding-y, $btn-padding-x, $font-size-base, $btn-border-radius);
  17. &,
  18. &:active,
  19. &.active {
  20. &:focus,
  21. &.focus {
  22. @include tab-focus();
  23. }
  24. }
  25. @include hover-focus {
  26. text-decoration: none;
  27. }
  28. &.focus {
  29. text-decoration: none;
  30. }
  31. &:active,
  32. &.active {
  33. background-image: none;
  34. outline: 0;
  35. }
  36. &.disabled,
  37. &[disabled],
  38. &:disabled {
  39. cursor: $cursor-disabled;
  40. opacity: .65;
  41. @include box-shadow(none);
  42. }
  43. }
  44. // Button Sizes
  45. // --------------------------------------------------
  46. // Large
  47. .btn-large {
  48. @include button-size($btn-padding-y-lg, $btn-padding-x-lg, $font-size-lg, $btn-border-radius);
  49. }
  50. .btn-small {
  51. @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $font-size-sm, $btn-border-radius);
  52. }
  53. .btn-mini {
  54. @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $font-size-xs, $btn-border-radius);
  55. }
  56. .btn-link {
  57. color: $btn-link-color;
  58. }
  59. // Set the backgrounds
  60. // -------------------------
  61. .btn-primary {
  62. @include buttonBackground($btn-primary-bg, $btn-primary-bg-hl);
  63. }
  64. .btn-secondary {
  65. @include buttonBackground($btn-secondary-bg, $btn-secondary-bg-hl);
  66. }
  67. // Warning appears are orange
  68. .btn-warning {
  69. @include buttonBackground($btn-warning-bg, $btn-warning-bg-hl);
  70. }
  71. // Danger and error appear as red
  72. .btn-danger {
  73. @include buttonBackground($btn-danger-bg, $btn-danger-bg-hl);
  74. }
  75. // Success appears as green
  76. .btn-success {
  77. @include buttonBackground($btn-success-bg, $btn-success-bg-hl);
  78. }
  79. // Info appears as a neutral blue
  80. .btn-secondary {
  81. @include buttonBackground($btn-secondary-bg, $btn-secondary-bg-hl);
  82. }
  83. // Inverse appears as dark gray
  84. .btn-inverse {
  85. @include buttonBackground($btn-inverse-bg, $btn-inverse-bg-hl, $btn-inverse-text-color);
  86. //background: $card-background;
  87. box-shadow: $card-shadow;
  88. //border: 1px solid $tight-form-func-highlight-bg;
  89. }
  90. .btn-outline-primary {
  91. @include button-outline-variant($btn-primary-bg);
  92. }
  93. .btn-outline-secondary {
  94. @include button-outline-variant($btn-secondary-bg);
  95. }
  96. .btn-outline-inverse {
  97. @include button-outline-variant($btn-inverse-bg);
  98. }
  99. .btn-outline-success {
  100. @include button-outline-variant($btn-success-bg);
  101. }
  102. .btn-outline-warning {
  103. @include button-outline-variant($btn-warning-bg);
  104. }
  105. .btn-outline-danger {
  106. @include button-outline-variant($btn-danger-bg);
  107. }
  108. .btn-outline-disabled {
  109. @include button-outline-variant($gray-1);
  110. @include box-shadow(none);
  111. cursor: default;
  112. &:hover, &:active, &:active:hover, &:focus {
  113. color: $gray-1;
  114. background-color: transparent;
  115. border-color: $gray-1;
  116. }
  117. }