_avatar.scss 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. @use '../tools' as *;
  2. // user avatars
  3. .avatar {
  4. border-radius: 100%;
  5. position: relative;
  6. display: inline-block;
  7. vertical-align: middle;
  8. text-align: center;
  9. overflow: hidden;
  10. width: 50px;
  11. height: 50px;
  12. img {
  13. position: absolute;
  14. z-index: 2;
  15. top: 0;
  16. inset-inline-start: 0;
  17. inset-inline-end: 0;
  18. border: 0;
  19. object-fit: cover;
  20. width: 100%;
  21. height: 100%;
  22. }
  23. &.small {
  24. vertical-align: middle;
  25. margin: 0 0.5em;
  26. width: 25px;
  27. height: 25px;
  28. }
  29. &.large {
  30. width: 60px;
  31. height: 60px;
  32. @include media-breakpoint-up(sm) {
  33. width: 80px;
  34. height: 80px;
  35. }
  36. }
  37. &.square {
  38. border-radius: 0;
  39. }
  40. }
  41. .avatar--edit {
  42. overflow: visible;
  43. flex-shrink: 0;
  44. img {
  45. border-radius: 50%;
  46. z-index: auto;
  47. }
  48. }
  49. .avatar__edit-link {
  50. width: theme('spacing.5');
  51. height: theme('spacing.5');
  52. border-radius: 50%;
  53. border: theme('spacing.px') solid theme('colors.border-furniture');
  54. display: flex;
  55. align-items: center;
  56. justify-content: center;
  57. position: absolute;
  58. top: 100%;
  59. inset-inline-start: 50%;
  60. transform: translate(calc(var(--w-direction-factor) * -50%), -50%);
  61. background-color: theme('colors.surface-page');
  62. .icon {
  63. width: theme('spacing.[2.5]');
  64. height: theme('spacing.[2.5]');
  65. }
  66. }