@use 'iro-sass/src/index' as iro; @use '../functions' as fn; @include iro.props-namespace('avatar') { @include iro.props-store(( --dims: ( --100: ( --size: fn.global-dim(--size --450), --font-size: fn.global-dim(--font-size --100), ), --75: ( --size: fn.global-dim(--size --325), --font-size: fn.global-dim(--font-size --75), ), --50: ( --size: fn.global-dim(--size --225), --font-size: fn.global-dim(--font-size --50), ), --indicator-size: fn.foreign-dim(--status-indicator, --100), --indicator-spacing: iro.fn-px-to-rem(3px), --rounding: 25%, ), ), 'dims'); @include iro.props-store(( --colors: ( --h: 354, --s: 44%, --l: 45%, ), ), 'colors'); @include iro.bem-object(iro.props-namespace()) { display: inline-block; position: relative; font-size: fn.dim(--100 --font-size); font-style: normal; @include iro.bem-elem('status') { position: absolute; right: 0; bottom: 0; @include iro.bem-next-elem('content') { mask-image: radial-gradient( circle calc(.5 * fn.dim(--indicator-size) + fn.dim(--indicator-spacing)) at calc(100% - .5 * fn.dim(--indicator-size)) calc(100% - .5 * fn.dim(--indicator-size)), transparent 95%, #fff ); } } @include iro.bem-elem('content') { display: block; width: fn.dim(--100 --size); height: fn.dim(--100 --size); border-radius: fn.dim(--rounding); background-color: hsl(fn.color(--h), fn.color(--s), fn.color(--l)); color: #fff; line-height: fn.dim(--100 --size); text-align: center; object-fit: cover; object-position: center center; } @include iro.bem-modifier('circle') { @include iro.bem-elem('content') { border-radius: 100%; } } @include iro.bem-modifier('placeholder') { @include iro.bem-elem('content') { background-color: hsl(0, 0%, fn.color(--l)); } } @include iro.bem-modifier('75') { font-size: fn.dim(--75 --font-size); @include iro.bem-elem('content') { width: fn.dim(--75 --size); height: fn.dim(--75 --size); line-height: fn.dim(--75 --size); } } @include iro.bem-modifier('50') { font-size: fn.dim(--50 --font-size); @include iro.bem-elem('content') { width: fn.dim(--50 --size); height: fn.dim(--50 --size); line-height: fn.dim(--50 --size); } } } }