-
Notifications
You must be signed in to change notification settings - Fork 1
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
Picturefill.WP plugin approach #1
Comments
@kylereicks very interesting. I took the opposite approach, which allows for no art direction at all. At the same time, I chose that approach so that the user would not have to think about responsive images, and the whole process would occur without them having to pay attention to different sizes and configurations. Does your plugin allow users to set/forget, so that they can implement a responsive image without having to determine sizes and resolution? I think the best solution would be one that allows the user to either choose their images, breakpoints, resolution, etc. or let wordpress handle everything automatically. |
@tevko I think I was able to put together some useful defaults that make the plugin worthwhile without any configuration. By default, Picturefill.WP parses I think it would probably work well for WordPress core to add an add_theme_supports feature for responsive images. Then, when we select a medium image, instead of outputting something like It makes sense to me that most of the responsibility for responsive images should remain at the theme level, but it would be great to also have a GUI to add picture elements from the editor. Although I'm the first to admit that the potential complexity of the picture element makes designing a GUI a little daunting. |
In the spirit of sharing.
With the WordPress plugin Picturefill.WP, I took the approach of using srcset and sizes rather than the picture element, along the lines of this use case. The default settings for srcset is to include the thumbnail, medium, large, and full image sizes if they are available. The sizes setting by default is set to
(max-width: {image size width}) 100vw, {image size width}
, with the "image size width" taken from the image that was added to the editor.Imitating some of WordPress' other features, srcset and sizes attributes can be set via register functions. This keeps much of the responsibility for responsive images at the theme level.
Even without the picture element, WordPress' image editing tools allow some minimal art direction. The thumbnail can be given different treatment from the rest of the images. More control of the editor would open up more possibilities for art direction.
I am interested to hear other ideas on this. Thanks very much to @Wilto for opening up a place for conversation.
The text was updated successfully, but these errors were encountered: