mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
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:
parent
e6ea821a7a
commit
77dfac2bfa
@ -1,7 +1,7 @@
|
||||
import * as plugins from './plugins/index.js'
|
||||
import configurePlugins from './util/configurePlugins'
|
||||
|
||||
const jitOnlyPlugins = ['content']
|
||||
const jitOnlyPlugins = ['caretColor', 'content']
|
||||
|
||||
export default function ({ corePlugins: corePluginConfig }) {
|
||||
corePluginConfig = corePluginConfig.filter((pluginName) => !jitOnlyPlugins.includes(pluginName))
|
||||
|
||||
19
src/plugins/caretColor.js
Normal file
19
src/plugins/caretColor.js
Normal 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'],
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -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'
|
||||
|
||||
@ -165,6 +165,7 @@ module.exports = {
|
||||
inner: 'inset 0 2px 4px 0 rgba(0, 0, 0, 0.06)',
|
||||
none: 'none',
|
||||
},
|
||||
caretColor: (theme) => theme('colors'),
|
||||
contrast: {
|
||||
0: '0',
|
||||
50: '.5',
|
||||
|
||||
@ -604,6 +604,9 @@
|
||||
.placeholder-opacity-60::placeholder {
|
||||
--tw-placeholder-opacity: 0.6;
|
||||
}
|
||||
.caret-red-600 {
|
||||
caret-color: #dc2626;
|
||||
}
|
||||
.opacity-90 {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
@ -100,6 +100,7 @@
|
||||
<div class="place-content-start"></div>
|
||||
<div class="placeholder-green-300"></div>
|
||||
<div class="placeholder-opacity-60"></div>
|
||||
<div class="caret-red-600"></div>
|
||||
<div class="place-items-end"></div>
|
||||
<div class="place-self-center"></div>
|
||||
<div class="pointer-events-none"></div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user