-
Notifications
You must be signed in to change notification settings - Fork 3
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
Generate image as background url #271
Comments
Hey @lcottingham and thanks for the question,. |
@sherwinski thanks for getting back to me 👍 Incorporating the js-core API methods into this package would be helpful. Yes, I could install both but i'd still have to declare two different ImgIx clients to do a very similar job. This isn't really ideal for me. Could we look at expanding the capability slightly to recognise even just a Currently we have: What about if we have? (just like we have The output of this would be: |
@lcottingham Totally agree that having dedicated component/logic for handling this would be most ideal. And I think that something like your suggested approach could work for those purposes. |
Perfect - I can work with my workaround for now 👍 |
Please provide the following information and someone from @imgix/imgix-sdk-team will respond to your issue shortly.
Before you submit:
Question
Generate a URL from the path, but set it as a background image URL? This could be a parameter specifically determining
src
,srcset
orbackground-image
URL.Alternatively, could a URL be easily generated directly in a component that can be fed into a variable for HTML consumption?
It is fairly common in UI design that an image will be dynamically set as a background image so that it can fit or cover the container's available space. Yes, there is the
object fit
property on an image, but this isn't too widely supported on older browsers.The text was updated successfully, but these errors were encountered: