Skip to content

Commit 3d4d850

Browse files
committed
tweak
1 parent 858c9b0 commit 3d4d850

File tree

1 file changed

+4
-2
lines changed
  • packages/tailwindcss-language-service/src/util

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,12 @@ export function getColor(state: State, className: string): culori.Color | Keywor
216216

217217
let color = getColorFromRoot(state, css)
218218

219+
let prefix = state.designSystem.theme.prefix ?? ''
220+
219221
// TODO: Either all consumers of this API should assume there's no prefix
220222
// or pass in correctly prefixed classes
221-
if (state.designSystem.theme.prefix !== '' && !color) {
222-
className = `${state.designSystem.theme.prefix}:${className}`
223+
if (prefix && !color && !className.startsWith(prefix + ':')) {
224+
className = `${prefix}:${className}`
223225
css = state.designSystem.compile([className])[0]
224226
color = getColorFromRoot(state, css)
225227
}

0 commit comments

Comments
 (0)