_buttons.scss 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. // Set the backgrounds
  56. // -------------------------
  57. .btn-primary {
  58. @include buttonBackground($btn-primary-bg, $btn-primary-bg-hl);
  59. }
  60. // Warning appears are orange
  61. .btn-warning {
  62. @include buttonBackground($btnWarningBackground, $btnWarningBackgroundHighlight);
  63. }
  64. // Danger and error appear as red
  65. .btn-danger {
  66. @include buttonBackground($btnDangerBackground, $btnDangerBackgroundHighlight);
  67. }
  68. // Success appears as green
  69. .btn-success {
  70. @include buttonBackground($btnSuccessBackground, $btnSuccessBackgroundHighlight);
  71. }
  72. // Info appears as a neutral blue
  73. .btn-info {
  74. @include buttonBackground($btnInfoBackground, $btnInfoBackgroundHighlight);
  75. }
  76. // Inverse appears as dark gray
  77. .btn-inverse {
  78. @include buttonBackground($btnInverseBackground, $btnInverseBackgroundHighlight, $btnInverseText);
  79. box-shadow: none;
  80. border: 1px solid $tight-form-func-highlight-bg;
  81. }
  82. .btn-outline-primary {
  83. @include button-outline-variant($btn-primary-bg);
  84. }
  85. .btn-outline-secondary {
  86. @include button-outline-variant($btnInverseBackground);
  87. }
  88. .btn-outline-info {
  89. @include button-outline-variant($btnInfoBackground);
  90. }
  91. .btn-outline-success {
  92. @include button-outline-variant($btnSuccessBackground);
  93. }
  94. .btn-outline-warning {
  95. @include button-outline-variant($btnWarningBackground);
  96. }
  97. .btn-outline-danger {
  98. @include button-outline-variant($btnDangerBackground);
  99. }
  100. .btn-text {
  101. color: $btnText;
  102. margin: 0;
  103. vertical-align: middle;
  104. }