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

[css-backgrounds]/[css-images]: Proposal add image-center definition for auto sizing images #5919

Open
SetTrend opened this issue Feb 2, 2021 · 1 comment

Comments

@SetTrend
Copy link

SetTrend commented Feb 2, 2021

Very often I find myself using asymmetric images.

When I use the cover sizing rule on those images, it regularly happens that important parts get cropped or unimportant parts, like bosoms, are the only thing left after rotating a device.

So, I'd like to propose to create a new CSS rule, allowing to provide the center point around which the image is centered when cover is used.

The proposed new rule may accept the same values as the background-position rule.

I suggest the following names for the proposed attribute: background-image-center and object-center.

Here's an animation, depicting the suggested rule and behaviour:

Proposal - Background image center

The red cross depicts the position declared by the proposed rule.

@tabatkins
Copy link
Member

That's not a bad idea. The "Twitter image-crop fails" problem is very real. The properties seem reasonable to me too. I don't think we'd really need to extend this to other image-taking properties.

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

No branches or pull requests

2 participants