_badges.scss 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Badges
  2. .badge {
  3. position: relative;
  4. white-space: nowrap;
  5. &[data-badge],
  6. &:not([data-badge]) {
  7. &::after {
  8. background: $primary-color;
  9. background-clip: padding-box;
  10. border-radius: .5rem;
  11. box-shadow: 0 0 0 .1rem $bg-color-light;
  12. color: $light-color;
  13. content: attr(data-badge);
  14. display: inline-block;
  15. transform: translate(-.05rem, -.5rem);
  16. }
  17. }
  18. &[data-badge] {
  19. &::after {
  20. font-size: $font-size-sm;
  21. height: .9rem;
  22. line-height: 1;
  23. min-width: .9rem;
  24. padding: .1rem .2rem;
  25. text-align: center;
  26. white-space: nowrap;
  27. }
  28. }
  29. &:not([data-badge]),
  30. &[data-badge=""] {
  31. &::after {
  32. height: 6px;
  33. min-width: 6px;
  34. padding: 0;
  35. width: 6px;
  36. }
  37. }
  38. // Badges for Buttons
  39. &.btn {
  40. &::after {
  41. position: absolute;
  42. top: 0;
  43. right: 0;
  44. transform: translate(50%, -50%);
  45. }
  46. }
  47. // Badges for Avatars
  48. &.avatar {
  49. &::after {
  50. position: absolute;
  51. top: 14.64%;
  52. right: 14.64%;
  53. transform: translate(50%, -50%);
  54. z-index: $zindex-1;
  55. }
  56. }
  57. }