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

Whitelist srcset for responsive images #233

Closed
franciscop opened this issue Nov 22, 2015 · 1 comment
Closed

Whitelist srcset for responsive images #233

franciscop opened this issue Nov 22, 2015 · 1 comment

Comments

@franciscop
Copy link

I am creating a repository where different sized images would be really nice for mobile version. Short story long, I've seen there's some html allowed including <img> and the attribute src, so I propose also allowing srcset for responsive images like this:

:attributes => {
  'a'          => ['href'],
  'img'        => ['src', 'srcset', 'longdesc'],
  'div'        => ['itemscope', 'itemtype'],
  ...
@franciscop
Copy link
Author

Although looking more into it, srcset is dependent on the resolution and not on the device width. I'd normally use media queries, but that's a lot of css that is probably not allowed in github. Can anyone think of another solution to allow for different images in different device sizes?

Maybe a couple of attributes called data-desktop and data-mobile or others could work, but that'd require some css in your part and it's highly opinionated

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