Re: Background image cropping

11.06.2014, 04:52, "Sylvain Galineau" <galineau@adobe.com>:
> On Jun 10, 2014, at 5:30 PM, Marat Tanalin <mtanalin@yandex.ru> wrote:
>> šMedia Fragments could be used in CSS for some simplest cases, while pure-CSS solutions could be used as a more flexible and usable alternative when needed.
>>
>> šFor example, how would following expression be expressed in terms of Media Fragments?
>>
>> šššš/* Here we have 4em-size center part of the image: */
>> šššš-moz-image-rect(
>> ššššššššcalc(50% - 2em),
>> ššššššššcalc(50% - 2em),
>> ššššššššcalc(50% - 2em),
>> ššššššššcalc(50% - 2em)
>> šššš)
>
> In cases like this you'd need the full image to compute the result anyway, so it's not really a scenario for MF.
>
> This thread started with background sprites as they are currently built on the web. Those can certainly use MF, though some syntactic sugar to build the fragment may be nice...

Based on whay you say, it looks like that Media Fragments cause a separate HTTP request for each region of the same image (one image => multiple HTTP requests).

This is the contrary to the main idea behind sprites that consists of uniting multiple images into a single image file to _minimize_ the number of HTTP requests (multiple images => one HTTP request).

If so, MF look like not suitable for the purpose of spriting at all.

Received on Wednesday, 11 June 2014 15:12:30 UTC