_buttons.scss 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. cursor: $cursor-disabled;
  39. opacity: .65;
  40. @include box-shadow(none);
  41. }
  42. }
  43. // Button Sizes
  44. // --------------------------------------------------
  45. // Large
  46. .btn-large {
  47. @include button-size($btn-padding-y-lg, $btn-padding-x-lg, $font-size-lg, $btn-border-radius);
  48. }
  49. .btn-small {
  50. @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $font-size-sm, $btn-border-radius);
  51. }
  52. .btn-mini {
  53. @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $font-size-xs, $btn-border-radius);
  54. }
  55. .btn-link {
  56. color: $btn-link-color;
  57. }
  58. // Set the backgrounds
  59. // -------------------------
  60. .btn-primary {
  61. @include buttonBackground($btn-primary-bg, $btn-primary-bg-hl);
  62. }
  63. .btn-secondary {
  64. @include buttonBackground($btn-secondary-bg, $btn-secondary-bg-hl);
  65. }
  66. // Warning appears are orange
  67. .btn-warning {
  68. @include buttonBackground($btn-warning-bg, $btn-warning-bg-hl);
  69. }
  70. // Danger and error appear as red
  71. .btn-danger {
  72. @include buttonBackground($btn-danger-bg, $btn-danger-bg-hl);
  73. }
  74. // Success appears as green
  75. .btn-success {
  76. @include buttonBackground($btn-success-bg, $btn-success-bg-hl);
  77. }
  78. // Info appears as a neutral blue
  79. .btn-secondary {
  80. @include buttonBackground($btn-secondary-bg, $btn-secondary-bg-hl);
  81. }
  82. // Inverse appears as dark gray
  83. .btn-inverse {
  84. @include buttonBackground($btn-inverse-bg, $btn-inverse-bg-hl, $btn-inverse-text-color);
  85. box-shadow: none;
  86. border: 1px solid $tight-form-func-highlight-bg;
  87. }
  88. .btn-outline-primary {
  89. @include button-outline-variant($btn-primary-bg);
  90. }
  91. .btn-outline-secondary {
  92. @include button-outline-variant($btn-secondary-bg);
  93. }
  94. .btn-outline-inverse {
  95. @include button-outline-variant($btn-inverse-bg);
  96. }
  97. .btn-outline-success {
  98. @include button-outline-variant($btn-success-bg);
  99. }
  100. .btn-outline-warning {
  101. @include button-outline-variant($btn-warning-bg);
  102. }
  103. .btn-outline-danger {
  104. @include button-outline-variant($btn-danger-bg);
  105. }