ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
50.93k stars 13.51k forks source link

feat: support srcset on ion-img #29851

Closed trydofor closed 2 weeks ago

trydofor commented 2 weeks ago

Prerequisites

Describe the Feature Request

this feature https://github.com/ionic-team/ionic-framework/issues/18185 has been closed with no comments.

but the fixed-size image with variable density is needed for mobile development. e.g.

<img 
alt="A cat"
src="cat.jpg"
srcset="cat-2x.jpg 2x, cat-3x.jpg 3x"
>

please add the following props to ion-img

or, let me know if there are any drawbacks to this idea.

Describe the Use Case

the image is a fixed size in pixels, but for screens of different density.

Describe Preferred Solution

No response

Describe Alternatives

No response

Related Code

No response

Additional Information

No response

sean-perkins commented 2 weeks ago

@trydofor the ion-img component doesn't serve any advantages to developers today over the img element. Developers should use the img tag directly.

It is a component that has had low prioritization for deprecation/removal, but is unlikely to support newer features.

trydofor commented 2 weeks ago

Thanks for the answer, I will close this issue, use img instead.