Skip to content

Commit

Permalink
Ignore CSS Custom Properties on prefix in value lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed Oct 27, 2022
1 parent a16e12f commit 878d82c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/declaration.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Declaration extends Prefixer {
continue
}
if (value.includes(other)) {
return true
return value.replace(/var\([^)]+\)/, '').includes(other)
}
}
return false
Expand Down
4 changes: 4 additions & 0 deletions test/cases/user-select.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ b {
.all {
user-select: all;
}

.var {
user-select: var(--o-select);
}
6 changes: 6 additions & 0 deletions test/cases/user-select.out.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ b {
-webkit-user-select: all;
user-select: all;
}

.var {
-webkit-user-select: var(--o-select);
-ms-user-select: var(--o-select);
user-select: var(--o-select);
}

0 comments on commit 878d82c

Please sign in to comment.