Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
zyyv committed Jul 17, 2022
1 parent 2632091 commit bb98808
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/preset-mini/src/rules/flex.ts
Expand Up @@ -16,8 +16,8 @@ export const flex: Rule<Theme>[] = [
['flex-none', { flex: 'none' }],

// shrink/grow/basis
[/^(?:flex-)?shrink(?:-(.*))?$/, ([, d]) => ({ 'flex-shrink': h.bracket.number(d) ?? 1 }), { autocomplete: ['flex-shrink-<num>', 'shrink-<num>'] }],
[/^(?:flex-)?grow(?:-(.*))?$/, ([, d]) => ({ 'flex-grow': h.bracket.number(d) ?? 1 }), { autocomplete: ['flex-grow-<num>', 'grow-<num>'] }],
[/^(?:flex-)?shrink(?:-(.*))?$/, ([, d = '']) => ({ 'flex-shrink': h.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ['flex-shrink-<num>', 'shrink-<num>'] }],
[/^(?:flex-)?grow(?:-(.*))?$/, ([, d = '']) => ({ 'flex-grow': h.bracket.cssvar.number(d) ?? 1 }), { autocomplete: ['flex-grow-<num>', 'grow-<num>'] }],
[/^(?:flex-)?basis-(.+)$/, ([, d], { theme }) => ({ 'flex-basis': theme.spacing?.[d] ?? h.bracket.cssvar.auto.fraction.rem(d) }), { autocomplete: ['flex-basis-$spacing', 'basis-$spacing'] }],

// directions
Expand Down
2 changes: 2 additions & 0 deletions test/__snapshots__/preset-mini.test.ts.snap
Expand Up @@ -504,11 +504,13 @@ div:hover .group-\\\\[div\\\\:hover\\\\]-\\\\[combinator\\\\:test-4\\\\]{combina
.shrink{flex-shrink:1;}
.flex-shrink-0,
.shrink-0{flex-shrink:0;}
.shrink-\\\\$variable{flex-shrink:var(--variable);}
.shrink-10{flex-shrink:10;}
.flex-grow,
.grow{flex-grow:1;}
.flex-grow-0,
.grow-0{flex-grow:0;}
.grow-\\\\$variable{flex-grow:var(--variable);}
.grow-10{flex-grow:10;}
.basis-auto{flex-basis:auto;}
.basis-none,
Expand Down
2 changes: 2 additions & 0 deletions test/assets/preset-mini-targets.ts
Expand Up @@ -273,9 +273,11 @@ export const presetMiniTargets: string[] = [
'shrink',
'shrink-0',
'shrink-10',
'shrink-$variable',
'grow',
'grow-0',
'grow-10',
'grow-$variable',
'basis-auto',
'basis-none',
'gap-none',
Expand Down

0 comments on commit bb98808

Please sign in to comment.