Skip to content

objectFit props @unpic/solid #283

@xinha-sh

Description

@xinha-sh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions