Skip to content

Commit 95c8b24

Browse files
committed
TailwindCSS v3 / node v12+
1 parent 80d2a76 commit 95c8b24

File tree

3 files changed

+8
-166
lines changed

3 files changed

+8
-166
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 2.0.0 - 2021-12-14
4+
* Tested against TailwindCSS v3
5+
* Updated minimum node requirements (v12)
6+
* Updated documentation
7+
38
## 1.5.0 - 2021-02-23
49
* Fixed dependency for lodash in package.json.
510
* Minor formatting improvements in README.

README.md

Lines changed: 1 addition & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
A plugin to provide TailwindCSS utilities for named grid lines.
99

10-
The latest release of this plugin (version 1.3 onwards) will work with TailwindCSS versions 1 and 2.
11-
1210
## Installation
1311

1412
```
@@ -21,168 +19,7 @@ yarn add --dev @savvywombat/tailwindcss-grid-named-lines
2119

2220
## Usage
2321

24-
Require the plugin into your `tailwindcss.config.js` file:
25-
26-
```javascript
27-
// tailwindcss.config.js
28-
module.exports = {
29-
plugins: [
30-
require('@savvywombat/tailwindcss-grid-named-lines')
31-
]
32-
}
33-
```
34-
35-
Now, when adding `gridTemplateColumns` and `gridTemplateRows`, you can name the lines and utilities will be generated:
36-
37-
```javascript
38-
// tailwindcss.config.js
39-
module.exports = {
40-
theme: {
41-
gridTemplateColumns: {
42-
'default-layout': '[left] 1fr [gutter-left] 2rem [content-left] calc(768px - 4rem) [content-right] 2rem [gutter-right] 1fr [right]',
43-
},
44-
gridTemplateRows: {
45-
'default-layout':
46-
'[top header-top] ' +
47-
'4rem ' +
48-
'[header-bottom content-top] ' +
49-
'minmax(1fr, max-content) ' +
50-
'[content-bottom footer-top] ' +
51-
'auto ' +
52-
'[bottom]',
53-
}
54-
},
55-
plugins: [
56-
require('@savvywombat/tailwindcss-grid-named-lines')
57-
]
58-
}
59-
```
60-
61-
This will generate the following utilities (in addition to the default):
62-
63-
```
64-
col-start-left
65-
col-start-gutter-left
66-
col-start-content-left
67-
col-start-content-right
68-
col-start-gutter-right
69-
col-start-right
70-
71-
col-end-left
72-
col-end-gutter-left
73-
col-end-content-left
74-
col-end-content-right
75-
col-end-gutter-right
76-
col-end-right
77-
78-
row-start-top
79-
row-start-header-top
80-
row-start-header-bottom
81-
row-start-content-top
82-
row-start-content-bottom
83-
row-start-footer-top
84-
row-start-footer-bottom
85-
row-start-bottom
86-
87-
row-end-top
88-
row-end-header-top
89-
row-end-header-bottom
90-
row-end-content-top
91-
row-end-content-bottom
92-
row-end-footer-top
93-
row-end-footer-bottom
94-
row-end-bottom
95-
```
96-
97-
## Responsiveness
98-
99-
These labels do not have any responsive behaviour by themselves. Responsive grid layouts can be defined using `gridTemplateColumns` and `gridTemplateRows`:
100-
101-
```javascript
102-
// tailwindcss.config.js
103-
module.exports = {
104-
theme: {
105-
gridTemplateColumns: {
106-
'default-layout': '[left] 1fr [gutter-left] 2rem [content-left] calc(768px - 4rem) [content-right] 2rem [gutter-right] 1fr [right]',
107-
'small-layout': '[left gutter-left] 1rem [content-left] 1fr [content-right] 1rem [gutter-right right]',
108-
},
109-
gridTemplateRows: {
110-
'default-layout':
111-
'[top header-top] ' +
112-
'4rem ' +
113-
'[header-bottom content-top] ' +
114-
'minmax(1fr, max-content) ' +
115-
'[content-bottom footer-top] ' +
116-
'auto ' +
117-
'[bottom]',
118-
}
119-
},
120-
plugins: [
121-
require('@savvywombat/tailwindcss-grid-named-lines')
122-
]
123-
}
124-
```
125-
## Repeated line names
126-
127-
This plugin will generate numbered utilities when multiple lines share the same name in a `gridTemplateColumns` or `gridTemplateRows` definition:
128-
129-
```javascript
130-
// tailwindcss.config.js
131-
module.exports = {
132-
theme: {
133-
gridTemplateColumns: {
134-
'default-layout': '[column-start] 1fr [column-start] 1fr [column-start] 1fr [column-start] 1fr',
135-
}
136-
}
137-
}
138-
```
139-
140-
This will generate the following utilities:
141-
142-
```
143-
col-start-column-start-1
144-
col-start-column-start-2
145-
col-start-column-start-3
146-
col-start-column-start-4
147-
148-
col-end-column-start-1
149-
col-end-column-start-2
150-
col-end-column-start-3
151-
col-end-column-start-4
152-
```
153-
154-
Additionally, the plugin will create properly indexed utilities for line names defined inside `repeat()`:
155-
156-
```javascript
157-
// tailwindcss.config.js
158-
module.exports = {
159-
theme: {
160-
gridTemplateColumns: {
161-
'default-layout': 'repeat(3, [left] 1fr [right])',
162-
}
163-
}
164-
}
165-
```
166-
167-
This will generate:
168-
169-
```
170-
col-start-left-1
171-
col-start-left-2
172-
col-start-left-3
173-
174-
col-start-right-1
175-
col-start-right-2
176-
col-start-right-3
177-
178-
col-end-left-1
179-
col-end-left-2
180-
col-end-left-3
181-
182-
col-end-right-1
183-
col-end-right-2
184-
col-end-right-3
185-
```
22+
See the documentation at https://savvywombat.com.au/tailwind-css/named-grid-lines/
18623

18724
## Changelog
18825

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@savvywombat/tailwindcss-grid-named-lines",
3-
"version": "1.5.0",
3+
"version": "2.0.0",
44
"description": "A plugin to provide TailwindCSS utilities for named grid lines.",
55
"keywords": [
66
"tailwind",
@@ -48,7 +48,7 @@
4848
"@babel/preset-env",
4949
{
5050
"targets": {
51-
"node": "8.9.0"
51+
"node": "12.22.0"
5252
}
5353
}
5454
]

0 commit comments

Comments
 (0)