buttons.less 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. /*
  2. * Component: Button
  3. * -----------------
  4. */
  5. .btn {
  6. /*.border-radius(@btn-border-radius);*/
  7. .box-shadow(@btn-boxshadow);
  8. border: 1px solid transparent;
  9. &.uppercase {
  10. text-transform: uppercase
  11. }
  12. // Flat buttons
  13. &.btn-flat {
  14. .border-radius(0);
  15. -webkit-box-shadow: none;
  16. -moz-box-shadow: none;
  17. box-shadow: none;
  18. border-width: 1px;
  19. }
  20. // Active state
  21. &:active {
  22. -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
  23. -moz-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
  24. box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
  25. }
  26. &:focus {
  27. outline: none;
  28. }
  29. // input file btn
  30. &.btn-file {
  31. position: relative;
  32. overflow: hidden;
  33. > input[type='file'] {
  34. position: absolute;
  35. top: 0;
  36. right: 0;
  37. min-width: 100%;
  38. min-height: 100%;
  39. font-size: 100px;
  40. text-align: right;
  41. .opacity(0);
  42. outline: none;
  43. background: white;
  44. cursor: inherit;
  45. display: block;
  46. }
  47. }
  48. }
  49. //Button color variations
  50. .btn-default {
  51. background-color: #f4f4f4;
  52. color: #444;
  53. border-color: #ddd;
  54. &:hover,
  55. &:active,
  56. &.hover {
  57. background-color: darken(#f4f4f4, 5%);
  58. }
  59. }
  60. .btn-primary-light {
  61. background-color: @primary-light-bg;
  62. border-color: @primary-light-border;
  63. color: @primary-light-text;
  64. &:hover,
  65. &:active,
  66. &.hover {
  67. background-color: darken(@primary-light-bg, 5%);
  68. border-color: darken(@primary-light-bg, 10%);
  69. color: @primary-light-text;
  70. }
  71. }
  72. .btn-success-light {
  73. background-color: @success-light-bg;
  74. border-color: @success-light-border;
  75. color: @success-light-text;
  76. &:hover,
  77. &:active,
  78. &.hover {
  79. background-color: darken(@success-light-bg, 5%);
  80. border-color: darken(@success-light-bg, 10%);
  81. color: @success-light-text;
  82. }
  83. }
  84. .btn-danger-light,
  85. .btn-error-light {
  86. background-color: @danger-light-bg;
  87. border-color: @danger-light-border;
  88. color: @danger-light-text;
  89. &:hover,
  90. &:active,
  91. &.hover {
  92. background-color: darken(@danger-light-bg, 5%);
  93. border-color: darken(@danger-light-bg, 10%);
  94. color: @danger-light-text;
  95. }
  96. }
  97. .btn-warning-light {
  98. background-color: @warning-light-bg;
  99. border-color: @warning-light-border;
  100. color: @warning-light-text;
  101. &:hover,
  102. &:active,
  103. &.hover {
  104. background-color: darken(@warning-light-bg, 5%);
  105. border-color: darken(@warning-light-bg, 10%);
  106. color: @warning-light-text;
  107. }
  108. }
  109. .btn-info-light {
  110. background-color: @info-light-bg;
  111. border-color: @info-light-border;
  112. color: @info-light-text;
  113. &:hover,
  114. &:active,
  115. &.hover {
  116. background-color: darken(@info-light-bg, 5%);
  117. border-color: darken(@info-light-bg, 10%);
  118. color: @info-light-text;
  119. }
  120. }
  121. .btn-outline {
  122. border: 1px solid #fff;
  123. background: transparent;
  124. color: #fff;
  125. &:hover,
  126. &:focus,
  127. &:active {
  128. color: rgba(255, 255, 255, .7);
  129. border-color: rgba(255, 255, 255, .7);
  130. }
  131. }
  132. .btn-link {
  133. .box-shadow(none);
  134. }
  135. //General .btn with bg class
  136. .btn[class*='bg-']:hover {
  137. .box-shadow(inset 0 0 100px rgba(0, 0, 0, 0.2));
  138. }
  139. // Application buttons
  140. .btn-app {
  141. .border-radius(3px);
  142. position: relative;
  143. padding: 15px 5px;
  144. margin: 0 0 10px 10px;
  145. min-width: 80px;
  146. height: 60px;
  147. text-align: center;
  148. color: #666;
  149. border: 1px solid #ddd;
  150. background-color: #f4f4f4;
  151. font-size: 12px;
  152. //Icons within the btn
  153. > .fa, > .glyphicon, > .ion {
  154. font-size: 20px;
  155. display: block;
  156. }
  157. &:hover {
  158. background: #f4f4f4;
  159. color: #444;
  160. border-color: #aaa;
  161. }
  162. &:active, &:focus {
  163. -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
  164. -moz-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
  165. box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
  166. }
  167. //The badge
  168. > .badge {
  169. position: absolute;
  170. top: -3px;
  171. right: -10px;
  172. font-size: 10px;
  173. font-weight: 400;
  174. }
  175. }