ashleydw / lightbox

A lightbox gallery plugin for Bootstrap
http://ashleydw.github.io/lightbox
MIT License
1.85k stars 1.3k forks source link

Fix css centering on mobile #268

Open gusano opened 7 years ago

gusano commented 7 years ago

On some mobiles the modal is not centered (see screenshots below). This fixes it by using flexbox.

Before

deepinscreenshot_select-area_20170902211437 deepinscreenshot_select-area_20170902211452

After

deepinscreenshot_select-area_20170902211525 deepinscreenshot_select-area_20170902211540

gusano commented 7 years ago

I don't know how minifying css is done (didn't use Grunt in a looong time) but it looks like dist/ekko-lightbox.min.css hasn't changed since a year ago, otherwise I would happily add the change there as well. Meanwhile I'm gonna use my fork :)

Thanks for the nice lib!

ashleydw commented 7 years ago

As this plugin uses bootstraps modals, isn't this a problem in bootstrap rather than the plugin?

VirginieGarcin commented 6 years ago

Indeed it's the default behaviour of bootstrap modal. It's not only on mobile: bootstrap modal is always shown at the top of the page. (On desktop as the display is landscape we will not notice it for classic pictures, except for panoramic images.)

Even if it's the default modal behaviour, the result would be nicer if the image was centred vertically :)