forked from tailwindlabs/tailwindcss
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bugs in divideOpacity and placeholderOpacity plugins
- Loading branch information
1 parent
acd34ad
commit d351f12
Showing
2 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,5 +1,18 @@ | ||
import createUtilityPlugin from '../util/createUtilityPlugin' | ||
import _ from 'lodash' | ||
|
||
export default function() { | ||
return createUtilityPlugin('divideOpacity', [['divide-opacity', ['--divide-opacity']]]) | ||
return function({ addUtilities, e, theme, variants }) { | ||
const utilities = _.fromPairs( | ||
_.map(theme('divideOpacity'), (value, modifier) => { | ||
return [ | ||
`.${e(`divide-opacity-${modifier}`)} > :not(template) ~ :not(template)`, | ||
{ | ||
'--divide-opacity': value, | ||
}, | ||
] | ||
}) | ||
) | ||
|
||
addUtilities(utilities, variants('divideOpacity')) | ||
} | ||
} |
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 |
---|---|---|
@@ -1,7 +1,18 @@ | ||
import createUtilityPlugin from '../util/createUtilityPlugin' | ||
import _ from 'lodash' | ||
|
||
export default function() { | ||
return createUtilityPlugin('placeholderOpacity', [ | ||
['placeholder-opacity', ['--placeholder-opacity']], | ||
]) | ||
return function({ addUtilities, e, theme, variants }) { | ||
const utilities = _.fromPairs( | ||
_.map(theme('placeholderOpacity'), (value, modifier) => { | ||
return [ | ||
`.${e(`placeholder-opacity-${modifier}`)}::placeholder`, | ||
{ | ||
'--placeholder-opacity': value, | ||
}, | ||
] | ||
}) | ||
) | ||
|
||
addUtilities(utilities, variants('placeholderOpacity')) | ||
} | ||
} |