_badges.scss 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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: middle;
  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. .btn-group-xs > .btn & {
  29. top: 0;
  30. padding: 1px 5px;
  31. }
  32. // [converter] extracted a& to a.badge
  33. // Account for badges in navs
  34. .list-group-item.active > &,
  35. .nav-pills > .active > a > & {
  36. color: $badge-active-color;
  37. background-color: $badge-active-bg;
  38. }
  39. .list-group-item > & {
  40. float: right;
  41. }
  42. .list-group-item > & + & {
  43. margin-right: 5px;
  44. }
  45. .nav-pills > li > a > & {
  46. margin-left: 3px;
  47. }
  48. }
  49. // Hover state, but only for links
  50. a.badge {
  51. &:hover,
  52. &:focus {
  53. color: $badge-link-hover-color;
  54. text-decoration: none;
  55. cursor: pointer;
  56. }
  57. }