Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get just <img>? #96

Open
hmaesta opened this issue Dec 9, 2020 · 0 comments
Open

How to get just <img>? #96

hmaesta opened this issue Dec 9, 2020 · 0 comments

Comments

@hmaesta
Copy link

hmaesta commented Dec 9, 2020

Right now, <Image src="fuji.png" /> returns:

<div class="wrapper svelte-142y8oi" style="min-height: 100px; width: 100%;">
   <div class="svelte-a3bmbz loaded" style="position: relative; width: 100%;">
      <div style="position: relative; overflow: hidden;">
         <div style="width: 100%; padding-bottom: 75.419%;"></div>
         <img class="placeholder  svelte-a3bmbz" src="data:image/svg+xml;base64,PHN...">
         <picture>
            <source type="image/webp" srcset="g/fuji.webp 375w" sizes="(max-width: 1000px) 100vw, 1000px">
            <source srcset="g/fuji.png 375w" sizes="(max-width: 1000px) 100vw, 1000px">
            <img src="data:image/svg+xml;base64,PHN..." class="main svelte-a3bmbz">
         </picture>
      </div>
   </div>
</div>

Is it possible to get just a simple <img> with srcset params? i.e.:

<img src="g/fugi.png" 
     srcset="g/fugi.png 375w, g/fugi-500.png 500w, g/fugi-800.png 800w"
     loading="lazy">

I understand all the benefits from the current approach, but I usually deal with very lightweight static projects that doesn't need this kind of complexity – for example, sometimes I have to add some workarounds because of the "almost inlined" display: inline-block that this component adds to wrapper. And native loading="lazy" is just OK for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant