-
Notifications
You must be signed in to change notification settings - Fork 81
MediaQuery.text minor bug #30
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
Conversation
MediaQuery mediaType and features needs to be joined trough "and". Not a big issue but window.matchMedia reports the MediaQuery .text as invalid
|
Thanks for the pull request, but this isn't the right location for such a fix. You actually need to make a change in the source file not in the completely built file. |
|
Sorry about this. Indeed I see that the right file is parser-lib /src /css/MediaQuery.js. Should I do another pull request with the right file? Thank for this wonderful piece of work! |
|
Yep, that's the right place to do it. If you could also add in some unit tests that verify this new functionality, I would be very appreciative. |
MediaQuery mediaType and features needs to be joined trough "and". For example parsing "only screen and (min-width:450px) and (max-width:1950px)", the text output will be "only screen (min-width:450px) and (max-width:1950px)". It is parsed right but the new text string will be invalid if matched with window.matchMedia.
|
Added the change at the right file src/css/MediaQuery.js and set up a small test using the modified parser functionality at: http://typefolly.com/nzakas-parser-lib-63fd3bf/tests/css/CSSMediaQueryTests.html. |
|
Sorry for the delay, I was traveling. The test should be done as a standalone JavaScript file kind of like this: https://github.com/nzakas/parser-lib/blob/master/tests/css/Parser.js That way, it automatically gets picked up by the build and run. |
|
Sorry, I have not done unit testing. So basically all I have to do is to add my tests to the Parser.js file from my forked version? Thanks. |
|
Yup |
Added test for MediaQuery.text.
|
I've appended a MediaQuery.text test onto the existing tests. Hope it will work. |
|
It looks like the tests are failing (according to the Travis build - sorry about it not turning red, I need to fix that). |
MediaQuery mediaType and features needs to be joined trough "and".
For example parsing "only screen and (min-width:450px) and (max-width:1950px)", the text output will be
"only screen (min-width:450px) and (max-width:1950px)".
It is parsed right but the new text string will be invalid if matched with window.matchMedia
Thank you.