Re: Background image cropping

10.06.2014, 19:58, "Sylvain Galineau" <galineau@adobe.com>:
> On Jun 10, 2014, at 8:16 AM, Marat Tanalin <mtanalin@yandex.ru> wrote:
>> š10.06.2014, 18:44, "Dirk Schulze" <dschulze@adobe.com>:
>>> šI believe Mozilla has a -moz-image-rect() [1] image function that clips the input image argument. It is not specified though.
>>>
>>> šDirk
>>>
>>> š[1] https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-image-rect
>> šBy the way, Mozilla's `-moz-image-rect()` functional notation looks much better than Media Fragments in CSS for several reasons
> Yes, I agree the readability and usability of a URI fragment are poor. A functional notation that would result in the client requesting the image using the corresponding media fragment URI sounds interesting. As long as it does not result in the kind of poor user experience described above.

To be clear: my point is that while Media Fragments in general may make some sense as a compact way to pack some meta data into URL for the purpose of somewhat easy sharing the URL as a standalone thing, I doubt we should stick with Media Fragments _in CSS_ while there are more intuitive, usable and flexible options consistent with the rest part of CSS.

After all, Media Fragments and pure-CSS solutions are not mutually exclusive. 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)
    )

Received on Wednesday, 11 June 2014 00:30:59 UTC