mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
20 lines
577 B
JavaScript
20 lines
577 B
JavaScript
const flattenColorPalette = require('../../lib/util/flattenColorPalette').default
|
|
const toColorValue = require('../../lib/util/toColorValue').default
|
|
const { asColor, nameClass } = require('../pluginUtils')
|
|
|
|
module.exports = function ({ matchUtilities, theme }) {
|
|
let colorPalette = flattenColorPalette(theme('stroke'))
|
|
|
|
matchUtilities({
|
|
stroke: (modifier) => {
|
|
let value = asColor(modifier, colorPalette)
|
|
|
|
if (value === undefined) {
|
|
return []
|
|
}
|
|
|
|
return { [nameClass('stroke', modifier)]: { stroke: toColorValue(value) } }
|
|
},
|
|
})
|
|
}
|