Open wujekbogdan opened 5 years ago
From the docs:
To init the plugin on an image simply use the
font-family
property directly on your image..imagecontainer-img { object-fit: contain; font-family: "object-fit: contain"; }
But I will make it clearer for you.
@aFarkas I understand how it works, I'm just saying that it would be good to mention, in the docs, that there's no need to add font-family declarations manually because there's an automated solution - the postcss-object-fit-images plugin. That's my point.
The documentation for the lazySizes object fit extension does mention that the polyfill is not a fully-automated solution and some CSS fiexes are required (
font-family: "object-fit: contain/cover";
)In fact it could be automated by PostCSS plugin: ronik-design/postcss-object-fit-images.
It is a plugin that parses the CSS file and adds apropriate
font-family
declarations.So It would be good to add a little note about it to docs.