Reduce calls of flattenColorPalette

This commit is contained in:
Irene Lin 2020-05-07 00:22:07 +10:00
parent 99a5fea06d
commit 2ba2b72fc8
6 changed files with 20 additions and 12 deletions

View file

@ -4,9 +4,9 @@ import withAlphaVariable from '../util/withAlphaVariable'
export default function() {
return function({ addUtilities, e, theme, variants, target, corePlugins }) {
if (target('borderColor') === 'ie11') {
const colors = flattenColorPalette(theme('borderColor'))
const colors = flattenColorPalette(theme('borderColor'))
if (target('borderColor') === 'ie11') {
const utilities = _.fromPairs(
_.map(_.omit(colors, 'default'), (value, modifier) => {
return [`.${e(`border-${modifier}`)}`, { 'border-color': value }]
@ -18,8 +18,6 @@ export default function() {
return
}
const colors = flattenColorPalette(theme('borderColor'))
const utilities = _.fromPairs(
_.map(_.omit(colors, 'default'), (value, modifier) => {
return [