Avatar

Info

Disabled state is available for all variants.

<!-- Medium -->
<div class="sds-avatar centeredBgi -avatarBase">

    <div class="sds-avatar__text">AG</div>

</div>

<!-- Nopic -->
<div class="sds-avatar centeredBgi -avatarNoBg">

    <div class="sds-noPic">
        <svg width="630" height="631" viewBox="0 0 630 630" fill="none" xmlns="http://www.w3.org/2000/svg">
            <rect width="630" height="630" transform="translate(0 0.304688)" fill="#F0F6FF" />
            <g opacity=".32">
                <path fill-rule="evenodd" clip-rule="evenodd" d="M314.998 219.472c31.751 0 57.5 25.749 57.5 57.5 0 19.33-9.544 36.436-24.177 46.861 25.75 13.975 43.348 43.652 43.348 77.722 0 4.915-3.699 8.965-8.465 9.519l-1.118.064H247.919c-5.292 0-9.583-4.29-9.583-9.583 0-34.07 17.593-63.744 43.338-77.725-14.634-10.42-24.176-27.526-24.176-46.858 0-31.754 25.744-57.5 57.5-57.5Zm-.351 115.001c-27.165.194-50.228 22.586-55.841 52.808l-.407 2.402-.321 2.289h39.061l7.131-48.206c.848-5.744 5.098-8.829 9.592-9.248l.785-.045Zm10.638 7.975.256 1.278 7.287 48.246h39.09l-.312-2.288c-4.585-29.96-26.211-52.791-52.37-55.032l-2.19-.138-1.915-.044c4.436.081 8.821 2.738 10.154 7.978Zm-10.287-103.81c-21.17 0-38.333 17.165-38.333 38.334 0 21.168 17.163 38.333 38.333 38.333 21.165 0 38.333-17.168 38.333-38.333 0-21.166-17.168-38.334-38.333-38.334Z" fill="#4D6E90" />
            </g>
        </svg>
    </div>

</div>

<!-- Extra Small -->
<div class="sds-avatar centeredBgi -avatarXs -avatarBase">

    <div class="sds-avatar__text">AG</div>

</div>

<!-- Small -->
<div class="sds-avatar centeredBgi -avatarSm -avatarBase">

    <div class="sds-avatar__text">AG</div>

</div>

<!-- Large -->
<div class="sds-avatar centeredBgi -avatarLg -avatarBase">

    <div class="sds-avatar__text">AG</div>

</div>

<!-- Extra Large -->
<div class="sds-avatar centeredBgi -avatarXl -avatarBase">

    <div class="sds-avatar__text">AG</div>

</div>

<!-- Image -->
<div class="sds-avatar centeredBgi">

    <img class="img-fluid" src="../../media/snet/avatars/avatarUser.png" alt="">

</div>

<!-- Image Extra Small -->
<div class="sds-avatar centeredBgi -avatarXs">

    <img class="img-fluid" src="../../media/snet/avatars/avatarUser.png" alt="">

</div>

<!-- Image Small -->
<div class="sds-avatar centeredBgi -avatarSm">

    <img class="img-fluid" src="../../media/snet/avatars/avatarUser.png" alt="">

</div>

<!-- Image Large -->
<div class="sds-avatar centeredBgi -avatarLg">

    <img class="img-fluid" src="../../media/snet/avatars/avatarUser.png" alt="">

</div>

<!-- Image Extra Large -->
<div class="sds-avatar centeredBgi -avatarXl">

    <img class="img-fluid" src="../../media/snet/avatars/avatarUser.png" alt="">

</div>

<!-- Disabled -->
<div class="sds-avatar centeredBgi -avatarBase -disabled">

    <div class="sds-avatar__text">AG</div>

</div>

<!-- Square -->
<div class="sds-avatar centeredBgi -avatarBase -avatarSquare">

    <div class="sds-avatar__text">AG</div>

</div>

<!-- Icon -->
<div class="sds-avatar centeredBgi -avatarBase">

    <span class="sds-icon sds-icon-client"></span>

</div>

<!-- Bfm Pro Badge -->
<div class="sds-avatar centeredBgi -badgeVisible">

    <img class="img-fluid" src="../../media/snet/avatars/avatarUser.png" alt="">

    <span class="sds-avatar__circle">

        <span class="sds-icon sds-icon-business"></span>

    </span>

</div>

<!-- Bfm Pro Badge Small -->
<div class="sds-avatar centeredBgi -avatarSm -badgeVisible">

    <img class="img-fluid" src="../../media/snet/avatars/avatarUser.png" alt="">

    <span class="sds-avatar__circle">

        <span class="sds-icon sds-icon-business"></span>

    </span>

</div>

<!-- Bfm Pro Badge Large -->
<div class="sds-avatar centeredBgi -avatarLg -badgeVisible">

    <img class="img-fluid" src="../../media/snet/avatars/avatarUser.png" alt="">

    <span class="sds-avatar__circle">

        <span class="sds-icon sds-icon-business"></span>

    </span>

</div>

<!-- Bfm Pro Badge Extra Large -->
<div class="sds-avatar centeredBgi -avatarXl -badgeVisible">

    <img class="img-fluid" src="../../media/snet/avatars/avatarUser.png" alt="">

    <span class="sds-avatar__circle">

        <span class="sds-icon sds-icon-business"></span>

    </span>

</div>

<!-- Tooltip -->
<div class="sds-avatar centeredBgi" data-toggle="tooltip" data-placement="top" title="Avatar tooltip">

    <img class="img-fluid" src="../../media/snet/avatars/avatarUser.png" alt="">

</div>

<!-- Small Tooltip -->
<div class="sds-avatar centeredBgi -avatarSm" data-toggle="tooltip" data-placement="top" title="Avatar tooltip">

    <img class="img-fluid" src="../../media/snet/avatars/avatarUser.png" alt="">

</div>

<!-- User Bank -->
<div class="sds-avatar centeredBgi -avatarMd -userBank">

    <img class="img-fluid" src="../../media/snet/avatars/avatarUser.png" alt="">

    <span class="sds-avatar__circle">

        <img src="../../media/logos/logo-spuerkeess.png" alt="">

    </span>

</div>

<!-- Bank No Img -->
<div class="sds-avatar centeredBgi -avatarSm -bank">

    <span class="sds-icon sds-icon-instrument"></span>

</div>

<!-- Bank Img -->
<div class="sds-avatar centeredBgi -avatarSm -bank">

    <img class="img-fluid" src="../../media/logos/logo-spuerkeess.png" alt="">

</div>

{% if externalImg %}
	{% set mediaPath = "" %}
{% endif %}
<{{ eltType}} {% if eltType === "a" %} href="{{ href }}"{%- endif -%} class="{{ namespace }}avatar centeredBgi{% for mod in modifiers %} {{ mod }}{% endfor %}{% for mod in classes %} {{ mod }}{% endfor %}" {% for attrKey, attr in attrs %} {{ attrKey }}="{{ attr }}"{% endfor %}>
	{% if img %}
		<img class="img-fluid" src="{{ (mediaPath + img) | path }}" alt="">
	{% endif%}
	{% if text %}
		<div class="{{ namespace }}avatar__text">{{ text }}</div>
	{% endif %}
	{% if circleBadge %}
		<span class="{{ namespace }}avatar__circle">
			{% if logo %}
				<img src="{{ (mediaPath+logo) | path }}" alt="">
			{% else %}
				<span class="{{ namespace }}icon {{ namespace }}{{ iconCircle }}"></span>
			{% endif %}
		</span>
	{% endif %}
	{% if icon %}
		<span class="{{ namespace }}icon {{ namespace }}{{ icon }}"></span>
	{% endif %}
	{% if nopic %}
	{% render "@nopic-adviser" %}
	{% endif %}
</{{ eltType}}>
  • Content:
    /* variables specific to current element */
    
    $avatar-pro-label-top-padding: 0.16em;
    $avatar-pro-label-bottom-padding: 0.25em;
    
    .#{$namespace}avatar {
    
    	/* Save root element context for easy access if nesting is needed */
    
    	$self: &;
    
    	/* properties of current element  + media queries */
    
    	display: inline-flex;
    	align-items: center;
    	justify-content: center;
    	@include custom-prop-fallback("width", "comp-avatar-width");
    	@include custom-prop-fallback("height", "comp-avatar-height");
    	@include custom-prop-fallback("border-radius", "comp-avatar-border-radius");
    	position: relative;
    	z-index: z("zero");
    	overflow: hidden;
    	flex-shrink: 0;
    
    	/* Pseudo Elements */
    
    	&::before {
    	}
    
    	&::after {
    	}
    
    	/*
    	Include elements that are linked to the current element but have to reside at the root level of the stylesheet
    	(e.g: keyframes)
    	*/
    	@at-root {
    	}
    
    
    	/* children - write selector in full in comments in order to facilitate search */
    
    	// avatar__childElement
    
    	> IMG {
    
    		position: absolute;
    		z-index: ("low");
    		width: 100%;
    		height: 100%;
    		object-fit: cover;
    		object-position: center center;
    		border-radius: inherit;
    
    	}
    
    	.#{$namespace}icon {
    
    		&::before {
    
    			@include custom-prop-fallback("font-size", "comp-avatar-icon-size");
    
    		}
    
    	}
    
    	&__text {
    
    		@extend %textHelper;
    		@extend %textSemiBold;
    		text-transform: uppercase;
    		@include custom-prop-fallback("color", "comp-avatar-text-color");
    
    
    	}
    
    	&__circle {
    
    		position: absolute;
    		right: 0;
    		bottom: 0;
    		width: map-deep-get($token-sizes-unit-map, "16");
    		height: map-deep-get($token-sizes-unit-map, "16");
    		@include custom-prop-fallback("background-color", "sys-color-background-status-info-100");
    		@include custom-prop-fallback("color", "sys-color-text-primary-vivid",true,true);
    		border-radius: map-deep-get($token-radius-map, "circle");
    		display: flex;
    		align-items: center;
    		justify-content: center;
    
    		[class*="icon"] {
    
    			line-height: 0;
    			position: relative;
    			top: -1px;
    			color: inherit;
    
    			&::before {
    				font-size: 12px !important;
    			}
    
    		}
    
    		IMG {
    
    			width: 100%;
    			height: 100%;
    			object-fit: cover;
    
    		}
    
    	}
    
    	/* modifiers */
    
    	// avatar -square
    	&.-avatarSquare {
    
    		@include custom-prop-fallback("border-radius", "comp-avatar-square-border-radius");
    
    	}
    
    	// avatar -xtraSmall
    	&.-avatarXs,
    	&.-xtraSmall {
    
    		// follows same logic as base element
    
    		@include custom-prop-fallback("width", "comp-avatar-extra-small-width");
    		@include custom-prop-fallback("height", "comp-avatar-extra-small-height");
    
    		#{$self}__text {
    
    			@extend %textHelperSmall;
    
    		}
    
    		.#{$namespace}icon {
    
    			&::before {
    
    				@include custom-prop-fallback("font-size", "comp-avatar-extra-small-icon-size");
    
    			}
    
    		}
    
    		&.-avatarSquare {
    
    			@include custom-prop-fallback("border-radius", "comp-avatar-extra-small-square-border-radius");
    
    		}
    
    	}
    
    	// avatar -small
    	&.-avatarSm,
    	&.-small {
    
    		// follows same logic as base element
    
    		@include custom-prop-fallback("width", "comp-avatar-small-width");
    		@include custom-prop-fallback("height", "comp-avatar-small-height");
    
    		#{$self}__circle {
    
    			bottom: -(map-deep-get($token-spacer-unit-map, "2"));
    			right: -(map-deep-get($token-spacer-unit-map, "2"));
    
    		}
    
    		*::before {
    			font-size: inherit;
    		}
    
    		.#{$namespace}icon {
    
    			&::before {
    
    				@include custom-prop-fallback("font-size", "comp-avatar-small-icon-size","true","true",false);
    
    			}
    
    		}
    
    		&.-avatarSquare {
    
    			@include custom-prop-fallback("border-radius", "comp-avatar-small-square-border-radius");
    
    		}
    
    	}
    
    	// avatar -medium
    	&.-avatarMd,
    	&.-medium {
    
    		// follows same logic as base element
    
    	}
    
    	// avatar -large
    	&.-avatarLg,
    	&.-large {
    
    		// follows same logic as base element
    
    		@include custom-prop-fallback("width", "comp-avatar-large-width");
    		@include custom-prop-fallback("height", "comp-avatar-large-height");
    
    		#{$self}__text {
    			@extend %textBodyLg;
    		}
    
    		#{$self}__circle {
    
    			bottom: map-deep-get($token-spacer-unit-map, "2");
    			right: map-deep-get($token-spacer-unit-map, "2");
    
    		}
    
    		.#{$namespace}icon {
    
    			&::before {
    
    				@include custom-prop-fallback("font-size", "comp-avatar-large-icon-size");
    
    			}
    
    		}
    
    		&.-avatarSquare {
    
    			@include custom-prop-fallback("border-radius", "comp-avatar-large-square-border-radius");
    
    		}
    
    	}
    
    	// avatar -extraLarge
    	&.-avatarXl,
    	&.-extraLarge {
    
    		// follows same logic as base element
    
    		@include custom-prop-fallback("width", "comp-avatar-extra-large-width");
    		@include custom-prop-fallback("height", "comp-avatar-extra-large-height");
    
    		#{$self}__text {
    
    			@extend %textBodyXl;
    			@extend %textBold;
    
    
    		}
    
    		#{$self}__circle {
    
    			bottom: map-deep-get($token-spacer-unit-map, "2");
    			right: map-deep-get($token-spacer-unit-map, "2");
    
    		}
    
    		.#{$namespace}icon {
    
    			&::before {
    
    				@include custom-prop-fallback("font-size", "comp-avatar-extra-large-icon-size");
    
    			}
    
    		}
    
    		&.-avatarSquare {
    
    			@include custom-prop-fallback("border-radius", "comp-avatar-extra-large-square-border-radius");
    
    		}
    
    	}
    
    	&.-disabled {
    
    		filter: grayscale(100%);
    
    	}
    
    	&.-badgeVisible,
    	&.-userBank {
    
    		overflow: visible;
    
    	}
    
    	&.-avatarBank,
    	&.-bank {
    
    		display: flex;
    		align-items: center;
    		justify-content: center;
    		@include custom-prop-fallback("background-color", "sys-color-background-primary-15");
    		@include custom-prop-fallback("color", "sys-color-text-primary-vivid");
    
    	}
    
    	&.-avatarNoBg,
    	&.-noBackground {
    
    		background-color: transparent;
    
    	}
    
    	&.-avatarBase {
    
    		@include custom-prop-fallback("background-color", "comp-avatar-background-color");
    		@include custom-prop-fallback("color", "comp-avatar-text-color");
    
    	}
    
    	/* random parent element */
    	/* 
    	*
    	*   Syntax : .randomParentElt & {}
    	*
    	*/
    
    	/* Pseudo Classes */
    
    	&:hover {
    		@media (hover: hover) {
    
    		}
    	}
    
    	&:focus {
    	}
    
    	&:active {
    	}
    
    	&:focus,
    	&:active {
    	}
    
    }
  • URL: /components/raw/avatar/_avatar.scss
  • Filesystem Path: components/token-based/content/avatar/_avatar.scss
  • Size: 5.8 KB