mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
36 lines
836 B
JavaScript
36 lines
836 B
JavaScript
const { asLength, nameClass } = require('../pluginUtils')
|
|
|
|
module.exports = function ({ matchUtilities }) {
|
|
matchUtilities({
|
|
gap: (modifier, { theme }) => {
|
|
let value = asLength(modifier, theme['gap'])
|
|
|
|
if (value === undefined) {
|
|
return []
|
|
}
|
|
|
|
return { [nameClass('gap', modifier)]: { gap: value } }
|
|
},
|
|
})
|
|
matchUtilities({
|
|
'gap-x': (modifier, { theme }) => {
|
|
let value = asLength(modifier, theme['gap'])
|
|
|
|
if (value === undefined) {
|
|
return []
|
|
}
|
|
|
|
return { [nameClass('gap-x', modifier)]: { 'column-gap': value } }
|
|
},
|
|
'gap-y': (modifier, { theme }) => {
|
|
let value = asLength(modifier, theme['gap'])
|
|
|
|
if (value === undefined) {
|
|
return []
|
|
}
|
|
|
|
return { [nameClass('gap-y', modifier)]: { 'row-gap': value } }
|
|
},
|
|
})
|
|
}
|