Skip to content

Commit 878d82c

Browse files
committed
Ignore CSS Custom Properties on prefix in value lookup
1 parent a16e12f commit 878d82c

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

lib/declaration.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Declaration extends Prefixer {
3333
continue
3434
}
3535
if (value.includes(other)) {
36-
return true
36+
return value.replace(/var\([^)]+\)/, '').includes(other)
3737
}
3838
}
3939
return false

test/cases/user-select.css

+4
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ b {
99
.all {
1010
user-select: all;
1111
}
12+
13+
.var {
14+
user-select: var(--o-select);
15+
}

test/cases/user-select.out.css

+6
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,9 @@ b {
1414
-webkit-user-select: all;
1515
user-select: all;
1616
}
17+
18+
.var {
19+
-webkit-user-select: var(--o-select);
20+
-ms-user-select: var(--o-select);
21+
user-select: var(--o-select);
22+
}

0 commit comments

Comments
 (0)