No Description

_buttons.scss 4.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. .btn,
  2. .navbar .navbar-nav > a.btn{
  3. border-width: $border-thick;
  4. border: none;
  5. position: relative;
  6. overflow: hidden;
  7. margin:4px 1px;
  8. border-radius: $border-radius-lg;
  9. cursor: pointer;
  10. @include btn-styles($default, $default-states);
  11. &:hover,
  12. &:focus{
  13. @include opacity(1);
  14. outline: 0 !important;
  15. }
  16. &:active,
  17. &.active,
  18. .open > &.dropdown-toggle {
  19. @include box-shadow(none);
  20. outline: 0 !important;
  21. }
  22. .badge{
  23. margin: 0;
  24. }
  25. &.btn-icon {
  26. // see above for color variations
  27. height: $icon-size-regular;
  28. min-width: $icon-size-regular;
  29. width: $icon-size-regular;
  30. padding: 0;
  31. font-size: $icon-font-size-regular;
  32. overflow: hidden;
  33. position: relative;
  34. line-height: normal;
  35. &.btn-simple{
  36. padding: 0;
  37. }
  38. &.btn-sm{
  39. height: $icon-size-sm;
  40. min-width: $icon-size-sm;
  41. width: $icon-size-sm;
  42. .fa,
  43. .far,
  44. .fas,
  45. .tim-icons{
  46. font-size: $icon-font-size-sm;
  47. }
  48. }
  49. &.btn-lg{
  50. height: $icon-size-lg;
  51. min-width: $icon-size-lg;
  52. width: $icon-size-lg;
  53. .fa,
  54. .far,
  55. .fas,
  56. .tim-icons{
  57. font-size: $icon-font-size-lg;
  58. }
  59. }
  60. &:not(.btn-footer) .tim-icons,
  61. &:not(.btn-footer) .fa,
  62. &:not(.btn-footer) .far,
  63. &:not(.btn-footer) .fas{
  64. position: absolute;
  65. font-size: 1em;
  66. top: 50%;
  67. left: 50%;
  68. transform: translate(-12px, -12px);
  69. line-height: 1.5626rem;
  70. width: 24px;
  71. }
  72. }
  73. &:not(.btn-icon) .tim-icons{
  74. position: relative;
  75. top: 1px;
  76. }
  77. span{
  78. position: relative;
  79. display: block;
  80. }
  81. &.btn-link.dropdown-toggle {
  82. color: $dark-gray;
  83. }
  84. &.dropdown-toggle:after {
  85. margin-left: 30px !important;
  86. }
  87. }
  88. // Apply the mixin to the buttons
  89. // .btn-default { @include btn-styles($default-color, $default-states-color); }
  90. .btn-primary { @include btn-styles($primary, $primary-states);
  91. }
  92. .btn-success { @include btn-styles($success, $success-states);
  93. }
  94. .btn-info { @include btn-styles($info, $info-states);
  95. }
  96. .btn-warning { @include btn-styles($warning, $warning-states);
  97. &:not(:disabled):not(.disabled):active{
  98. color: $white;
  99. }
  100. }
  101. .btn-danger { @include btn-styles($danger, $danger-states);
  102. }
  103. .btn-neutral { @include btn-styles($white, $white); }
  104. .btn{
  105. &:disabled,
  106. &[disabled],
  107. &.disabled{
  108. @include opacity(.5);
  109. pointer-events: none;
  110. }
  111. }
  112. .btn-simple{
  113. border: $border;
  114. border-color: $default;
  115. box-shadow: none;
  116. padding: $padding-btn-vertical - 1 $padding-round-horizontal - 1;
  117. background-color: $transparent-bg;
  118. }
  119. .btn-simple,
  120. .btn-link{
  121. &.disabled,
  122. &:disabled,
  123. &[disabled],
  124. fieldset[disabled] & {
  125. &,
  126. &:hover,
  127. &:focus,
  128. &.focus,
  129. &:active,
  130. &.active {
  131. background: $transparent-bg;
  132. }
  133. }
  134. }
  135. .btn:not(:disabled):not(.disabled):active, .btn:not(:disabled):not(.disabled).active{
  136. box-shadow: 2px 2px 6px rgba(0,0,0,.4);
  137. }
  138. .btn-link{
  139. border: $none;
  140. box-shadow: none;
  141. padding: $padding-base-vertical $padding-base-horizontal;
  142. background: $transparent-bg;
  143. color: $gray-300;
  144. font-weight: $font-weight-bold;
  145. &:hover {
  146. box-shadow: none !important;
  147. transform: none !important;
  148. }
  149. }
  150. .btn-lg{
  151. @include btn-size($btn-padding-y-lg, $btn-padding-x-lg, $font-size-base, $border-radius-lg);
  152. }
  153. .btn-sm{
  154. @include btn-size($btn-padding-y-sm, $btn-padding-x-sm, $font-size-base, $border-radius-sm);
  155. }
  156. .btn-wd {
  157. min-width: 140px;
  158. }
  159. .btn-group.select{
  160. width: 100%;
  161. }
  162. .btn-group {
  163. .btn.active {
  164. box-shadow: 2px 2px 6px rgba(0,0,0,.4);
  165. transform: translateY(-1px);
  166. -webkit-transform: translateY(-1px);
  167. }
  168. }
  169. .btn-group.select .btn{
  170. text-align: left;
  171. }
  172. .btn-group.select .caret{
  173. position: absolute;
  174. top: 50%;
  175. margin-top: -1px;
  176. right: 8px;
  177. }
  178. .btn-group .btn.active {
  179. box-shadow: 2px 2px 6px rgba(0,0,0,.4);
  180. transform: translateY(-1px);
  181. -webkit-transform: translateY(-1px);
  182. }
  183. .btn-round{
  184. border-width: $border-thin;
  185. border-radius: $btn-round-radius;
  186. &.btn-simple{
  187. padding: $padding-btn-vertical - 1 $padding-round-horizontal - 1;
  188. }
  189. }
  190. .no-caret {
  191. &.dropdown-toggle::after {
  192. display: none;
  193. }
  194. }
  195. .btn-secondary:not(:disabled):not(.disabled):active,
  196. .btn-secondary:not(:disabled):not(.disabled).active,
  197. .show > .btn-secondary.dropdown-toggle {
  198. color: $white;
  199. }
  200. .btn-group label.btn.active {
  201. transform: translateY(0);
  202. -webkit-transform: translateY(0);
  203. }