Skip to content

Commit 149a176

Browse files
committed
Update readme for v1.x
1 parent 163503a commit 149a176

File tree

2 files changed

+46
-31
lines changed

2 files changed

+46
-31
lines changed

readme.md

Lines changed: 45 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,50 @@ yarn add -D tailwindcss-multi-column
1919

2020
## Usage
2121

22-
By default the plugin uses the `borderColors` and `borderWidths` properties from the config file to generate the rules classes. You can change that to whatever, just keep in mind if you have a `default` key in both objects, `.column-rule` will set both the `column-rule-color` and `column-rule-width` of the element.
22+
By default the plugin uses the `borderColor` and `borderWidth` properties from your theme to generate the `columnRuleColor` and `columnRuleWidth` classes. You can change that to whatever, just keep in mind if you have a `default` key in both objects (also `columnRuleStyle`), `.column-rule` will set both the `column-rule-color` and `column-rule-width` of the element.
23+
24+
This means you won't be able to use `@apply` with those classes. Let me know if that's an issue for you and we can sort it out.
2325

2426
```js
25-
require('tailwindcss-multi-column')({
26-
counts: [1, 2],
27-
gaps: {
28-
'sm': '1rem',
29-
'md': '1.5rem',
30-
'lg': '2rem',
31-
},
32-
widths: {
33-
'sm': '120px',
34-
'md': '240px',
35-
'lg': '360px',
36-
},
37-
rules: {
38-
colors: {
39-
'red': 'red',
40-
'lime': 'lime',
41-
'blue': 'blue',
27+
// tailwind.config.js
28+
{
29+
theme: { // defaults to these values
30+
columnCount: [ 1, 2, 3 ],
31+
columnGap: { // will fallback to 'gap' || 'gridGap' values
32+
// sm: '1rem',
33+
// md: '1.5rem',
34+
// lg: '2rem',
4235
},
43-
widths: {
44-
default: '1px',
45-
'sm': '2px',
46-
'md': '3px',
36+
columnWidth: {
37+
// sm: '120px',
38+
// md: '240px',
39+
// lg: '360px',
4740
},
41+
columnRuleColor: false, // will fallback to `borderColor` values
42+
columnRuleWidth: false, // will fallback to `borderWidth` values
43+
columnRuleStyle: [
44+
'none', 'hidden', 'dotted', 'dashed', 'solid',
45+
'double', 'groove', 'ridge', 'inset', 'outset',
46+
],
47+
columnFill: [ 'auto', 'balance', 'balance-all' ],
48+
columnSpan: [ 'none', 'all' ],
4849
},
49-
variants: [],
50-
}),
50+
51+
variants: { // all the following default to ['responsive']
52+
columnCount: ['responsive'],
53+
columnGap: ['responsive'],
54+
columnWidth: ['responsive'],
55+
columnRuleColor: ['responsive'],
56+
columnRuleWidth: ['responsive'],
57+
columnRuleStyle: ['responsive'],
58+
columnFill: ['responsive'],
59+
columnSpan: ['responsive'],
60+
},
61+
62+
plugins: [
63+
require('tailwindcss-multi-column'), // no options to configure
64+
],
65+
}
5166
```
5267

5368
```css
@@ -69,7 +84,7 @@ require('tailwindcss-multi-column')({
6984

7085
.col-rule { column-rule-width: 1px; }
7186
.col-rule-sm { column-rule-width: 2px; }
72-
.col-rule-md { column-rule-width: 3px; }
87+
.col-rule-md { column-rule-width: 4px; }
7388

7489
.col-rule-none { column-rule-style: none; }
7590
.col-rule-hidden { column-rule-style: hidden; }
@@ -82,12 +97,12 @@ require('tailwindcss-multi-column')({
8297
.col-rule-inset { column-rule-style: inset; }
8398
.col-rule-outset { column-rule-style: outset; }
8499

85-
.col-auto { column-fill: auto; }
86-
.col-balance { column-fill: balance; }
87-
.col-balance-all { column-fill: balance-all; }
100+
.col-fill-auto { column-fill: auto; }
101+
.col-fill-balance { column-fill: balance; }
102+
.col-fill-balance-all { column-fill: balance-all; }
88103

89-
.col-none { column-span: none; }
90-
.col-all { column-span: all; }
104+
.col-span-none { column-span: none; }
105+
.col-span-all { column-span: all; }
91106
```
92107

93108
## Credits

test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const generatePluginCss = (testConfig = {}, pluginOptions = {}) => {
1919
md: '240px',
2020
lg: '360px',
2121
},
22-
columnRuleColor: { 'tailwind': '#38b2ac' },
22+
columnRuleColor: { tailwind: '#38b2ac' },
2323
columnRuleWidth: {
2424
default: '1px',
2525
sm: '2px',

0 commit comments

Comments
 (0)