2cf90df8a26be2309a517f92cbdf433313252651f37f345394e8453fe7e7414439bdfa6229fa58b78eb1551b75729edf02a7fe21405d9046525aa66d7171d1 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. @import "mixins/mixins";
  2. @import "common/var";
  3. @include b(badge) {
  4. position: relative;
  5. vertical-align: middle;
  6. display: inline-block;
  7. @include e(content) {
  8. background-color: $--badge-background-color;
  9. border-radius: $--badge-radius;
  10. color: $--color-white;
  11. display: inline-block;
  12. font-size: $--badge-font-size;
  13. height: $--badge-size;
  14. line-height: $--badge-size;
  15. padding: 0 $--badge-padding;
  16. text-align: center;
  17. white-space: nowrap;
  18. border: 1px solid $--color-white;
  19. @include when(fixed) {
  20. position: absolute;
  21. top: 0;
  22. right: #{1 + $--badge-size / 2};
  23. transform: translateY(-50%) translateX(100%);
  24. @include when(dot) {
  25. right: 5px;
  26. }
  27. }
  28. @include when(dot) {
  29. height: 8px;
  30. width: 8px;
  31. padding: 0;
  32. right: 0;
  33. border-radius: 50%;
  34. }
  35. @each $type in (primary, success, warning, info, danger) {
  36. @include m($type) {
  37. @if $type == primary {
  38. background-color: $--color-primary;
  39. } @else if $type == success {
  40. background-color: $--color-success;
  41. } @else if $type == warning {
  42. background-color: $--color-warning;
  43. } @else if $type == info {
  44. background-color: $--color-info;
  45. } @else {
  46. background-color: $--color-danger;
  47. }
  48. }
  49. }
  50. }
  51. }