buttons.less 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. //
  2. // Buttons
  3. // --------------------------------------------------
  4. // Base styles
  5. // --------------------------------------------------
  6. // Core
  7. .btn {
  8. display: inline-block;
  9. padding: 8px 12px;
  10. margin-right: 10px;
  11. font-size: @baseFontSize;
  12. line-height: @baseLineHeight;
  13. text-align: center;
  14. vertical-align: middle;
  15. cursor: pointer;
  16. border: none;
  17. .buttonBackground(@btnBackground, @btnBackgroundHighlight, @grayDark, 0 1px 1px rgba(255,255,255,.75));
  18. .box-shadow(~"inset 0 1px 0 rgba(255,255,255,.2), 0 1px 2px rgba(0,0,0,.05)");
  19. // Hover/focus state
  20. &:hover,
  21. &:focus {
  22. text-decoration: none;
  23. }
  24. // Focus state for keyboard and accessibility
  25. &:focus {
  26. .tab-focus();
  27. }
  28. // Active state
  29. &.active,
  30. &:active {
  31. background-image: none;
  32. outline: 0;
  33. }
  34. // Disabled state
  35. &.disabled,
  36. &[disabled] {
  37. cursor: default;
  38. background-image: none;
  39. .opacity(65);
  40. }
  41. }
  42. // Button Sizes
  43. // --------------------------------------------------
  44. // Large
  45. .btn-large {
  46. padding: 6px 20px;
  47. font-size: @fontSizeLarge;
  48. }
  49. .btn-small {
  50. padding: 2px 10px;
  51. font-size: @fontSizeSmall;
  52. }
  53. .btn-mini {
  54. padding: 2px 6px;
  55. margin-right: 0;
  56. margin-right: 0;
  57. font-size: @fontSizeMini;
  58. }
  59. // Set the backgrounds
  60. // -------------------------
  61. .btn-primary {
  62. .buttonBackground(@btnPrimaryBackground, @btnPrimaryBackgroundHighlight);
  63. }
  64. // Warning appears are orange
  65. .btn-warning {
  66. .buttonBackground(@btnWarningBackground, @btnWarningBackgroundHighlight);
  67. }
  68. // Danger and error appear as red
  69. .btn-danger {
  70. .buttonBackground(@btnDangerBackground, @btnDangerBackgroundHighlight);
  71. }
  72. // Success appears as green
  73. .btn-success {
  74. .buttonBackground(@btnSuccessBackground, @btnSuccessBackgroundHighlight);
  75. }
  76. // Info appears as a neutral blue
  77. .btn-info {
  78. .buttonBackground(@btnInfoBackground, @btnInfoBackgroundHighlight);
  79. }
  80. // Inverse appears as dark gray
  81. .btn-inverse {
  82. .buttonBackground(@btnInverseBackground, @btnInverseBackgroundHighlight, @btnInverseText);
  83. box-shadow: none;
  84. border: 1px solid @grafanaTargetFuncHightlight;
  85. }
  86. // Cross-browser Jank
  87. // --------------------------------------------------
  88. button.btn,
  89. input[type="submit"].btn {
  90. // Firefox 3.6 only I believe
  91. &::-moz-focus-inner {
  92. padding: 0;
  93. border: 0;
  94. }
  95. // IE7 has some default padding on button controls
  96. *padding-top: 3px;
  97. *padding-bottom: 3px;
  98. &.btn-large {
  99. *padding-top: 7px;
  100. *padding-bottom: 7px;
  101. }
  102. &.btn-small {
  103. *padding-top: 3px;
  104. *padding-bottom: 3px;
  105. }
  106. &.btn-mini {
  107. *padding-top: 1px;
  108. *padding-bottom: 1px;
  109. }
  110. }
  111. // Link buttons
  112. // --------------------------------------------------
  113. // Make a button look and behave like a link
  114. .btn-link,
  115. .btn-link:active,
  116. .btn-link[disabled] {
  117. background-color: transparent;
  118. background-image: none;
  119. .box-shadow(none);
  120. }
  121. .btn-link {
  122. border-color: transparent;
  123. cursor: pointer;
  124. color: @linkColor;
  125. .border-radius(0);
  126. }
  127. .btn-link:hover,
  128. .btn-link:focus {
  129. color: @linkColorHover;
  130. text-decoration: underline;
  131. background-color: transparent;
  132. }
  133. .btn-link[disabled]:hover,
  134. .btn-link[disabled]:focus {
  135. color: @grayDark;
  136. text-decoration: none;
  137. }
  138. .btn-text {
  139. color: @btnText;
  140. margin: 0;
  141. vertical-align: middle;
  142. }