index.scss 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. .nut-avatar {
  2. background-size: 100% 100%;
  3. background-repeat: no-repeat;
  4. background-position: center center;
  5. display: inline-block;
  6. position: relative;
  7. flex: 0 0 auto; // 防止被压缩
  8. text-align: center;
  9. > img {
  10. width: 100%;
  11. height: 100%;
  12. }
  13. .nut-avatar__icon {
  14. background-size: 100% 100%;
  15. position: absolute;
  16. top: 50%;
  17. left: 50%;
  18. transform: translate(-50%, -50%);
  19. }
  20. .nut-icon__img {
  21. width: 100%;
  22. height: 100%;
  23. }
  24. .nut-avatar__text {
  25. display: inline-block;
  26. width: 100%;
  27. height: 100%;
  28. text-align: center;
  29. overflow: hidden;
  30. }
  31. }
  32. .nut-avatar-large {
  33. width: $avatar-large-width;
  34. height: $avatar-large-height;
  35. line-height: $avatar-large-height;
  36. }
  37. .nut-avatar-small {
  38. width: $avatar-small-width;
  39. height: $avatar-small-height;
  40. line-height: $avatar-small-height;
  41. }
  42. .nut-avatar-normal {
  43. width: $avatar-normal-width;
  44. height: $avatar-normal-height;
  45. line-height: $avatar-normal-height;
  46. }
  47. .nut-avatar-round {
  48. border-radius: 50%;
  49. overflow: hidden;
  50. }
  51. .nut-avatar-square {
  52. border-radius: $avatar-square;
  53. }