index.less 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. @import "../styles/mixins/index.less";
  2. @import "../styles/themes/index.less";
  3. .@{wux-prefix}-avatar {
  4. // font-family: Monospaced Number,Chinese Quote,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif;
  5. // font-size: 14px;
  6. // line-height: 1.5;
  7. // color: rgba(0, 0, 0, .65);
  8. box-sizing: border-box;
  9. display: inline-block;
  10. text-align: center;
  11. background: @avatar-bg;
  12. color: @avatar-color;
  13. white-space: nowrap;
  14. position: relative;
  15. overflow: hidden;
  16. vertical-align: middle;
  17. .avatar-size(@avatar-size-base, @avatar-font-size-base);
  18. &--small {
  19. .avatar-size(@avatar-size-sm, @avatar-font-size-sm);
  20. }
  21. &--large {
  22. .avatar-size(@avatar-size-lg, @avatar-font-size-lg);
  23. }
  24. &--square {
  25. border-radius: @avatar-border-radius;
  26. }
  27. &--thumb {
  28. background: transparent;
  29. }
  30. > image {
  31. width: 100%;
  32. height: 100%;
  33. }
  34. }
  35. .avatar-size(@size, @font-size) {
  36. width: @size;
  37. height: @size;
  38. line-height: @size;
  39. border-radius: @size / 2;
  40. font-size: @font-size;
  41. .@{wux-prefix}-avatar__string {
  42. line-height: @size;
  43. }
  44. }