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

Responsive header_feature_image (optimized for mobile devices)? #281

Closed
musicmichaelc opened this issue May 14, 2021 · 3 comments · Fixed by #333
Closed

Responsive header_feature_image (optimized for mobile devices)? #281

musicmichaelc opened this issue May 14, 2021 · 3 comments · Fixed by #333

Comments

@musicmichaelc
Copy link

I was wondering whether there is a way to make the header_feature_image display better on mobile devices. As of now, the image (which I sized to 2484x1280px as recommended in the documentation) displays well on a desktop computer, but on a mobile phone, I can only see a small cut out section of the image.

Would it be possible to create several different image sizes—so as to serve the most optimal sizes depending on the device? Or is there already a way to do this that I might have missed?

@sylhare
Copy link
Owner

sylhare commented May 19, 2021

I will look into it so that we can have multiple size of image for the header, or at least a better scaling on mobile.

@sylhare
Copy link
Owner

sylhare commented Jun 16, 2021

Then I'll try something either with one image or and array of images for the background image.
Maybe with something like:

<img srcset="
  examples/images/image-384.jpg 1x, 
  examples/images/image-768.jpg 2x
" alt="">

and

.img {
  background-image: url(examples/images/image-384.jpg); 
}
@media 
  (-webkit-min-device-pixel-ratio: 2), 
  (min-resolution: 192dpi) { 
  .img {
    background-image: url(examples/images/image-768.jpg);
  }
}

@sylhare
Copy link
Owner

sylhare commented Feb 1, 2022

PR is here #333 , you can check it out 👍

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

Successfully merging a pull request may close this issue.

2 participants