mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2026-01-25 16:44:12 +00:00
* implement matchUtilities2 * ensure animation names without keyframes are not prefixed * remove matchBase * call addUtilities for each group individually * WIP: Write plugins using matchUtilities2 * MORE * Fix arbitrary value support for fontSize * Fixes, update fixtures * Rebuild fixtures * Don't generate `divide` class with no modifier * Fixes, rebuild fixtures * Rename matchUtilities2 to matchUtilities * Delete bad tests * Remove temp files GROSS * Clean stuff up * Support no return in matchUtilities Co-authored-by: Adam Wathan <adam.wathan@gmail.com>
28 lines
719 B
JavaScript
28 lines
719 B
JavaScript
import flattenColorPalette from '../util/flattenColorPalette'
|
|
import withAlphaVariable from '../util/withAlphaVariable'
|
|
|
|
export default function () {
|
|
return function ({ matchUtilities, theme, variants }) {
|
|
matchUtilities(
|
|
{
|
|
ring: (value) => {
|
|
return withAlphaVariable({
|
|
color: value,
|
|
property: '--tw-ring-color',
|
|
variable: '--tw-ring-opacity',
|
|
})
|
|
},
|
|
},
|
|
{
|
|
values: Object.fromEntries(
|
|
Object.entries(flattenColorPalette(theme('ringColor'))).filter(
|
|
([modifier]) => modifier !== 'DEFAULT'
|
|
)
|
|
),
|
|
variants: variants('ringColor'),
|
|
type: 'color',
|
|
}
|
|
)
|
|
}
|
|
}
|