Skip to content

Commit ee77ab8

Browse files
committed
Ensure color swatches show in completions when using a prefix
1 parent 30eb3dc commit ee77ab8

File tree

1 file changed

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

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,14 @@ export function getColor(state: State, className: string): culori.Color | Keywor
216216

217217
let color = getColorFromRoot(state, css)
218218

219+
// TODO: Either all consumers of this API should assume there's no prefix
220+
// or pass in correctly prefixed classes
221+
if (state.designSystem.theme.prefix !== '' && !color) {
222+
className = `${state.designSystem.theme.prefix}:${className}`
223+
css = state.designSystem.compile([className])[0]
224+
color = getColorFromRoot(state, css)
225+
}
226+
219227
return color
220228
}
221229

0 commit comments

Comments
 (0)