Skip to content

Commit 16864d9

Browse files
committed
ignore empty content when determining rule color
1 parent e2285c0 commit 16864d9

File tree

1 file changed

+8
-1
lines changed
  • packages/tailwindcss-language-service/src/util

1 file changed

+8
-1
lines changed

packages/tailwindcss-language-service/src/util/color.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,14 @@ function getColorsInString(str: string): (TinyColor | KeywordColor)[] {
6161
function getColorFromDecls(
6262
decls: Record<string, string | string[]>
6363
): TinyColor | KeywordColor | null {
64-
let props = Object.keys(decls)
64+
let props = Object.keys(decls).filter((prop) => {
65+
// ignore content: "";
66+
if (prop === 'content' && (decls[prop] === '""' || decls[prop] === "''")) {
67+
return false
68+
}
69+
return true
70+
})
71+
6572
if (props.length === 0) return null
6673

6774
const nonCustomProps = props.filter((prop) => !prop.startsWith('--'))

0 commit comments

Comments
 (0)