Lazysizes: Why not use width and height attributes to calculate data-aspectratio if available?

Created on 23 Apr 2019  路  3Comments  路  Source: aFarkas/lazysizes

Just a quick a hopefully not dumb question ^ :)

I'm having to do extra queries in Wordpress to get the image size so as to add the "data-aspectratio" attribute while cusmomizing the "sizes" attributes(I only use sizes="auto" when necessary), when WP already always provides the width and height attributes. This in in conjunction with object-fit and your parent fit plugin.

Most helpful comment

Thank you

All 3 comments

Thank you

This is the best feature ever. :heart:

Oh, I just realized - is there a reason this has not been implemented in plugins/aspectratio?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dhymik picture dhymik  路  5Comments

robertochingon picture robertochingon  路  4Comments

tomasts248 picture tomasts248  路  6Comments

Freekbron picture Freekbron  路  3Comments

jamiemagique picture jamiemagique  路  7Comments