Media: Fetch

Modifiers

The media element has the following modifiers

Size:

  • -media2xs
  • -mediaXs
  • -mediaLg
  • -mediaXl

Misc

  • -mediaHasBg: Gives the media a background
  • -mediaRounded: Gives the media rounded corners. The rounded corners are different with each size variant
  • -mediaBorder: Gives the media a border
<div class="sds-media -media2xs -mediaRounded">

    <span class="sds-skeletonUnit -floating -radiusInherit"></span>

</div>
<div class="{{ namespace }}media{% for mod in modifiers %} {{ mod }}{% endfor %}{% for mod in classes %} {{ mod }}{% endfor %}">
	{% if fallback %}
		<span class="{{ namespace }}media__icon {{ namespace }}icon {{ namespace }}icon-photo"></span>
	{% endif %}
	{% if fetch %}
		{% render "@skeleton-unit",{
			classes: ["-floating", "-radiusInherit"]
		},true %}
	{% endif %}
	{% if inlineSvg %}
	{{ inlineSvg | safe }}
		{% elseif img %}
	<img src="{{ (mediaPath + img) | path }}" alt="">
	{% endif %}
</div>
  • Content:
    /* variables specific to current element */
    
    $element-specific-variables: "";
    
    .#{$namespace}media {
    
    	/* Save root element context for easy access if nesting is needed */
    
    	$self: &;
    
    	/* properties of current element  + media queries */
    	position: relative;
    	z-index: z("zero");
    	@include custom-prop-fallback("width","comp-media-width");
    	@include custom-prop-fallback("height","comp-media-height");
    	display: inline-flex;
    	align-items: center;
    	justify-content: center;
    
    	/* 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 */
    
    	// media__childElement
    	svg,
    	IMG {
    
    		// follows same logic as parent
    
    		width: 100%;
    		height: 100%;
    		object-fit: contain;
    
    	}
    	
    	IMG {
    
    		border-radius: inherit;
    
    	}
    	
    	&__icon {
    
    		@include custom-prop-fallback("color","comp-media-fallback-icon-background-color");
    
    		&::before {
    
    			@include custom-prop-fallback("font-size","comp-media-fallback-medium-icon-size");
    
    		}
    
    	}
    
    	/* modifiers */
    
    	&.-media2xs {
    
    		@include custom-prop-fallback("width","comp-media-large-width");
    		@include custom-prop-fallback("height","comp-media-large-height");
    		@include custom-prop-fallback-override("comp-media-extra-small-border-radius","comp-media-large-border-radius");
    		@include custom-prop-fallback-override("comp-media-fallback-medium-icon-size","comp-media-fallback-large-icon-size");
    
    	}
    
    	&.-mediaXs {
    
    		@include custom-prop-fallback("width","comp-media-extra-large-width");
    		@include custom-prop-fallback("height","comp-media-extra-large-height");
    		@include custom-prop-fallback-override("comp-media-extra-small-border-radius","comp-media-extra-large-border-radius");
    		@include custom-prop-fallback-override("comp-media-fallback-medium-icon-size","comp-media-fallback-extra-large-icon-size");
    
    	}
    
    	&.-mediaLg {
    
    		@include custom-prop-fallback("width","comp-media-giga-width");
    		@include custom-prop-fallback("height","comp-media-giga-height");
    		@include custom-prop-fallback-override("comp-media-extra-small-border-radius","comp-media-giga-border-radius");
    		@include custom-prop-fallback-override("comp-media-fallback-medium-icon-size","comp-media-fallback-giga-icon-size");
    
    	}
    
    	&.-mediaXl {
    
    		@include custom-prop-fallback("width","comp-media-tera-width");
    		@include custom-prop-fallback("height","comp-media-tera-height");
    		@include custom-prop-fallback-override("comp-media-extra-small-border-radius","comp-media-tera-border-radius");
    		@include custom-prop-fallback-override("comp-media-fallback-medium-icon-size","comp-media-fallback-tera-icon-size");
    
    	}
    
    	// media -hasBG
    	&.-mediaHasBg {
    
    		// follows same logic as base element
    
    		@include custom-prop-fallback("background-color","comp-media-background-color");
    
    	}
    
    	&.-mediaRounded {
    
    		@include custom-prop-fallback("border-radius","comp-media-extra-small-border-radius");
    
    	}
    
    	&.-mediaBorder {
    
    		border: map-deep-get($design-tokens, "comp-media-outline-border-width") solid;
    		@include custom-prop-fallback("border-color","comp-media-outline-border-color");
    
    	}
    
    	/* random parent element */
    	/* 
    	*
    	*   Syntax : .randomParentElt & {}
    	*
    	*/
    
    	/* Pseudo Classes */
    
    	&:hover {
    		@media (hover: hover) {
    
    		}
    	}
    
    	&:focus {
    	}
    
    	&:active {
    	}
    
    	&:focus,
    	&:active {
    	}
    
    }
  • URL: /components/raw/media/_media.scss
  • Filesystem Path: components/token-based/content/media/_media.scss
  • Size: 3.4 KB