WIP
Still gotta do shadows + backdrop filter
This commit is contained in:
parent
fdfecf3b9c
commit
04d66b0f47
33 changed files with 1154 additions and 298 deletions
|
|
@ -1,19 +1,41 @@
|
|||
import { addBaseSelector } from './filter'
|
||||
|
||||
export default function () {
|
||||
return function ({ config, matchUtilities, theme, variants }) {
|
||||
matchUtilities(
|
||||
{
|
||||
grayscale: (value) => {
|
||||
return {
|
||||
'--tw-grayscale': `grayscale(${value})`,
|
||||
...(config('mode') === 'jit' ? { filter: 'var(--tw-filter)' } : {}),
|
||||
}
|
||||
return function ({ config, matchUtilities, theme, variants, memory }) {
|
||||
if (config('mode') === 'jit') {
|
||||
matchUtilities(
|
||||
{
|
||||
grayscale: (value, { selector }) => {
|
||||
addBaseSelector(memory, selector)
|
||||
|
||||
return {
|
||||
'--tw-grayscale': `grayscale(${value})`,
|
||||
filter: 'var(--tw-filter)',
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
values: theme('grayscale'),
|
||||
variants: variants('grayscale'),
|
||||
type: 'any',
|
||||
}
|
||||
)
|
||||
{
|
||||
values: theme('grayscale'),
|
||||
variants: variants('grayscale'),
|
||||
type: 'any',
|
||||
}
|
||||
)
|
||||
} else {
|
||||
matchUtilities(
|
||||
{
|
||||
grayscale: (value) => {
|
||||
return {
|
||||
'--tw-grayscale': `grayscale(${value})`,
|
||||
...(config('mode') === 'jit' ? { filter: 'var(--tw-filter)' } : {}),
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
values: theme('grayscale'),
|
||||
variants: variants('grayscale'),
|
||||
type: 'any',
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue