avatar.scss 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. @use 'sass:map';
  2. @use 'mixins/mixins' as *;
  3. @use 'mixins/var' as *;
  4. @use 'common/var' as *;
  5. @include b(avatar) {
  6. @include set-component-css-var('avatar', $avatar);
  7. @include set-component-css-var('avatar-size', $avatar-size);
  8. @include set-css-var-value(
  9. ('avatar', 'size'),
  10. map.get($avatar-size, 'default')
  11. );
  12. display: inline-flex;
  13. justify-content: center;
  14. align-items: center;
  15. box-sizing: border-box;
  16. text-align: center;
  17. overflow: hidden;
  18. color: getCssVar('avatar', 'text-color');
  19. background: getCssVar('avatar', 'bg-color');
  20. width: getCssVar('avatar', 'size');
  21. height: getCssVar('avatar', 'size');
  22. font-size: getCssVar('avatar', 'text-size');
  23. > img {
  24. display: block;
  25. width: 100%;
  26. height: 100%;
  27. }
  28. @include m(circle) {
  29. border-radius: 50%;
  30. }
  31. @include m(square) {
  32. border-radius: getCssVar('avatar', 'border-radius');
  33. }
  34. @include m(icon) {
  35. font-size: getCssVar('avatar', 'icon-size');
  36. }
  37. @each $size in (small, large) {
  38. @include m($size) {
  39. @include set-css-var-value(
  40. ('avatar', 'size'),
  41. map.get($avatar-size, $size)
  42. );
  43. }
  44. }
  45. }