diff --git a/.changeset/spicy-toes-rule.md b/.changeset/spicy-toes-rule.md new file mode 100644 index 0000000000..dcb2edbebd --- /dev/null +++ b/.changeset/spicy-toes-rule.md @@ -0,0 +1,5 @@ +--- +"stylelint": patch +--- + +Fixed: `*-no-unknown` false positives for container queries diff --git a/lib/reference/atKeywords.js b/lib/reference/atKeywords.js index 70b7364cd7..40fecce563 100644 --- a/lib/reference/atKeywords.js +++ b/lib/reference/atKeywords.js @@ -28,6 +28,7 @@ const atKeywords = uniteSets(pageMarginAtKeywords, [ 'apply', 'character-variant', 'charset', + 'container', 'counter-style', 'custom-media', 'custom-selector', diff --git a/lib/reference/units.js b/lib/reference/units.js index a4de9e3bbd..b7ee630b0a 100644 --- a/lib/reference/units.js +++ b/lib/reference/units.js @@ -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, [ diff --git a/lib/rules/at-rule-no-unknown/__tests__/index.js b/lib/rules/at-rule-no-unknown/__tests__/index.js index a25337b566..cf38979eea 100644 --- a/lib/rules/at-rule-no-unknown/__tests__/index.js +++ b/lib/rules/at-rule-no-unknown/__tests__/index.js @@ -10,6 +10,12 @@ testRule({ { code: "@charset 'UTF-8';", }, + { + code: '@container (min-width: 700px)', + }, + { + code: '@CONTAINER (min-width: 500px)', + }, { code: "@CHARSET 'UTF-8';", },