2019-01-09 21:41:31 -05:00
|
|
|
import _ from 'lodash'
|
2019-03-04 13:10:14 -05:00
|
|
|
import flattenColorPalette from '../util/flattenColorPalette'
|
2020-04-26 09:48:54 -04:00
|
|
|
import withAlphaVariable from '../util/withAlphaVariable'
|
2019-01-09 21:41:31 -05:00
|
|
|
|
2019-02-28 11:41:28 -05:00
|
|
|
export default function() {
|
2020-04-26 15:10:12 -04:00
|
|
|
return function({ addUtilities, e, theme, variants, config }) {
|
|
|
|
|
if (config('target') === 'ie11') {
|
|
|
|
|
const colors = flattenColorPalette(theme('borderColor'))
|
|
|
|
|
|
|
|
|
|
const utilities = _.fromPairs(
|
|
|
|
|
_.map(_.omit(colors, 'default'), (value, modifier) => {
|
|
|
|
|
return [`.${e(`border-${modifier}`)}`, { 'border-color': value }]
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
addUtilities(utilities, variants('borderColor'))
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
2019-04-18 23:29:07 +02:00
|
|
|
const colors = flattenColorPalette(theme('borderColor'))
|
2019-03-04 13:10:14 -05:00
|
|
|
|
2019-01-11 12:29:33 -05:00
|
|
|
const utilities = _.fromPairs(
|
2019-03-04 13:10:14 -05:00
|
|
|
_.map(_.omit(colors, 'default'), (value, modifier) => {
|
2019-01-11 12:29:33 -05:00
|
|
|
return [
|
|
|
|
|
`.${e(`border-${modifier}`)}`,
|
2020-04-26 09:48:54 -04:00
|
|
|
withAlphaVariable({
|
|
|
|
|
color: value,
|
|
|
|
|
property: 'border-color',
|
|
|
|
|
variable: '--border-opacity',
|
|
|
|
|
}),
|
2019-01-11 12:29:33 -05:00
|
|
|
]
|
|
|
|
|
})
|
|
|
|
|
)
|
2019-01-09 21:41:31 -05:00
|
|
|
|
2019-04-18 09:42:21 -04:00
|
|
|
addUtilities(utilities, variants('borderColor'))
|
2019-01-09 21:41:31 -05:00
|
|
|
}
|
|
|
|
|
}
|