import _ from 'lodash'

export default function() {
  return function({ addUtilities, theme, variants }) {
    const utilities = _.fromPairs(
      _.map(theme('zIndex'), (value, modifier) => {
        return [
          `.z-${modifier}`,
          {
            'z-index': value,
          },
        ]
      })
    )

    addUtilities(utilities, variants('zIndex'))
  }
}

@@ -15,16 +15,86 @@
 'lodash'
+%0Aimport prefixNegativeModifiers from '../util/prefixNegativeModifiers'
 %0A%0Aexport
@@ -148,16 +148,19 @@
 ilities,
+ e,
  theme, 
@@ -293,20 +293,49 @@
   %60.
-z-
 $%7B
+e(prefixNegativeModifiers('z', 
 modifier
 %7D%60,%0A
@@ -330,16 +330,18 @@
 modifier
+))
 %7D%60,%0A    

Add support for negative prefixes in zIndex plugin