avatar.scss 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. height: 100%;
  26. }
  27. @include m(circle) {
  28. border-radius: 50%;
  29. }
  30. @include m(square) {
  31. border-radius: getCssVar('avatar', 'border-radius');
  32. }
  33. @include m(icon) {
  34. font-size: getCssVar('avatar', 'icon-size');
  35. }
  36. @each $size in (small, large) {
  37. @include m($size) {
  38. @include set-css-var-value(
  39. ('avatar', 'size'),
  40. map.get($avatar-size, $size)
  41. );
  42. }
  43. }
  44. }