Re: Controlling content based on resolution

> Per the spec there is no limitation to the usage of CSS Media Queries
with SVG

Yeah, I guess I was more asking whether it was clear to implementers
whether something like max-width referred to the SVG width or the page
width.  In the spec, the definition of 'width' is:

    The ‘width’ media feature describes the width of the *targeted display
area of the output device*.

Would it be reasonable to interpret references to width in SVG CSS media
queries refer to the width of the SVG?  If yes, should that be made
explicit in the spec?  If not, does there need to be a different property
for SVG use?

Paul



On 20 August 2014 02:25, Jeremie Patonnier <jeremie.patonnier@gmail.com>
wrote:

> Hi!
>
> Per the spec there is no limitation to the usage of CSS Media Queries with
> SVG
>
> But it could be very cool if the media attribut available on some HTML
> element (link, source) could be usable on all SVG elements or at least on
> containers such as <g> or <svg> (In a web developer point of view this will
> be way more efficient and easier to use than <switch>).
>
>
> 2014-08-19 15:43 GMT+02:00 Paul LeBeau <paul.lebeau@gmail.com>:
>
> Hi all
>>
>> There is an interesting article here on the problems with using vector
>> graphics for lower resolution icons.
>>
>> http://www.pushing-pixels.org/2011/11/04/about-those-vector-icons.html
>>
>> Obviously one way you could remedy this would be with new <switch>
>> attributes (eg. requiredWidth="32px" etc).  Another way would be with CSS
>> @media queries:
>>
>>
>>
>> @media (max-width: 32px) {
>>   G.widget {
>>     display: none;
>>   }}
>>
>> Has it been discussed here previously whether, and to what extent, @media
>> queries can be used in SVG stylesheets?
>>
>> Paul
>>
>>
>
>
> --
> Jeremie
> .............................
> Web : http://jeremie.patonnier.net
> Twitter : @JeremiePat <http://twitter.com/JeremiePat>
>

Received on Tuesday, 19 August 2014 15:19:19 UTC