Skip to content

Commit a14e53e

Browse files
committed
Add grid-auto-flow utilities
1 parent 2babe0c commit a14e53e

5 files changed

Lines changed: 176 additions & 0 deletions

File tree

__tests__/fixtures/tailwind-output-important.css

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8461,6 +8461,22 @@ video {
84618461
gap: 1px !important;
84628462
}
84638463

8464+
.grid-flow-row {
8465+
grid-auto-flow: row !important;
8466+
}
8467+
8468+
.grid-flow-col {
8469+
grid-auto-flow: column !important;
8470+
}
8471+
8472+
.grid-flow-row-dense {
8473+
grid-auto-flow: row dense !important;
8474+
}
8475+
8476+
.grid-flow-col-dense {
8477+
grid-auto-flow: column dense !important;
8478+
}
8479+
84648480
.grid-cols-1 {
84658481
grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
84668482
}
@@ -18046,6 +18062,22 @@ video {
1804618062
gap: 1px !important;
1804718063
}
1804818064

18065+
.sm\:grid-flow-row {
18066+
grid-auto-flow: row !important;
18067+
}
18068+
18069+
.sm\:grid-flow-col {
18070+
grid-auto-flow: column !important;
18071+
}
18072+
18073+
.sm\:grid-flow-row-dense {
18074+
grid-auto-flow: row dense !important;
18075+
}
18076+
18077+
.sm\:grid-flow-col-dense {
18078+
grid-auto-flow: column dense !important;
18079+
}
18080+
1804918081
.sm\:grid-cols-1 {
1805018082
grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
1805118083
}
@@ -27632,6 +27664,22 @@ video {
2763227664
gap: 1px !important;
2763327665
}
2763427666

27667+
.md\:grid-flow-row {
27668+
grid-auto-flow: row !important;
27669+
}
27670+
27671+
.md\:grid-flow-col {
27672+
grid-auto-flow: column !important;
27673+
}
27674+
27675+
.md\:grid-flow-row-dense {
27676+
grid-auto-flow: row dense !important;
27677+
}
27678+
27679+
.md\:grid-flow-col-dense {
27680+
grid-auto-flow: column dense !important;
27681+
}
27682+
2763527683
.md\:grid-cols-1 {
2763627684
grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
2763727685
}
@@ -37218,6 +37266,22 @@ video {
3721837266
gap: 1px !important;
3721937267
}
3722037268

37269+
.lg\:grid-flow-row {
37270+
grid-auto-flow: row !important;
37271+
}
37272+
37273+
.lg\:grid-flow-col {
37274+
grid-auto-flow: column !important;
37275+
}
37276+
37277+
.lg\:grid-flow-row-dense {
37278+
grid-auto-flow: row dense !important;
37279+
}
37280+
37281+
.lg\:grid-flow-col-dense {
37282+
grid-auto-flow: column dense !important;
37283+
}
37284+
3722137285
.lg\:grid-cols-1 {
3722237286
grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
3722337287
}
@@ -46804,6 +46868,22 @@ video {
4680446868
gap: 1px !important;
4680546869
}
4680646870

46871+
.xl\:grid-flow-row {
46872+
grid-auto-flow: row !important;
46873+
}
46874+
46875+
.xl\:grid-flow-col {
46876+
grid-auto-flow: column !important;
46877+
}
46878+
46879+
.xl\:grid-flow-row-dense {
46880+
grid-auto-flow: row dense !important;
46881+
}
46882+
46883+
.xl\:grid-flow-col-dense {
46884+
grid-auto-flow: column dense !important;
46885+
}
46886+
4680746887
.xl\:grid-cols-1 {
4680846888
grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
4680946889
}

__tests__/fixtures/tailwind-output.css

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8461,6 +8461,22 @@ video {
84618461
gap: 1px;
84628462
}
84638463

8464+
.grid-flow-row {
8465+
grid-auto-flow: row;
8466+
}
8467+
8468+
.grid-flow-col {
8469+
grid-auto-flow: column;
8470+
}
8471+
8472+
.grid-flow-row-dense {
8473+
grid-auto-flow: row dense;
8474+
}
8475+
8476+
.grid-flow-col-dense {
8477+
grid-auto-flow: column dense;
8478+
}
8479+
84648480
.grid-cols-1 {
84658481
grid-template-columns: repeat(1, minmax(0, 1fr));
84668482
}
@@ -18046,6 +18062,22 @@ video {
1804618062
gap: 1px;
1804718063
}
1804818064

18065+
.sm\:grid-flow-row {
18066+
grid-auto-flow: row;
18067+
}
18068+
18069+
.sm\:grid-flow-col {
18070+
grid-auto-flow: column;
18071+
}
18072+
18073+
.sm\:grid-flow-row-dense {
18074+
grid-auto-flow: row dense;
18075+
}
18076+
18077+
.sm\:grid-flow-col-dense {
18078+
grid-auto-flow: column dense;
18079+
}
18080+
1804918081
.sm\:grid-cols-1 {
1805018082
grid-template-columns: repeat(1, minmax(0, 1fr));
1805118083
}
@@ -27632,6 +27664,22 @@ video {
2763227664
gap: 1px;
2763327665
}
2763427666

27667+
.md\:grid-flow-row {
27668+
grid-auto-flow: row;
27669+
}
27670+
27671+
.md\:grid-flow-col {
27672+
grid-auto-flow: column;
27673+
}
27674+
27675+
.md\:grid-flow-row-dense {
27676+
grid-auto-flow: row dense;
27677+
}
27678+
27679+
.md\:grid-flow-col-dense {
27680+
grid-auto-flow: column dense;
27681+
}
27682+
2763527683
.md\:grid-cols-1 {
2763627684
grid-template-columns: repeat(1, minmax(0, 1fr));
2763727685
}
@@ -37218,6 +37266,22 @@ video {
3721837266
gap: 1px;
3721937267
}
3722037268

37269+
.lg\:grid-flow-row {
37270+
grid-auto-flow: row;
37271+
}
37272+
37273+
.lg\:grid-flow-col {
37274+
grid-auto-flow: column;
37275+
}
37276+
37277+
.lg\:grid-flow-row-dense {
37278+
grid-auto-flow: row dense;
37279+
}
37280+
37281+
.lg\:grid-flow-col-dense {
37282+
grid-auto-flow: column dense;
37283+
}
37284+
3722137285
.lg\:grid-cols-1 {
3722237286
grid-template-columns: repeat(1, minmax(0, 1fr));
3722337287
}
@@ -46804,6 +46868,22 @@ video {
4680446868
gap: 1px;
4680546869
}
4680646870

46871+
.xl\:grid-flow-row {
46872+
grid-auto-flow: row;
46873+
}
46874+
46875+
.xl\:grid-flow-col {
46876+
grid-auto-flow: column;
46877+
}
46878+
46879+
.xl\:grid-flow-row-dense {
46880+
grid-auto-flow: row dense;
46881+
}
46882+
46883+
.xl\:grid-flow-col-dense {
46884+
grid-auto-flow: column dense;
46885+
}
46886+
4680746887
.xl\:grid-cols-1 {
4680846888
grid-template-columns: repeat(1, minmax(0, 1fr));
4680946889
}

src/corePlugins.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ import translate from './plugins/translate'
7474
import gap from './plugins/gap'
7575
import columnGap from './plugins/columnGap'
7676
import rowGap from './plugins/rowGap'
77+
import gridAutoFlow from './plugins/gridAutoFlow'
7778
import gridTemplateColumns from './plugins/gridTemplateColumns'
7879
import gridColumn from './plugins/gridColumn'
7980
import gridColumnStart from './plugins/gridColumnStart'
@@ -158,6 +159,7 @@ export default function({ corePlugins: corePluginConfig }) {
158159
gap,
159160
columnGap,
160161
rowGap,
162+
gridAutoFlow,
161163
gridTemplateColumns,
162164
gridColumn,
163165
gridColumnStart,

src/plugins/gridAutoFlow.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export default function() {
2+
return function({ addUtilities, variants }) {
3+
addUtilities(
4+
{
5+
'.grid-flow-row': { gridAutoFlow: 'row' },
6+
'.grid-flow-col': { gridAutoFlow: 'column' },
7+
'.grid-flow-row-dense': { gridAutoFlow: 'row dense' },
8+
'.grid-flow-col-dense': { gridAutoFlow: 'column dense' },
9+
},
10+
variants('gridAutoFlow')
11+
)
12+
}
13+
}

stubs/defaultConfig.stub.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,7 @@ module.exports = {
585585
gap: ['responsive'],
586586
columnGap: ['responsive'],
587587
rowGap: ['responsive'],
588+
gridAutoFlow: ['responsive'],
588589
gridTemplateColumns: ['responsive'],
589590
gridColumn: ['responsive'],
590591
gridColumnStart: ['responsive'],

0 commit comments

Comments
 (0)