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

Set height with sizes attribute #900

Open
wokalek opened this issue Jun 29, 2023 · 0 comments
Open

Set height with sizes attribute #900

wokalek opened this issue Jun 29, 2023 · 0 comments

Comments

@wokalek
Copy link

wokalek commented Jun 29, 2023

Usecase: you have long image (width > height) and you need square to thumbnail, eg:

image

You cant do object: cover, because settings sizes="'xs:72px sm:102px md:114px lg:138px xl:160px xxl:184px 2xl:552px'" do this:

image


image

It's blurry and not 138x138.
But if you specified fit="cover", it doesn't help, because getSizes receives already counted 138x82 as width/height

So, what if you can provide height in sizes property xs:72x72 sm:102x102 md:114x114 lg:138x138 xl:160x160 xl:184x184 2xl:552x552?

And with this fit modifier will work!

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