Skip to content

Commit fde5e24

Browse files
committed
Add missing utilities for column-gap
1 parent afc92da commit fde5e24

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const _ = require('lodash')
22

33
module.exports = function (options = {}) {
44
return function ({ addUtilities, config, e }) {
5-
let { counts, widths, rules, variants } = _.defaults(options, {
5+
let { counts, gaps, widths, rules, variants } = _.defaults(options, {
66
counts: [1, 2, 3],
77
rules: {
88
colors: config('borderColors'),
@@ -17,6 +17,10 @@ module.exports = function (options = {}) {
1717
[`.${e(`col-count-${count}`)}`]: { 'column-count': count },
1818
}))
1919

20+
gaps = _.map(gaps, (gap, name) => ({
21+
[`.${e(`col-gap${getName(name)}`)}`]: { 'column-gap': gap },
22+
}))
23+
2024
widths = _.map(widths, (width, name) => ({
2125
[`.${e(`col-w-${name}`)}`]: { 'column-width': width },
2226
}))
@@ -30,6 +34,7 @@ module.exports = function (options = {}) {
3034
}))
3135

3236
addUtilities(counts, variants)
37+
addUtilities(gaps, variants)
3338
addUtilities(widths, variants)
3439
addUtilities(ruleColors, variants)
3540
addUtilities(ruleWidths, variants)

readme.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ By default the plugin uses the `borderColors` and `borderWidths` properties from
2424
```js
2525
require('tailwindcss-multi-column')({
2626
counts: [1, 2],
27+
gaps: {
28+
'sm': '1rem',
29+
'md': '1.5rem',
30+
'lg': '2rem',
31+
},
2732
widths: {
2833
'sm': '120px',
2934
'md': '240px',
@@ -50,6 +55,10 @@ require('tailwindcss-multi-column')({
5055
.col-count-2 { column-count: 2; }
5156
.col-count-3 { column-count: 3; }
5257

58+
.col-gap-sm { column-gap: 1rem; }
59+
.col-gap-md { column-gap: 1.5rem; }
60+
.col-gap-lg { column-gap: 2rem; }
61+
5362
.col-w-sm { column-width: 120px; }
5463
.col-w-md { column-width: 240px; }
5564
.col-w-lg { column-width: 360px; }

0 commit comments

Comments
 (0)