Skip to content

Wrong feature detection for grid, color, color-index and monochrome #10

Open
@maltewassermann

Description

@maltewassermann

The features at https://github.com/ericf/css-mediaquery/blob/master/index.js#L67-74
does not handle the following case (one or both expressions without an value) on the correct way:

mediaQuery.match('screen and (color)', {
  type : 'screen',
  color: 8
});

See http://www.w3.org/TR/css3-mediaqueries/#color

One possible approach might be this (@ericf, -1 and -1 returns true – but a specified cannot be negative, in general!?):

expValue = !isNaN(expValue) ? parseInt(expValue, 10) : value > 0 ? value : 1;
value = !isNaN(value) ? parseInt(value, 10) : expValue > 0 ? expValue : 0;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions