-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement `filter` helper classes with all methods * Rename filter plugins/utilities, drop filter opacity, add drop shadow * Remove non-final default filter values * Working on default filter values, add basic JIT support * Working on blur values * New blur values (these are ~okay) * Match drop-shadow values to box-shadows by eye as best as possible * Update tests * Fix kitchen sink test * Add filter variants configuration * Move drop-shadow to end of filters list Co-Authored-By: Peter Neupauer <[email protected]> * Add invert variants configuration * Add backdrop-filter utilities * Update tests * Transition filters by default * Alphabetize new config keys * Optimize filter plugins for JIT + add arbitrary value support Except for drop-shadow, will add that once we can think it through a bit. Co-authored-by: Nick Schmidt <[email protected]> Co-authored-by: Peter Neupauer <[email protected]>
- Loading branch information
1 parent
38661c3
commit 60a0678
Showing
36 changed files
with
11,398 additions
and
38 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
2,588 changes: 2,582 additions & 6 deletions
2,588
__tests__/fixtures/tailwind-output-no-color-opacity.css
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import _ from 'lodash' | ||
const { asValue, nameClass } = require('../../jit/pluginUtils') | ||
|
||
export default function () { | ||
return function ({ config, matchUtilities, addUtilities, theme, variants }) { | ||
if (config('mode') === 'jit') { | ||
matchUtilities({ | ||
'backdrop-blur': (modifier, { theme }) => { | ||
let value = asValue(modifier, theme.backdropBlur) | ||
|
||
if (value === undefined) { | ||
return [] | ||
} | ||
|
||
return { | ||
[nameClass('backdrop-blur', modifier)]: { '--tw-backdrop-blur': `blur(${value})` }, | ||
} | ||
}, | ||
}) | ||
} else { | ||
const utilities = _.fromPairs( | ||
_.map(theme('backdropBlur'), (value, modifier) => { | ||
return [ | ||
nameClass('backdrop-blur', modifier), | ||
{ | ||
'--tw-backdrop-blur': Array.isArray(value) | ||
? value.map((v) => `blur(${v})`).join(' ') | ||
: `blur(${value})`, | ||
}, | ||
] | ||
}) | ||
) | ||
|
||
addUtilities(utilities, variants('backdopBlur')) | ||
} | ||
} | ||
} |
Oops, something went wrong.