avatar.scss 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. outline: none;
  19. color: getCssVar('avatar', 'text-color');
  20. background: getCssVar('avatar', 'bg-color');
  21. width: getCssVar('avatar', 'size');
  22. height: getCssVar('avatar', 'size');
  23. font-size: getCssVar('avatar', 'text-size');
  24. > img {
  25. display: block;
  26. width: 100%;
  27. height: 100%;
  28. }
  29. @include m(circle) {
  30. border-radius: 50%;
  31. }
  32. @include m(square) {
  33. border-radius: getCssVar('avatar', 'border-radius');
  34. }
  35. @include m(icon) {
  36. font-size: getCssVar('avatar', 'icon-size');
  37. }
  38. @each $size in (small, large) {
  39. @include m($size) {
  40. @include set-css-var-value(
  41. ('avatar', 'size'),
  42. map.get($avatar-size, $size)
  43. );
  44. }
  45. }
  46. }