Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function matchQuery(mediaQuery, values) {
value = values[feature];

// Missing or falsy values don't match.
if (!value) { return false; }
if (!value && value !== 0) { return false; }

switch (feature) {
case 'orientation':
Expand Down
6 changes: 6 additions & 0 deletions test/unit-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ describe('mediaQuery.match()', function () {
'(max-height: 1000px)', {height: '60pc'}
)).to.be.true;
});

it('should work with literal 0', function () {
expect(mediaQuery.match(
'(max-height: 1000px)', {height: 0}
)).to.be.true;
});
});

});
Expand Down