badges.less 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // Badges
  3. // --------------------------------------------------
  4. // Base class
  5. .badge {
  6. display: inline-block;
  7. min-width: 10px;
  8. padding: 3px 7px;
  9. font-size: @font-size-small;
  10. font-weight: @badge-font-weight;
  11. color: @badge-color;
  12. line-height: @badge-line-height;
  13. vertical-align: baseline;
  14. white-space: nowrap;
  15. text-align: center;
  16. background-color: @badge-bg;
  17. border-radius: @badge-border-radius;
  18. // Empty badges collapse automatically (not available in IE8)
  19. &:empty {
  20. display: none;
  21. }
  22. // Quick fix for badges in buttons
  23. .btn & {
  24. position: relative;
  25. top: -1px;
  26. }
  27. .btn-xs & {
  28. top: 0;
  29. padding: 1px 5px;
  30. }
  31. // Hover state, but only for links
  32. a& {
  33. &:hover,
  34. &:focus {
  35. color: @badge-link-hover-color;
  36. text-decoration: none;
  37. cursor: pointer;
  38. }
  39. }
  40. // Account for badges in navs
  41. .list-group-item.active > &,
  42. .nav-pills > .active > a > & {
  43. color: @badge-active-color;
  44. background-color: @badge-active-bg;
  45. }
  46. .list-group-item > & {
  47. float: right;
  48. }
  49. .list-group-item > & + & {
  50. margin-right: 5px;
  51. }
  52. .nav-pills > li > a > & {
  53. margin-left: 3px;
  54. }
  55. }