2019-01-09 13:14:31 -05:00
|
|
|
import _ from 'lodash'
|
2019-04-02 15:55:19 -05:00
|
|
|
import flattenColorPalette from '../util/flattenColorPalette'
|
2020-10-16 10:24:16 -04:00
|
|
|
import nameClass from '../util/nameClass'
|
2020-10-09 21:03:23 -04:00
|
|
|
import toColorValue from '../util/toColorValue'
|
2019-01-09 13:14:31 -05:00
|
|
|
|
2020-10-16 13:30:06 -04:00
|
|
|
export default function () {
|
|
|
|
|
return function ({ addUtilities, theme, variants }) {
|
2020-05-07 00:22:07 +10:00
|
|
|
const colors = flattenColorPalette(theme('stroke'))
|
|
|
|
|
|
2019-01-11 12:29:33 -05:00
|
|
|
const utilities = _.fromPairs(
|
2020-05-07 00:22:07 +10:00
|
|
|
_.map(colors, (value, modifier) => {
|
2020-10-16 10:24:16 -04:00
|
|
|
return [nameClass('stroke', modifier), { stroke: toColorValue(value) }]
|
2019-01-11 12:29:33 -05:00
|
|
|
})
|
|
|
|
|
)
|
2019-01-09 13:14:31 -05:00
|
|
|
|
2019-04-18 09:42:21 -04:00
|
|
|
addUtilities(utilities, variants('stroke'))
|
2019-01-09 13:14:31 -05:00
|
|
|
}
|
|
|
|
|
}
|