@@ -43,15 +43,15 @@ function directionSizeRTL(
4343 checker ?: CollectorChecker ,
4444) : DynamicMatcher {
4545 const matcher = directionSize ( propertyPrefix )
46- return ( args , context ) => {
47- const [ match , direction , size ] = args
46+ return ( [ match , direction , size ] , context ) => {
4847 if ( ! size ) return undefined
4948 const defaultMap = { l : 'is' , r : 'ie' }
5049 const map = prefixMap || defaultMap
5150 const replacement = map [ direction as 'l' | 'r' ]
5251
5352 const fullClass = context . rawSelector || match
54- const suggestedBase = match . replace ( direction === 'l' ? 'l' : 'r' , replacement )
53+ const prefix = match . substring ( 0 , 1 ) // 'p' or 'm'
54+ const suggestedBase = match . replace ( `${ prefix } ${ direction ! } ` , `${ prefix } ${ replacement } ` )
5555 const suggestedClass = fullClass . replace ( match , suggestedBase )
5656
5757 if ( checker ) {
@@ -131,7 +131,7 @@ export function presetRtl(checker?: CollectorChecker): Preset {
131131 const replacement = direction === 'left' ? 'start' : 'end'
132132
133133 const fullClass = context . rawSelector || match
134- const suggestedBase = match . replace ( direction ! , replacement )
134+ const suggestedBase = match . replace ( `text- ${ direction ! } ` , `text- ${ replacement } ` )
135135 const suggestedClass = fullClass . replace ( match , suggestedBase )
136136
137137 if ( checker ) {
@@ -158,7 +158,7 @@ export function presetRtl(checker?: CollectorChecker): Preset {
158158 if ( ! replacement ) return undefined
159159
160160 const fullClass = context . rawSelector || match
161- const suggestedBase = match . replace ( direction ! , replacement )
161+ const suggestedBase = match . replace ( `rounded- ${ direction ! } ` , `rounded- ${ replacement } ` )
162162 const suggestedClass = fullClass . replace ( match , suggestedBase )
163163
164164 if ( checker ) {
@@ -178,7 +178,7 @@ export function presetRtl(checker?: CollectorChecker): Preset {
178178 const replacement = direction === 'l' ? 'is' : 'ie'
179179
180180 const fullClass = context . rawSelector || match
181- const suggestedBase = match . replace ( direction ! , replacement )
181+ const suggestedBase = match . replace ( `border- ${ direction ! } ` , `border- ${ replacement } ` )
182182 const suggestedClass = fullClass . replace ( match , suggestedBase )
183183
184184 if ( checker ) {
0 commit comments