buttons.scss 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. @include buttonBackground($btnBackground, $btnBackgroundHighlight, $grayDark, 0 1px 1px rgba(255,255,255,.75));
  18. @include 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. @include tab-focus();
  27. }
  28. // Active state
  29. &.active,
  30. &:active {
  31. background-image: none;
  32. }
  33. // Disabled state
  34. &.disabled,
  35. &[disabled] {
  36. cursor: default;
  37. background-image: none;
  38. @include opacity(65);
  39. }
  40. }
  41. // Button Sizes
  42. // --------------------------------------------------
  43. // Large
  44. .btn-large {
  45. padding: 6px 20px;
  46. font-size: $fontSizeLarge;
  47. }
  48. .btn-small {
  49. padding: 2px 10px;
  50. font-size: $fontSizeSmall;
  51. }
  52. .btn-mini {
  53. padding: 2px 6px;
  54. margin-right: 0;
  55. margin-right: 0;
  56. font-size: $fontSizeMini;
  57. }
  58. // Set the backgrounds
  59. // -------------------------
  60. .btn-primary {
  61. @include buttonBackground($btnPrimaryBackground, $btnPrimaryBackgroundHighlight);
  62. }
  63. // Warning appears are orange
  64. .btn-warning {
  65. @include buttonBackground($btnWarningBackground, $btnWarningBackgroundHighlight);
  66. }
  67. // Danger and error appear as red
  68. .btn-danger {
  69. @include buttonBackground($btnDangerBackground, $btnDangerBackgroundHighlight);
  70. }
  71. // Success appears as green
  72. .btn-success {
  73. @include buttonBackground($btnSuccessBackground, $btnSuccessBackgroundHighlight);
  74. }
  75. // Info appears as a neutral blue
  76. .btn-info {
  77. @include buttonBackground($btnInfoBackground, $btnInfoBackgroundHighlight);
  78. }
  79. // Inverse appears as dark gray
  80. .btn-inverse {
  81. @include buttonBackground($btnInverseBackground, $btnInverseBackgroundHighlight, $btnInverseText);
  82. box-shadow: none;
  83. border: 1px solid $grafanaTargetFuncHightlight;
  84. }
  85. .btn-text {
  86. color: $btnText;
  87. margin: 0;
  88. vertical-align: middle;
  89. }