stack/src/components/source/source.twig line 1

Open in your IDE?
  1. {%- set src_set_attribute = props.native_lazyload or props.disable_lazy ? 'srcset="' : 'srcset="" data-srcset="' -%}
  2. {%- for source in props.sources -%}
  3.   {%- set attrs = [] -%}
  4.   {%- if source.srcset -%}
  5.     {%- set attrs = attrs|merge([src_set_attribute ~ source.srcset  ~ '"']) -%}
  6.   {%- endif -%}
  7.   {%- if source.type -%}
  8.     {%- set attrs = attrs|merge(['type="' ~ source.type ~ '"']) -%}
  9.   {%- endif -%}
  10.   {%- if source.media -%}
  11.     {%- set attrs = attrs|merge(['media="' ~ source.media ~ '"']) -%}
  12.   {%- endif -%}
  13.   {%- set attrs = attrs|join(' ')|trim -%}
  14.   <source {{ attrs|raw }}>
  15. {%- endfor -%}