mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Add accent-color utilities (#5387)
* Add accent-color utilities * Address comments
This commit is contained in:
parent
9371cce670
commit
51f71af62c
19
src/plugins/accentColor.js
Normal file
19
src/plugins/accentColor.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(
|
||||
{
|
||||
accent: (value) => {
|
||||
return { 'accent-color': toColorValue(value) }
|
||||
},
|
||||
},
|
||||
{
|
||||
values: flattenColorPalette(theme('accentColor')),
|
||||
variants: variants('accentColor'),
|
||||
type: 'color',
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -125,6 +125,7 @@ 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 accentColor } from './accentColor'
|
||||
|
||||
export { default as opacity } from './opacity'
|
||||
export { default as backgroundBlendMode } from './backgroundBlendMode'
|
||||
|
||||
@ -183,6 +183,10 @@ module.exports = {
|
||||
none: 'none',
|
||||
},
|
||||
caretColor: (theme) => theme('colors'),
|
||||
accentColor: (theme) => ({
|
||||
...theme('colors'),
|
||||
auto: 'auto',
|
||||
}),
|
||||
contrast: {
|
||||
0: '0',
|
||||
50: '.5',
|
||||
|
||||
@ -649,6 +649,9 @@
|
||||
.caret-red-600 {
|
||||
caret-color: #dc2626;
|
||||
}
|
||||
.accent-red-600 {
|
||||
accent-color: #dc2626;
|
||||
}
|
||||
.opacity-90 {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
@ -101,6 +101,7 @@
|
||||
<div class="placeholder-green-300"></div>
|
||||
<div class="placeholder-opacity-60"></div>
|
||||
<div class="caret-red-600"></div>
|
||||
<div class="accent-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