unpic-img
unpic-img copied to clipboard
objectFit props @unpic/solid
Describe the bug
The objectFit props isn't documented. And by default it resolves to cover, even overrides styles provided via class attribute.
To Reproduce Steps to reproduce the behavior:
- Create a solid start project https://start.solidjs.com/getting-started/project-setup
- Install @unpic/solid
- Use Image component I'm using macron-css for styling. But I guess css module will also work.
<Image
src={props.img.src}
background={props.img.placeholder}
layout="fullWidth"
class={style({
border: `2px solid ${vars.color.gray[300]}`,
borderRadius: vars.space[5],
objectFit: "contain",
})}
/>
- Inspect element. The
object-fit: containgets overridden
Expected behavior
img element should have object-fit: contain
Screenshots
Issue:
Temporary Fix: