tailwindcss/src/plugins/divideColor.js
Adam Wathan b7e0f11d5d Switch to not(last-child) instead of owl
For Alpine.js compatibility, sad because it increases the specificity but I don't think it will actually be a problem at all in real projects.
2020-04-16 16:05:20 -04:00

22 lines
554 B
JavaScript

import _ from 'lodash'
import flattenColorPalette from '../util/flattenColorPalette'
export default function() {
return function({ addUtilities, e, theme, variants }) {
const colors = flattenColorPalette(theme('divideColor'))
const utilities = _.fromPairs(
_.map(_.omit(colors, 'default'), (value, modifier) => {
return [
`.${e(`divide-${modifier}`)} > :not(:last-child)`,
{
'border-color': value,
},
]
})
)
addUtilities(utilities, variants('divideColor'))
}
}