unpic-img icon indicating copy to clipboard operation
unpic-img copied to clipboard

objectFit props @unpic/solid

Open heyshubhamsinha opened this issue 3 years ago • 0 comments

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:

  1. Create a solid start project https://start.solidjs.com/getting-started/project-setup
  2. Install @unpic/solid
  3. 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",
        })}
      />
  1. Inspect element. The object-fit: contain gets overridden

Expected behavior img element should have object-fit: contain

Screenshots

Issue: Screenshot 2023-07-03 at 12 05 09 PM

Temporary Fix:

Screenshot 2023-07-03 at 12 05 27 PM

heyshubhamsinha avatar Jul 03 '23 06:07 heyshubhamsinha