This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
2021-04-02 02:24:13 +03:00

39 lines
988 B
JavaScript

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = flexboxOld;
var alternativeValues = {
'space-around': 'justify',
'space-between': 'justify',
'flex-start': 'start',
'flex-end': 'end',
'wrap-reverse': 'multiple',
wrap: 'multiple'
};
var alternativeProps = {
alignItems: 'WebkitBoxAlign',
justifyContent: 'WebkitBoxPack',
flexWrap: 'WebkitBoxLines',
flexGrow: 'WebkitBoxFlex'
};
function flexboxOld(property, value, style) {
if (property === 'flexDirection' && typeof value === 'string') {
if (value.indexOf('column') > -1) {
style.WebkitBoxOrient = 'vertical';
} else {
style.WebkitBoxOrient = 'horizontal';
}
if (value.indexOf('reverse') > -1) {
style.WebkitBoxDirection = 'reverse';
} else {
style.WebkitBoxDirection = 'normal';
}
}
if (alternativeProps.hasOwnProperty(property)) {
style[alternativeProps[property]] = alternativeValues[value] || value;
}
}