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

objectFit props @unpic/solid #283

Open
xinha-sh opened this issue Jul 3, 2023 · 0 comments
Open

objectFit props @unpic/solid #283

xinha-sh opened this issue Jul 3, 2023 · 0 comments

Comments

@xinha-sh
Copy link

xinha-sh commented Jul 3, 2023

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

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

No branches or pull requests

1 participant