Skip to content

Commit

Permalink
Fix function-no-unknown false positives for anchor and anchor-size
Browse files Browse the repository at this point in the history
  • Loading branch information
Mouvedia committed Apr 17, 2024
1 parent 6f6abba commit a936165
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/strong-spies-dance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"stylelint": patch
---

Fixed: `function-no-unknown` false positives for `anchor` and `anchor-size`
6 changes: 6 additions & 0 deletions lib/rules/function-no-unknown/__tests__/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ testRule({
{
code: 'a { height: calc(10px*(5*(10 - 5))); }',
},
{
code: 'a { top: anchor(bottom); }',
},
{
code: 'a { min-width: anchor-size(--button width); }',
},
{
code: 'a { transform: color.adjust(1px); transform: rgb(color.adjust(1px)); }',
description: 'ignore scss namespaced functions',
Expand Down
3 changes: 3 additions & 0 deletions lib/rules/function-no-unknown/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ const rule = (primary, secondaryOptions) => {
'color-stop',
'from',
'to',
// #7566
'anchor',
'anchor-size',
];

root.walkDecls((decl) => {
Expand Down
3 changes: 3 additions & 0 deletions lib/rules/function-no-unknown/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ const rule = (primary, secondaryOptions) => {
'color-stop',
'from',
'to',
// #7566
'anchor',
'anchor-size',
];

root.walkDecls((decl) => {
Expand Down

0 comments on commit a936165

Please sign in to comment.