@@ -238,7 +238,7 @@ export function parseClass(className: string): ParsedClass {
238
238
}
239
239
240
240
// Regular negative value
241
- const match = positiveUtility . match ( / ^ ( [ a - z - ] + ? ) (?: - ( .+ ) ) ? $ / )
241
+ const match = positiveUtility . match ( / ^ ( [ a - z ] + (?: - [ a - z ] + ) * ) (?: - ( .+ ) ) ? $ / )
242
242
if ( match ) {
243
243
return {
244
244
raw : className ,
@@ -253,7 +253,7 @@ export function parseClass(className: string): ParsedClass {
253
253
254
254
// Check for color opacity modifiers: bg-blue-500/50, text-red-500/75
255
255
// Must come before fractional values to avoid conflict
256
- const opacityMatch = utility . match ( / ^ ( [ a - z - ] + ? ) - ( .+ ?) \/ ( \d + ) $ / )
256
+ const opacityMatch = utility . match ( / ^ ( [ a - z ] + (?: - [ a - z ] + ) * ) - ( .+ ?) \/ ( \d + ) $ / )
257
257
if ( opacityMatch && [ 'bg' , 'text' , 'border' , 'ring' , 'placeholder' , 'divide' ] . includes ( opacityMatch [ 1 ] ) ) {
258
258
return {
259
259
raw : className ,
@@ -266,7 +266,7 @@ export function parseClass(className: string): ParsedClass {
266
266
}
267
267
268
268
// Check for fractional values: w-1/2, h-3/4
269
- const fractionMatch = utility . match ( / ^ ( [ a - z - ] + ? ) - ( \d + ) \/ ( \d + ) $ / )
269
+ const fractionMatch = utility . match ( / ^ ( [ a - z - ] + ) - ( \d + ) \/ ( \d + ) $ / )
270
270
if ( fractionMatch ) {
271
271
return {
272
272
raw : className ,
@@ -279,7 +279,7 @@ export function parseClass(className: string): ParsedClass {
279
279
}
280
280
281
281
// Regular parsing - split on last dash
282
- const match = utility . match ( / ^ ( [ a - z - ] + ? ) (?: - ( .+ ) ) ? $ / )
282
+ const match = utility . match ( / ^ ( [ a - z ] + (?: - [ a - z ] + ) * ) (?: - ( .+ ) ) ? $ / )
283
283
if ( ! match ) {
284
284
return {
285
285
raw : className ,
@@ -316,6 +316,7 @@ export function extractClasses(content: string): Set<string> {
316
316
317
317
for ( const pattern of patterns ) {
318
318
let match
319
+ // eslint-disable-next-line no-cond-assign
319
320
while ( ( match = pattern . exec ( content ) ) !== null ) {
320
321
const classStr = match [ 1 ]
321
322
// Extract all quoted strings from the class string (handles template literals with expressions)
0 commit comments