buttons.less 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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 {
  61. background-color: @light-blue;
  62. border-color: darken(@light-blue, 5%);
  63. &:hover, &:active, &.hover {
  64. background-color: darken(@light-blue, 5%);
  65. }
  66. }
  67. .btn-success {
  68. background-color: @green;
  69. border-color: darken(@green, 5%);
  70. &:hover, &:active, &.hover {
  71. background-color: darken(@green, 5%);
  72. }
  73. }
  74. .btn-info {
  75. background-color: @aqua;
  76. border-color: darken(@aqua, 5%);
  77. &:hover, &:active, &.hover {
  78. background-color: darken(@aqua, 5%);
  79. }
  80. }
  81. .btn-danger {
  82. background-color: @red;
  83. border-color: darken(@red, 5%);
  84. &:hover, &:active, &.hover {
  85. background-color: darken(@red, 5%);
  86. }
  87. }
  88. .btn-warning {
  89. background-color: @yellow;
  90. border-color: darken(@yellow, 5%);
  91. &:hover, &:active, &.hover {
  92. background-color: darken(@yellow, 5%);
  93. }
  94. }
  95. .btn-outline {
  96. border: 1px solid #fff;
  97. background: transparent;
  98. color: #fff;
  99. &:hover,
  100. &:focus,
  101. &:active {
  102. color: rgba(255, 255, 255, .7);
  103. border-color: rgba(255, 255, 255, .7);
  104. }
  105. }
  106. .btn-link {
  107. .box-shadow(none);
  108. }
  109. //General .btn with bg class
  110. .btn[class*='bg-']:hover {
  111. .box-shadow(inset 0 0 100px rgba(0, 0, 0, 0.2));
  112. }
  113. // Application buttons
  114. .btn-app {
  115. .border-radius(3px);
  116. position: relative;
  117. padding: 15px 5px;
  118. margin: 0 0 10px 10px;
  119. min-width: 80px;
  120. height: 60px;
  121. text-align: center;
  122. color: #666;
  123. border: 1px solid #ddd;
  124. background-color: #f4f4f4;
  125. font-size: 12px;
  126. //Icons within the btn
  127. > .fa, > .glyphicon, > .ion {
  128. font-size: 20px;
  129. display: block;
  130. }
  131. &:hover {
  132. background: #f4f4f4;
  133. color: #444;
  134. border-color: #aaa;
  135. }
  136. &:active, &:focus {
  137. -webkit-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
  138. -moz-box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
  139. box-shadow: inset 0 3px 5px rgba(0, 0, 0, .125);
  140. }
  141. //The badge
  142. > .badge {
  143. position: absolute;
  144. top: -3px;
  145. right: -10px;
  146. font-size: 10px;
  147. font-weight: 400;
  148. }
  149. }