Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix false positives for container queries in *-no-unknown #6318

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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