JIT: Add caret-color utilities (#4499)

Co-Authored-By: Jesse Katsumata <niconico.clarinet@gmail.com>

Co-authored-by: Jesse Katsumata <niconico.clarinet@gmail.com>
This commit is contained in:
Adam Wathan 2021-05-28 13:55:42 -04:00 • committed by GitHub
parent e6ea821a7a
commit 77dfac2bfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 1 deletions

19
src/plugins/caretColor.js Normal file
View file

@ -0,0 +1,19 @@
import flattenColorPalette from '../util/flattenColorPalette'
import toColorValue from '../util/toColorValue'
export default function () {
return function ({ matchUtilities, theme, variants }) {
matchUtilities(
{
caret: (value) => {
return { 'caret-color': toColorValue(value) }
},
},
{
values: flattenColorPalette(theme('caretColor')),
variants: variants('caretColor'),
type: ['color', 'any'],
}
)
}
}

View file

@ -123,6 +123,7 @@ export { default as textDecoration } from './textDecoration'
export { default as fontSmoothing } from './fontSmoothing'
export { default as placeholderColor } from './placeholderColor'
export { default as placeholderOpacity } from './placeholderOpacity'
export { default as caretColor } from './caretColor'
export { default as opacity } from './opacity'
export { default as backgroundBlendMode } from './backgroundBlendMode'