File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
apps/builder/app/shared/tailwind Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -584,8 +584,8 @@ test("generate space without display property", async () => {
584
584
await generateFragmentFromTailwind (
585
585
renderTemplate (
586
586
< >
587
- < ws . element ws :tag = "div" class = "space-x-4" > </ ws . element >
588
- < ws . element ws :tag = "div" class = "space-y-4" > </ ws . element >
587
+ < ws . element ws :tag = "div" class = "space-x-4 md:space-x-6 " > </ ws . element >
588
+ < ws . element ws :tag = "div" class = "space-y-4 md:space-y-6 " > </ ws . element >
589
589
</ >
590
590
)
591
591
)
@@ -596,7 +596,10 @@ test("generate space without display property", async () => {
596
596
ws :tag = "div"
597
597
ws :style = { css `
598
598
display : flex;
599
- column-gap : 1rem ;
599
+ @media (max-width : 767px ) {
600
+ column-gap : 1rem ;
601
+ }
602
+ column-gap : 1.5rem ;
600
603
` }
601
604
> </ ws . element >
602
605
< ws . element
@@ -605,7 +608,10 @@ test("generate space without display property", async () => {
605
608
display : flex;
606
609
flex-direction : column;
607
610
align-items : start;
608
- row-gap : 1rem ;
611
+ @media (max-width : 767px ) {
612
+ row-gap : 1rem ;
613
+ }
614
+ row-gap : 1.5rem ;
609
615
` }
610
616
> </ ws . element >
611
617
</ >
Original file line number Diff line number Diff line change @@ -198,15 +198,13 @@ const parseTailwindClasses = async (classes: string) => {
198
198
. map ( ( item ) => {
199
199
// styles data cannot express space-x and space-y selectors
200
200
// with lobotomized owl so replace with gaps
201
- const spaceX = "space-x-" ;
202
- if ( item . startsWith ( spaceX ) ) {
201
+ if ( item . includes ( "space-x-" ) ) {
203
202
hasColumnGaps = true ;
204
- return ` gap-x-${ item . slice ( spaceX . length ) } ` ;
203
+ return item . replace ( "space-x-" , " gap-x-" ) ;
205
204
}
206
- const spaceY = "space-y-" ;
207
- if ( item . startsWith ( spaceY ) ) {
205
+ if ( item . includes ( "space-y-" ) ) {
208
206
hasRowGaps = true ;
209
- return ` gap-y-${ item . slice ( spaceY . length ) } ` ;
207
+ return item . replace ( "space-y-" , " gap-y-" ) ;
210
208
}
211
209
hasFlexOrGrid ||= item . endsWith ( "flex" ) || item . endsWith ( "grid" ) ;
212
210
hasContainer ||= item === "container" ;
You can’t perform that action at this time.
0 commit comments