W3C home > Mailing lists > Public > www-style@w3.org > June 2014

Re: Background image cropping

From: Marat Tanalin <mtanalin@yandex.ru>
Date: Wed, 11 Jun 2014 04:30:24 +0400
To: Sylvain Galineau <galineau@adobe.com>
Cc: Dirk Schulze <dschulze@adobe.com>, Tab Atkins Jr. <jackalmage@gmail.com>, Lajos Koszti <ajnasz@ajnasz.hu>, "<www-style@w3.org>" <www-style@w3.org>
Message-Id: <999371402446624@web16h.yandex.ru>
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: */
        calc(50% - 2em),
        calc(50% - 2em),
        calc(50% - 2em),
        calc(50% - 2em)
Received on Wednesday, 11 June 2014 00:30:59 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:43 UTC