Skip to content

Commit

Permalink
Fix declaration-property-value-no-unknown false negatives for `@sta…
Browse files Browse the repository at this point in the history
…rting-style` (#7461)

Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com>
  • Loading branch information
fpetrakov and ybiquitous committed Jan 15, 2024
1 parent e0754a9 commit d881c9d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-mice-enjoy.md
@@ -0,0 +1,5 @@
---
"stylelint": minor
---

Fixed: `declaration-property-value-no-unknown` false negatives for `@starting-style`
9 changes: 2 additions & 7 deletions lib/reference/atKeywords.cjs
Expand Up @@ -10,6 +10,7 @@ const nestingSupportedAtKeywords = new Set([
'layer',
'media',
'scope',
'starting-style',
'supports',
]);

Expand All @@ -34,12 +35,11 @@ const pageMarginAtKeywords = new Set([
]);

// https://developer.mozilla.org/en/docs/Web/CSS/At-rule
const atKeywords = uniteSets(pageMarginAtKeywords, [
const atKeywords = uniteSets(nestingSupportedAtKeywords, pageMarginAtKeywords, [
'annotation',
'apply',
'character-variant',
'charset',
'container',
'counter-style',
'custom-media',
'custom-selector',
Expand All @@ -48,19 +48,14 @@ const atKeywords = uniteSets(pageMarginAtKeywords, [
'font-feature-values',
'import',
'keyframes',
'layer',
'media',
'namespace',
'nest',
'ornaments',
'page',
'property',
'scroll-timeline',
'scope',
'starting-style',
'styleset',
'stylistic',
'supports',
'swash',
'viewport',
]);
Expand Down
9 changes: 2 additions & 7 deletions lib/reference/atKeywords.mjs
Expand Up @@ -6,6 +6,7 @@ export const nestingSupportedAtKeywords = new Set([
'layer',
'media',
'scope',
'starting-style',
'supports',
]);

Expand All @@ -30,12 +31,11 @@ const pageMarginAtKeywords = new Set([
]);

// https://developer.mozilla.org/en/docs/Web/CSS/At-rule
export const atKeywords = uniteSets(pageMarginAtKeywords, [
export const atKeywords = uniteSets(nestingSupportedAtKeywords, pageMarginAtKeywords, [
'annotation',
'apply',
'character-variant',
'charset',
'container',
'counter-style',
'custom-media',
'custom-selector',
Expand All @@ -44,19 +44,14 @@ export const atKeywords = uniteSets(pageMarginAtKeywords, [
'font-feature-values',
'import',
'keyframes',
'layer',
'media',
'namespace',
'nest',
'ornaments',
'page',
'property',
'scroll-timeline',
'scope',
'starting-style',
'styleset',
'stylistic',
'supports',
'swash',
'viewport',
]);
Expand Up @@ -11,6 +11,9 @@ testRule({
{
code: 'a { top: 0; }',
},
{
code: 'a { @starting-style { opacity: 0; } }',
},
{
code: 'a { @media screen { top: 0; } }',
},
Expand Down Expand Up @@ -148,6 +151,14 @@ testRule({
endLine: 1,
endColumn: 33,
},
{
code: 'a { @starting-style { padding: auto; } }',
message: messages.rejected('padding', 'auto'),
line: 1,
column: 32,
endLine: 1,
endColumn: 36,
},
{
code: 'a { top: red; }',
message: messages.rejected('top', 'red'),
Expand Down

0 comments on commit d881c9d

Please sign in to comment.