rofrischmann/inline-style-prefix-all

View on GitHub
modules/plugins/flexboxIE.js

Summary

Maintainability
A
0 mins
Test Coverage
const alternativeValues = {
  'space-around': 'distribute',
  'space-between': 'justify',
  'flex-start': 'start',
  'flex-end': 'end'
}
const alternativeProps = {
  alignContent: 'msFlexLinePack',
  alignSelf: 'msFlexItemAlign',
  alignItems: 'msFlexAlign',
  justifyContent: 'msFlexPack',
  order: 'msFlexOrder',
  flexGrow: 'msFlexPositive',
  flexShrink: 'msFlexNegative',
  flexBasis: 'msPreferredSize'
}

export default function flexboxIE(property, value) {
  if (alternativeProps[property]) {
    return {
      [alternativeProps[property]]: alternativeValues[value] || value
    }
  }
}