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

feat: output srcset as a custom attribute #349

Open
heyitsbryanm opened this issue Aug 4, 2023 · 0 comments
Open

feat: output srcset as a custom attribute #349

heyitsbryanm opened this issue Aug 4, 2023 · 0 comments

Comments

@heyitsbryanm
Copy link
Contributor

Is your feature request related to a problem? Please describe.

Some CMS components require srcsets to be output as a custom attribute for other files or scripts.

For example, the Cornerstone theme for the BigCommerce CMS uses a data-image-gallery-new-image-srcset attribute to swap out the srcset of the main image in a product display page:

image

Describe the solution you'd like

A way to pass an imgix.js generated srcset to a custom HTML attribute.

An example solution:

  1. Create custom configuration - ex: imgix.config.customSrcsetAttribute = 'data-image-gallery-new-image-srcset';
  2. A srcset could then be generated with <img data-image-gallery-new-image-srcset="http://bryansandbox.imgix.net/_static/images/img02.jpg"/>
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