Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

evaluate <media-condition> as opposed to <media-query>? #3

Open
albell opened this issue Dec 16, 2014 · 1 comment
Open

evaluate <media-condition> as opposed to <media-query>? #3

albell opened this issue Dec 16, 2014 · 1 comment

Comments

@albell
Copy link
Owner

albell commented Dec 16, 2014

http://dev.w3.org/csswg/mediaqueries4/#mq-syntax

all is allowed in a <media-query> but not allowed in a <media-condition>. However there is no easy way to evaluate a <media-condition> as opposed to a <media query>. These tests will currently fail.

{sizes: 'all and (min-width:0) 100vw, 1px',        expect: '1px'},
{sizes: 'all and (min-width:0) 1px',               expect: '100vw'},

One crude but very fast approach could be to just test the string for some of the common media type strings and error out if one or more is found:

all, print, screen, speech, tty, tv, projection, handheld, braille, embossed, aural

Or possibly just ignore and leave it as is?

@zcorpan
Copy link

zcorpan commented Jan 8, 2015

Another option is to not evaluate at all, just return a list of media-condition,length pairs. It doesn't make the issue go away of course. It's not what the spec does but that doesn't matter, so long as the end result is the same the spec can be implemented in any manner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants