跳到主要内容

media-feature-name-value-no-unknown

Disallow unknown values for media features.

@media (color: red) {}
/** ↑ ↑
* feature and value pairs like these */

This rule considers values for media features defined within the CSS specifications to be known.

This rule is only appropriate for CSS. You should not turn it on for CSS-like languages, such as Sass or Less, as they have their own syntaxes.

This rule is experimental with some false negatives that we'll patch in minor releases.

It sometimes overlaps with:

If duplicate problems are flagged, you can turn off the corresponding rule.

The message secondary option can accept the arguments of this rule.

Options

true

The following patterns are considered problems:

@media (color: red) { top: 1px; }
@media (width: 10) { top: 1px; }
@media (width: auto) { top: 1px; }

The following patterns are not considered problems:

@media (color: 8) { top: 1px; }
@media (width: 10px) { top: 1px; }