@@ -2051,6 +2051,11 @@ const moreDefaultMediaVals: Record<string, string> = {
20512051 '@media(min-width:1024px)' : 'lg' ,
20522052 '@media(min-width:1280px)' : 'xl' ,
20532053 '@media(min-width:1536px)' : '2xl' ,
2054+ '@media_not_all_and(min-width:640px)' : 'max-sm' ,
2055+ '@media_not_all_and(min-width:768px)' : 'max-md' ,
2056+ '@media_not_all_and(min-width:1024px)' : 'max-lg' ,
2057+ '@media_not_all_and(min-width:1280px)' : 'max-xl' ,
2058+ '@media_not_all_and(min-width:1536px)' : 'max-2xl' ,
20542059}
20552060
20562061let moreDefaultValuesMap : Record < string , Record < string , string > > = {
@@ -2273,10 +2278,10 @@ export const CssToTailwindTranslator = (code: string, config: TranslatorConfig =
22732278 return getResultCode ( it , '' , config )
22742279 } else if ( it . selectorName . includes ( '@media' ) ) {
22752280 return it . cssCode . map ( v => {
2276- const mediaName = it . selectorName . replace ( / \s / g, '' )
2281+ const mediaName = getCustomVal ( it . selectorName . replace ( / \( . + \) / g , v => v . replace ( / \ s/ g, '' ) ) . replace ( / \s + \( / g , '(' ) )
22772282 const res = getResultCode ( v , customTheme . media ?. [ it . selectorName ] || ( config . useAllDefaultValues && moreDefaultMediaVals [ mediaName ] ) || `[${ mediaName } ]` , config )
22782283 return res ? ( {
2279- selectorName : `${ it . selectorName . replace ( / \s / g , '' ) } -->${ res . selectorName } ` ,
2284+ selectorName : `${ it . selectorName } -->${ res . selectorName } ` ,
22802285 resultVal : res . resultVal
22812286 } ) : null
22822287 } )
0 commit comments