8000 feat: support gap property in flex attribute (#582) (#652) · windicss/windicss@a755743 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit a755743

Browse files
authored
feat: support gap property in flex attribute (#582) (#652)
1 parent d612389 commit a755743

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

src/lib/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,8 @@ export class Processor {
756756
case 'flex-inline':
757757
utility = 'inline-flex';
758758
break;
759+
default:
760+
if (/^flex-gap-/.test(utility)) utility = utility.slice(5);
759761
}
760762
break;
761763
case 'grid':

test/processor/__snapshots__/attributify.test.ts.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,22 @@ Tools / with flex utility / css / 0: |-
12421242
-webkit-flex-shrink: 0;
12431243
flex-shrink: 0;
12441244
}
1245+
[flex~="gap-2"] {
1246+
grid-gap: 0.5rem;
1247+
gap: 0.5rem;
1248+
}
1249+
[flex~="gap-x-4"] {
1250+
-webkit-column-gap: 1rem;
1251+
-moz-column-gap: 1rem;
1252+
grid-column-gap: 1rem;
1253+
column-gap: 1rem;
1254+
}
1255+
[flex~="gap-y-2"] {
1256+
-webkit-row-gap: 0.5rem;
1257+
-moz-row-gap: 0.5rem;
1258+
grid-row-gap: 0.5rem;
1259+
row-gap: 0.5rem;
1260+
}
12451261
Tools / with font utility / css / 0: |-
12461262
[font~="sans"] {
12471263
font-family: ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";

test/processor/attributify.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ describe('Attributify Mode', () => {
268268
'1', 'auto', 'initial', 'none', // flex
269269
'grow', 'grow-0', // flex-grow
270270
'shrink', 'shrink-0', // flex-shrink
271+
'gap-2', 'gap-x-4', 'gap-y-2', // gap/column-gap/row-gap
271272
],
272273
});
273274
expect(result.ignored.length).toEqual(0);

0 commit comments

Comments
 (0)
0