You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-4Lines changed: 9 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,8 +11,8 @@ In `plugins/css-grid/index.js` you'll find an example of a plugin that adds new
11
11
It exposes four configuration options:
12
12
13
13
-`grids`, for specifying all of the grid sizes you'd like to generate
14
-
-`colwidth` for applying min width for the auto-grid
15
14
-`gaps`, for specifying the gap sizes you'd like to generate
15
+
-`autoMinWidths` for specifying min width to columns using auto-fit and minmax
16
16
-`variants`, for specifying which variants to generate
17
17
18
18
```js
@@ -23,12 +23,16 @@ module.exports = {
23
23
// ...
24
24
require('tailwindcss-grid')({
25
25
grids: [2, 3, 5, 6, 8, 10, 12],
26
-
colwidth: [5, 10, 15, 20], // in REM
27
26
gaps: {
28
27
0:'0',
29
28
4:'1rem',
30
29
8:'2rem',
31
30
},
31
+
autoMinWidths: {
32
+
'16':'4rem',
33
+
'24':'6rem',
34
+
'300px':'300px'
35
+
},
32
36
variants: ['responsive'],
33
37
}),
34
38
],
@@ -41,11 +45,12 @@ The plugin generates the following sets of classes:
41
45
42
46
-`.grid`, for setting `display: grid` on an element
43
47
-`.grid-columns-{size}`, for specifying the number of columns in the grid
44
-
-`.auto-grid-{size}`, for specifying the minimum width of the columns generated with auto-grid
45
-
-`.grid-gap-{size}`, for specifying the size of the gap between columns/rows
46
48
-`.col-span-{columns}`, for specifying how wide a cell should be
49
+
-`.grid-gap-{size}`, for specifying the size of the gap between columns/rows
50
+
-`.grid-automin-{size}`, for applying the minimum width of the columns using auto-fit and minmax (the max is 1fr)
47
51
-`.col-start-{line}` and `.col-end-{line}`, for specifying a cell's start and end points explicitly (useful for reordering cells or leaving gaps)
48
52
-`.row-span-{columns}`, for specifying how tall a cell should be
49
53
-`.row-start-{line}` and `.row-end-{line}`, for specifying a cell's start and end points explicitly (useful for reordering cells or leaving gaps)
54
+
-`.grid-dense` applies `grid-auto-flow: dense`
50
55
51
56
It's not really practical to expose all of the power of CSS Grid through utilities, but this plugin is a good example of using CSS Grid to replace a cell-only float or Flexbox grid.
0 commit comments