/libraries/bootstrap/less/labels-badges.less

https://bitbucket.org/organicdevelopment/com_bootstrap · LESS · 74 lines · 55 code · 5 blank · 14 comment · 0 complexity · 41d8e55d42d85bd00d7e820a71bc348e MD5 · raw file

  1. //
  2. // Labels and badges
  3. // --------------------------------------------------
  4. // Base classes
  5. .label,
  6. .badge {
  7. display: inline-block;
  8. padding: 2px 4px;
  9. font-size: @baseFontSize * .846;
  10. font-weight: bold;
  11. line-height: 14px; // ensure proper line-height if floated
  12. color: @white;
  13. vertical-align: baseline;
  14. white-space: nowrap;
  15. text-shadow: 0 -1px 0 rgba(0,0,0,.25);
  16. background-color: @grayLight;
  17. }
  18. // Set unique padding and border-radii
  19. .label {
  20. .border-radius(3px);
  21. }
  22. .badge {
  23. padding-left: 9px;
  24. padding-right: 9px;
  25. .border-radius(9px);
  26. }
  27. // Hover state, but only for links
  28. a {
  29. &.label:hover,
  30. &.badge:hover {
  31. color: @white;
  32. text-decoration: none;
  33. cursor: pointer;
  34. }
  35. }
  36. // Colors
  37. // Only give background-color difference to links (and to simplify, we don't qualifty with `a` but [href] attribute)
  38. .label,
  39. .badge {
  40. // Important (red)
  41. &-important { background-color: @errorText; }
  42. &-important[href] { background-color: darken(@errorText, 10%); }
  43. // Warnings (orange)
  44. &-warning { background-color: @orange; }
  45. &-warning[href] { background-color: darken(@orange, 10%); }
  46. // Success (green)
  47. &-success { background-color: @successText; }
  48. &-success[href] { background-color: darken(@successText, 10%); }
  49. // Info (turquoise)
  50. &-info { background-color: @infoText; }
  51. &-info[href] { background-color: darken(@infoText, 10%); }
  52. // Inverse (black)
  53. &-inverse { background-color: @grayDark; }
  54. &-inverse[href] { background-color: darken(@grayDark, 10%); }
  55. }
  56. // Quick fix for labels/badges in buttons
  57. .btn {
  58. .label,
  59. .badge {
  60. position: relative;
  61. top: -1px;
  62. }
  63. }
  64. .btn-mini {
  65. .label,
  66. .badge {
  67. top: 0;
  68. }
  69. }