Skip to content

Commit 28cdc21

Browse files
committed
use regex replace unconditionally
1 parent 7511e4c commit 28cdc21

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/tailwindcss/src/theme.ts

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

4+
const ESCAPED_STAR_REGEX = /-\\\*$/
5+
46
export const enum ThemeOptions {
57
NONE = 0,
68
INLINE = 1 << 0,
@@ -41,9 +43,7 @@ export class Theme {
4143
) {}
4244

4345
add(key: string, value: string, options = ThemeOptions.NONE): void {
44-
if (key.endsWith('-\\*')) {
45-
key = key.replace(/-\\\*$/, '-*')
46-
}
46+
key = key.replace(ESCAPED_STAR_REGEX, '-*')
4747

4848
if (key.endsWith('-*')) {
4949
if (value !== 'initial') {

0 commit comments

Comments
 (0)