Skip to content

Commit

Permalink
Fix media-feature-name-no-unknown false positives for `environment-…
Browse files Browse the repository at this point in the history
…blending`, `nav-controls`, `prefers-reduced-data`, and `video-color-gamut` (#6978)

* Fix `media-feature-name-no-unknown` false positives

* Create sharp-pans-whisper.md

* Update sharp-pans-whisper.md

* fmt
  • Loading branch information
romainmenke authored and mattxwang committed Jun 29, 2023
1 parent 8c7d004 commit ceebf63
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/sharp-pans-whisper.md
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed: `media-feature-name-no-unknown` false positives for `environment-blending`, `nav-controls`, `prefers-reduced-data`, and `video-color-gamut`
4 changes: 4 additions & 0 deletions lib/reference/mediaFeatures.js
Expand Up @@ -32,22 +32,26 @@ const discreteTypeMediaFeatureNames = new Set([
'color-gamut',
'display-mode',
'dynamic-range',
'environment-blending',
'forced-colors',
'grid',
'hover',
'inverted-colors',
'light-level',
'nav-controls',
'orientation',
'overflow-block',
'overflow-inline',
'pointer',
'prefers-color-scheme',
'prefers-contrast',
'prefers-reduced-data',
'prefers-reduced-motion',
'prefers-reduced-transparency',
'scan',
'scripting',
'update',
'video-color-gamut',
'video-dynamic-range',
]);

Expand Down
12 changes: 12 additions & 0 deletions lib/rules/media-feature-name-no-unknown/__tests__/index.js
Expand Up @@ -65,6 +65,18 @@ testRule({
{
code: '@media (grid: 1) {}',
},
{
code: '@media (environment-blending: additive) {}',
},
{
code: '@media (nav-controls: none) {}',
},
{
code: '@media (prefers-reduced-data: reduce) {}',
},
{
code: '@media (video-color-gamut: p3) {}',
},
],

reject: [
Expand Down

0 comments on commit ceebf63

Please sign in to comment.