mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
23 lines
600 B
JavaScript
23 lines
600 B
JavaScript
import _ from 'lodash'
|
|
|
|
export default function() {
|
|
return function({ addUtilities, e, theme, variants }) {
|
|
const generators = [
|
|
(size, modifier) => ({
|
|
[`.${e(`space-y-${modifier}`)} > :not(template) ~ :not(template)`]: {
|
|
'margin-top': `${size}`,
|
|
},
|
|
[`.${e(`space-x-${modifier}`)} > :not(template) ~ :not(template)`]: {
|
|
'margin-left': `${size}`,
|
|
},
|
|
}),
|
|
]
|
|
|
|
const utilities = _.flatMap(generators, generator => {
|
|
return _.flatMap(theme('space'), generator)
|
|
})
|
|
|
|
addUtilities(utilities, variants('space'))
|
|
}
|
|
}
|