Skip to content

Commit

Permalink
use regex replace unconditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait committed Jan 12, 2025
1 parent 7511e4c commit 28cdc21
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/tailwindcss/src/theme.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import type { AtRule } from './ast'
import { escape } from './utils/escape'

const ESCAPED_STAR_REGEX = /-\\\*$/

export const enum ThemeOptions {
NONE = 0,
INLINE = 1 << 0,
Expand Down Expand Up @@ -41,9 +43,7 @@ export class Theme {
) {}

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

if (key.endsWith('-*')) {
if (value !== 'initial') {
Expand Down

0 comments on commit 28cdc21

Please sign in to comment.