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

Platform image helper #15824

Open
alexgibson opened this issue Jan 8, 2025 · 0 comments
Open

Platform image helper #15824

alexgibson opened this issue Jan 8, 2025 · 0 comments

Comments

@alexgibson
Copy link
Member

Description

A while back we had a platform image helper, which would use JavaScript to serve different images based on operating system (e.g. Windows, macOS, Linux). That code no longer exists today, but there have been a couple of requests recently where this kind of functionality would have been useful again.

Reinstating a helper like this today would likely be a little more complex, since we now often serve responsive images and not just 2x high-res versions. We could either create a new, special helper just for this use case, or alternatively update resp_img() with some new functionality. Adding data attributes like data-srcset-win and data-srcset-mac etc, which could be swapped out with srcset using JS might work.

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

No branches or pull requests

1 participant