buttons.scss 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. //
  2. // Buttons
  3. // --------------------------------------------------
  4. .btn {
  5. position: relative;
  6. display: inline-block;
  7. padding: 6px 8px 7px;
  8. margin-bottom: 0; // For input.btn
  9. font-size: $button-font-size;
  10. font-weight: $font-weight-light;
  11. line-height: 1;
  12. color: #333;
  13. text-align: center;
  14. white-space: nowrap;
  15. vertical-align: top;
  16. cursor: pointer;
  17. background-color: $chrome-color;
  18. border: 1px solid #ccc;
  19. border-radius: 3px;
  20. // Active & filled button styles
  21. &:active,
  22. &.active {
  23. color: inherit; // Overriding the gloabl style for all anchors.
  24. background-color: #ccc;
  25. }
  26. // Disabled styles & filled button active styles
  27. &:disabled,
  28. &.disabled {
  29. opacity: .6;
  30. }
  31. }
  32. // Other button types
  33. // --------------------------------------------------
  34. // Primary button (Default color is blue)
  35. .btn-primary {
  36. color: #fff;
  37. background-color: $primary-color;
  38. border: 1px solid $primary-color;
  39. &:active,
  40. &.active {
  41. color: #fff;
  42. background-color: darken($primary-color, 10%);
  43. border: 1px solid darken($primary-color, 10%);
  44. }
  45. }
  46. // Positive button (Default color is green)
  47. .btn-positive {
  48. color: #fff;
  49. background-color: $positive-color;
  50. border: 1px solid $positive-color;
  51. &:active,
  52. &.active {
  53. color: #fff;
  54. background-color: darken($positive-color, 10%);
  55. border: 1px solid darken($positive-color, 10%);
  56. }
  57. }
  58. // Negative button (Default color is red)
  59. .btn-negative {
  60. color: #fff;
  61. background-color: $negative-color;
  62. border: 1px solid $negative-color;
  63. &:active,
  64. &.active {
  65. color: #fff;
  66. background-color: darken($negative-color, 10%);
  67. border: 1px solid darken($negative-color, 10%);
  68. }
  69. }
  70. // Outlined buttons
  71. .btn-outlined {
  72. background-color: transparent;
  73. &.btn-primary {
  74. color: $primary-color;
  75. }
  76. &.btn-positive {
  77. color: $positive-color;
  78. }
  79. &.btn-negative {
  80. color: $negative-color;
  81. }
  82. // Active states
  83. &.btn-primary:active,
  84. &.btn-positive:active,
  85. &.btn-negative:active {
  86. color: #fff;
  87. }
  88. }
  89. // Link button (Buttons that look like links)
  90. .btn-link {
  91. padding-top: 6px;
  92. padding-bottom: 6px;
  93. color: $primary-color;
  94. background-color: transparent;
  95. border: 0;
  96. &:active,
  97. &.active {
  98. color: darken($primary-color, 10%);
  99. background-color: transparent;
  100. }
  101. }
  102. // Block level buttons (full width buttons)
  103. .btn-block {
  104. display: block;
  105. width: 100%;
  106. padding: 15px 0;
  107. margin-bottom: 10px;
  108. font-size: 18px;
  109. }
  110. // Button overrides
  111. // --------------------------------------------------
  112. input[type="submit"],
  113. input[type="reset"],
  114. input[type="button"] {
  115. width: 100%;
  116. }
  117. // Buttons with badges
  118. // --------------------------------------------------
  119. // Generic styles for all badges within default buttons
  120. .btn .badge {
  121. margin: -2px -4px -2px 4px;
  122. font-size: 12px;
  123. background-color: rgba(0,0,0,.15);
  124. }
  125. // Buttons with inverted badges
  126. .btn .badge-inverted,
  127. .btn:active .badge-inverted {
  128. background-color: transparent;
  129. }
  130. .btn-primary:active .badge-inverted,
  131. .btn-positive:active .badge-inverted,
  132. .btn-negative:active .badge-inverted {
  133. color: #fff;
  134. }
  135. // Position badges within block level buttons
  136. // Note: These are absolutely positioned so that text of button isn't "pushed" by badge and always
  137. // stays at the center of button
  138. .btn-block .badge {
  139. position: absolute;
  140. right: 0;
  141. margin-right: 10px;
  142. }
  143. // Buttons with Ratchicons
  144. // --------------------------------------------------
  145. .btn .icon {
  146. font-size: inherit;
  147. }