buttons.less 3.0 KB

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