2020-04-16 11:01:24 -04:00
|
|
|
import flattenColorPalette from '../util/flattenColorPalette'
|
2020-04-26 09:48:54 -04:00
|
|
|
import withAlphaVariable from '../util/withAlphaVariable'
|
2020-04-16 11:01:24 -04:00
|
|
|
|
2020-10-16 13:30:06 -04:00
|
|
|
export default function () {
|
2021-05-05 15:23:32 +02:00
|
|
|
return function ({ matchUtilities, theme, variants, corePlugins }) {
|
|
|
|
|
matchUtilities(
|
|
|
|
|
{
|
|
|
|
|
divide: (value) => {
|
2021-04-30 16:58:40 +02:00
|
|
|
if (!corePlugins('divideOpacity')) {
|
|
|
|
|
return {
|
2021-05-05 15:23:32 +02:00
|
|
|
['& > :not([hidden]) ~ :not([hidden])']: {
|
2021-04-30 16:58:40 +02:00
|
|
|
'border-color': value,
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return {
|
2021-05-05 15:23:32 +02:00
|
|
|
['& > :not([hidden]) ~ :not([hidden])']: withAlphaVariable({
|
|
|
|
|
color: value,
|
2021-04-30 16:58:40 +02:00
|
|
|
property: 'border-color',
|
|
|
|
|
variable: '--tw-divide-opacity',
|
|
|
|
|
}),
|
|
|
|
|
}
|
|
|
|
|
},
|
2021-05-05 15:23:32 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
values: (({ DEFAULT: _, ...colors }) => colors)(flattenColorPalette(theme('divideColor'))),
|
|
|
|
|
variants: variants('divideColor'),
|
|
|
|
|
type: 'color',
|
2021-04-30 16:58:40 +02:00
|
|
|
}
|
2021-05-05 15:23:32 +02:00
|
|
|
)
|
2020-04-16 11:01:24 -04:00
|
|
|
}
|
|
|
|
|
}
|