By Josh Lewis on Friday, 07 February 2014
Posted in General Issues
Replies 8
Likes 0
Views 1.1K
Votes 0
I'm curious about the reasoning behind making images in ES a CSS background instead of HTML images? This makes it very difficult to manipulate them in terms of styling. I was testing out the new lightbox feature (which is totally awesome by the way). I was attempting to make a dark theme out of the lightbox and wanted to add thinks like a box-shadow and possibly light round corners around the images. But then I realized that the images themselves are produced from a background rather than HTML which makes this pretty much impossible.

I can still of course make other various edits to the lightbox which is nice.
Hi, the only reason is so we can use "background-size" with cover/contain so we won't have to worry about calculating the image width and height and the let the browser do the work for us.
·
Friday, 07 February 2014 15:44
·
0 Likes
·
0 Votes
·
0 Comments
·
That makes sense. Upon further experimenting I discovered another method to accomplish the auto calculation. It uses max-width: 100% and max-height: 100%. This allows the image ratio to of course remain the same as well and is 100% responsive. Images that are small (less than 500px) would display as they are which is a good thing because they don't stretch.

I made a 30 second video showing the max-height/width method used on a HTML image inserted within the image box: http://www.youtube.com/watch?v=xHHhcPYogYU
Notice it works very well with the browser size. I inserted a small picture at the end to show that it does not stretch tiny images. The alignment isn't perfect, but with a little bit of CSS that could be fixed pretty easily.

Perhaps there is a reason this method wasn't used? If it doesn't have any issues I believe it would be worth considering.
·
Friday, 07 February 2014 16:42
·
0 Likes
·
0 Votes
·
0 Comments
·
Cool! That's a neat trick. Yes, this is worth considering putting into EasySocial.
·
Friday, 07 February 2014 16:47
·
0 Likes
·
0 Votes
·
0 Comments
·
I've got great news, I tested this with internet explorer which it works! Keep in mind that this can't really be tested in the frosty theme because IE destroys the template when viewing images. With all the work put into the new theme I honestly feel bad about it (IE messing up the theme). I'm very pleased to see it work well in the good browsers!

The 100% max method works well in all browsers.
·
Friday, 07 February 2014 17:43
·
0 Likes
·
0 Votes
·
0 Comments
·
Alright we'll evaluate and see if it can be added to the 1.3 or 1.4 roadmap.
·
Tuesday, 11 February 2014 11:11
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks Jensen. I'm not saying this now because I need this soon, but because later these issues might be much harder to address. This is why I'm in favor of sooner rather than later. Glad to hear it's being considered.
·
Tuesday, 11 February 2014 12:34
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,

As mentioned, we will see if we can include this in the future.
·
Wednesday, 12 February 2014 11:10
·
0 Likes
·
0 Votes
·
0 Comments
·
·
Monday, 12 May 2014 20:33
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post