1 | var alternativeProps = {
|
---|
2 | marginBlockStart: ['WebkitMarginBefore'],
|
---|
3 | marginBlockEnd: ['WebkitMarginAfter'],
|
---|
4 | marginInlineStart: ['WebkitMarginStart', 'MozMarginStart'],
|
---|
5 | marginInlineEnd: ['WebkitMarginEnd', 'MozMarginEnd'],
|
---|
6 | paddingBlockStart: ['WebkitPaddingBefore'],
|
---|
7 | paddingBlockEnd: ['WebkitPaddingAfter'],
|
---|
8 | paddingInlineStart: ['WebkitPaddingStart', 'MozPaddingStart'],
|
---|
9 | paddingInlineEnd: ['WebkitPaddingEnd', 'MozPaddingEnd'],
|
---|
10 | borderBlockStart: ['WebkitBorderBefore'],
|
---|
11 | borderBlockStartColor: ['WebkitBorderBeforeColor'],
|
---|
12 | borderBlockStartStyle: ['WebkitBorderBeforeStyle'],
|
---|
13 | borderBlockStartWidth: ['WebkitBorderBeforeWidth'],
|
---|
14 | borderBlockEnd: ['WebkitBorderAfter'],
|
---|
15 | borderBlockEndColor: ['WebkitBorderAfterColor'],
|
---|
16 | borderBlockEndStyle: ['WebkitBorderAfterStyle'],
|
---|
17 | borderBlockEndWidth: ['WebkitBorderAfterWidth'],
|
---|
18 | borderInlineStart: ['WebkitBorderStart', 'MozBorderStart'],
|
---|
19 | borderInlineStartColor: ['WebkitBorderStartColor', 'MozBorderStartColor'],
|
---|
20 | borderInlineStartStyle: ['WebkitBorderStartStyle', 'MozBorderStartStyle'],
|
---|
21 | borderInlineStartWidth: ['WebkitBorderStartWidth', 'MozBorderStartWidth'],
|
---|
22 | borderInlineEnd: ['WebkitBorderEnd', 'MozBorderEnd'],
|
---|
23 | borderInlineEndColor: ['WebkitBorderEndColor', 'MozBorderEndColor'],
|
---|
24 | borderInlineEndStyle: ['WebkitBorderEndStyle', 'MozBorderEndStyle'],
|
---|
25 | borderInlineEndWidth: ['WebkitBorderEndWidth', 'MozBorderEndWidth']
|
---|
26 | };
|
---|
27 |
|
---|
28 | export default function logical(property, value, style) {
|
---|
29 | if (Object.prototype.hasOwnProperty.call(alternativeProps, property)) {
|
---|
30 | var alternativePropList = alternativeProps[property];
|
---|
31 | for (var i = 0, len = alternativePropList.length; i < len; ++i) {
|
---|
32 | style[alternativePropList[i]] = value;
|
---|
33 | }
|
---|
34 | }
|
---|
35 | } |
---|