Skip to content

Commit 22209f0

Browse files
authored
Fix diagnostic false-positive when no CSS properties are present (#793)
1 parent 53b81ca commit 22209f0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/tailwindcss-language-service/src/diagnostics/getCssConflictDiagnostics.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,14 @@ export async function getCssConflictDiagnostics(
8282
return false
8383
}
8484

85+
let propertiesAreComparable = false
86+
8587
for (let i = 0; i < otherRules.length; i++) {
8688
let otherRule = otherRules[i]
8789
let properties = getRuleProperties(otherRule)
90+
if (info[i].properties.length > 0 && properties.length > 0) {
91+
propertiesAreComparable = true
92+
}
8893
if (!equal(info[i].properties, properties)) {
8994
return false
9095
}
@@ -94,6 +99,10 @@ export async function getCssConflictDiagnostics(
9499
}
95100
}
96101

102+
if (!propertiesAreComparable) {
103+
return false
104+
}
105+
97106
return true
98107
})
99108

0 commit comments

Comments
 (0)