buttons.less 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. .btn-text {
  87. color: @btnText;
  88. margin: 0;
  89. vertical-align: middle;
  90. }