Skip to content

Commit

Permalink
feat(preset-mini,preset-wind): add rules (#1019)
Browse files Browse the repository at this point in the history
  • Loading branch information
chu121su12 committed May 29, 2022
1 parent 5bd2f18 commit a96c5c7
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/preset-mini/src/rules/grid.ts
Expand Up @@ -48,7 +48,7 @@ export const grids: Rule<Theme>[] = [
// grid-auto-flow, auto-flow: uno
// grid-flow: wind
[/^(?:grid-auto-flow|auto-flow|grid-flow)-(.+)$/, ([, v]) => ({ 'grid-auto-flow': h.bracket.cssvar(v) })],
[/^(?:grid-auto-flow|auto-flow|grid-flow)-((?:row|col)(?:-dense)?)$/, ([, v]) => ({ 'grid-auto-flow': rowCol(v).replace('-', ' ') })],
[/^(?:grid-auto-flow|auto-flow|grid-flow)-(row|col|dense|row-dense|col-dense)$/, ([, v]) => ({ 'grid-auto-flow': rowCol(v).replace('-', ' ') })],

// templates
[/^grid-(rows|cols)-(.+)$/, ([, c, v], { theme }) => ({
Expand Down
1 change: 1 addition & 0 deletions packages/preset-wind/src/rules/static.ts
Expand Up @@ -121,5 +121,6 @@ export const mixBlendModes: Rule[] = [
['mix-blend-saturation', { 'mix-blend-mode': 'saturation' }],
['mix-blend-color', { 'mix-blend-mode': 'color' }],
['mix-blend-luminosity', { 'mix-blend-mode': 'luminosity' }],
['mix-blend-plus-lighter', { 'mix-blend-mode': 'plus-lighter' }],
['mix-blend-normal', { 'mix-blend-mode': 'normal' }],
]
4 changes: 3 additions & 1 deletion test/__snapshots__/preset-mini.test.ts.snap
Expand Up @@ -478,7 +478,9 @@ div:hover .group-\\\\[div\\\\:hover\\\\]-\\\\[combinator\\\\:test-4\\\\]{combina
.auto-rows-min{grid-auto-rows:min-content;}
.grid-auto-cols-\\\\$variable{grid-auto-columns:var(--variable);}
.grid-auto-rows-\\\\$variable{grid-auto-rows:var(--variable);}
.auto-flow-col-dense{grid-auto-flow:column dense;}
.auto-flow-col-dense,
.grid-flow-col-dense{grid-auto-flow:column dense;}
.grid-flow-dense{grid-auto-flow:dense;}
.grid-cols-\\\\[1fr_2fr_100px_min-content\\\\]{grid-template-columns:1fr 2fr 100px min-content;}
.grid-cols-\\\\[repeat\\\\(3\\\\,auto\\\\)\\\\]{grid-template-columns:repeat(3,auto);}
.grid-cols-\\\\$1{grid-template-columns:var(--\\\\31 );}
Expand Down
1 change: 1 addition & 0 deletions test/__snapshots__/preset-wind.test.ts.snap
Expand Up @@ -279,6 +279,7 @@ exports[`preset-wind > targets 1`] = `
.bg-blend-luminosity{background-blend-mode:luminosity;}
.bg-blend-normal{background-blend-mode:normal;}
.mix-blend-hard-light{mix-blend-mode:hard-light;}
.mix-blend-plus-lighter{mix-blend-mode:plus-lighter;}
.mix-blend-normal{mix-blend-mode:normal;}
.image-render-pixel{-ms-interpolation-mode:nearest-neighbor;image-rendering:-webkit-optimize-contrast;image-rendering:-moz-crisp-edges;image-rendering:-o-pixelated;image-rendering:pixelated;}
.backdrop-blur,
Expand Down
2 changes: 2 additions & 0 deletions test/assets/preset-mini-targets.ts
Expand Up @@ -285,6 +285,8 @@ export const presetMiniTargets: string[] = [
'auto-flow-col-dense',
'grid-cols-minmax-1rem',
'grid-rows-minmax-100px',
'grid-flow-dense',
'grid-flow-col-dense',

// layout
'of-y-visible',
Expand Down
1 change: 1 addition & 0 deletions test/assets/preset-wind-targets.ts
Expand Up @@ -249,6 +249,7 @@ export const presetWindTargets: string[] = [
// shadow, spacing
'mix-blend-normal',
'mix-blend-hard-light',
'mix-blend-plus-lighter',
'space-y-none',
'space-x-2',
'space-y-4',
Expand Down
3 changes: 3 additions & 0 deletions test/preset-uno.test.ts
Expand Up @@ -99,6 +99,9 @@ const nonTargets = [

// wind - placeholder
'$-placeholder-red-200',

// wind - bg-blend
'bg-blend-plus-lighter', // only added in mix-blend
]

const uno = createGenerator({
Expand Down

0 comments on commit a96c5c7

Please sign in to comment.