Skip to content

Commit a6907e8

Browse files
committed
handle escaped CSS variables
1 parent 0289aa3 commit a6907e8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/tailwindcss/src/theme.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type AtRule } from './ast'
2-
import { escape } from './utils/escape'
2+
import { escape, unescape } from './utils/escape'
33

44
export const enum ThemeOptions {
55
NONE = 0,
@@ -107,7 +107,8 @@ export class Theme {
107107
}
108108

109109
getOptions(key: string) {
110-
return this.values.get(this.#unprefixKey(key))?.options ?? ThemeOptions.NONE
110+
key = unescape(this.#unprefixKey(key))
111+
return this.values.get(key)?.options ?? ThemeOptions.NONE
111112
}
112113

113114
entries() {
@@ -182,7 +183,8 @@ export class Theme {
182183
}
183184

184185
markUsedVariable(themeKey: string) {
185-
let value = this.values.get(this.#unprefixKey(themeKey))
186+
let key = unescape(this.#unprefixKey(themeKey))
187+
let value = this.values.get(key)
186188
if (!value) return false // Unknown variable
187189
if (value.options & ThemeOptions.USED) return false // Variable already used
188190

0 commit comments

Comments
 (0)