diff --git a/modules/plugins/flexboxIE.js b/modules/plugins/flexboxIE.js index 6b969c5..32cf9bd 100644 --- a/modules/plugins/flexboxIE.js +++ b/modules/plugins/flexboxIE.js @@ -24,7 +24,7 @@ const flexShorthandMappings = { unset: 'unset', } const isUnitlessNumber = /^\d+(\.\d+)?$/ - +const logTag = 'inline-style-prefixer.flexboxIE plugin' export default function flexboxIE( property: string, value: any, @@ -47,6 +47,22 @@ export default function flexboxIE( return } + if (typeof value === 'number' && value < 0) { + // ignore negative values; + console.warn( + `${logTag}: "flex: ${value}", negative values is not valid and will be ignored.` + ) + return + } + + if (!value.split) { + console.warn( + `${logTag}: "flex: ${value}", value format is not detected, it will be remain as is` + ) + style.msFlex = value + return + } + // The next thing we can look for is if there are multiple values. const flexValues = value.split(/\s/) // If we only have a single value that wasn't a positive unitless