Skip to content

Commit

Permalink
Fix false positives for container queries in *-no-unknown (#6318)
Browse files Browse the repository at this point in the history
  • Loading branch information
fpetrakov committed Sep 3, 2022
1 parent 4401602 commit 2b17f21
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/spicy-toes-rule.md
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed: `*-no-unknown` false positives for container queries
1 change: 1 addition & 0 deletions lib/reference/atKeywords.js
Expand Up @@ -28,6 +28,7 @@ const atKeywords = uniteSets(pageMarginAtKeywords, [
'apply',
'character-variant',
'charset',
'container',
'counter-style',
'custom-media',
'custom-selector',
Expand Down
7 changes: 7 additions & 0 deletions lib/reference/units.js
Expand Up @@ -39,6 +39,13 @@ const lengthUnits = new Set([
'mozmm',
// Flexible length units
'fr',
// Container query units
'cqw',
'cqh',
'cqi',
'cqb',
'cqmin',
'cqmax',
]);

const units = uniteSets(lengthUnits, [
Expand Down
6 changes: 6 additions & 0 deletions lib/rules/at-rule-no-unknown/__tests__/index.js
Expand Up @@ -10,6 +10,12 @@ testRule({
{
code: "@charset 'UTF-8';",
},
{
code: '@container (min-width: 700px)',
},
{
code: '@CONTAINER (min-width: 500px)',
},
{
code: "@CHARSET 'UTF-8';",
},
Expand Down

0 comments on commit 2b17f21

Please sign in to comment.