Browse Source

Update property factory

up-style-manager
Artur Arseniev 5 years ago
parent
commit
b797f360ca
  1. 839
      src/style_manager/model/PropertyFactory.js

839
src/style_manager/model/PropertyFactory.js

@ -17,6 +17,8 @@ export default class PropertyFactory {
this.unitsAngle = ['deg', 'rad', 'grad']; this.unitsAngle = ['deg', 'rad', 'grad'];
this.fixedValues = ['initial', 'inherit', 'auto']; this.fixedValues = ['initial', 'inherit', 'auto'];
const ss = ', sans-serif'; const ss = ', sans-serif';
const optsFlex = ['flex-start', 'flex-end', 'center'];
const optsFlexAlign = [...optsFlex, 'baseline', 'stretch'];
this.optsBgSize = getOptions(['auto', 'cover', 'contain']); this.optsBgSize = getOptions(['auto', 'cover', 'contain']);
this.optsBgAttach = getOptions(['scroll', 'fixed', 'local']); this.optsBgAttach = getOptions(['scroll', 'fixed', 'local']);
@ -30,6 +32,10 @@ export default class PropertyFactory {
this.optsFloat = getOptions(['none', 'left', 'right']); this.optsFloat = getOptions(['none', 'left', 'right']);
this.optsPos = getOptions(['static', 'relative', 'absolute', 'fixed']); this.optsPos = getOptions(['static', 'relative', 'absolute', 'fixed']);
this.optsTextAlign = getOptions(['left', 'center', 'right', 'justify']); this.optsTextAlign = getOptions(['left', 'center', 'right', 'justify']);
this.optsFlexAlign = getOptions(optsFlexAlign);
this.optsJustCont = getOptions([...optsFlex, 'space-between', 'space-around', 'space-evenly']);
this.optsAlignCont = getOptions([...optsFlex, 'space-between', 'space-around', 'stretch']);
this.optsAlignSelf = getOptions(['auto', ...optsFlexAlign]);
this.optsTransitProp = getOptions([ this.optsTransitProp = getOptions([
'all', 'all',
'width', 'width',
@ -72,6 +78,10 @@ export default class PropertyFactory {
{ id: '800', label: 'Extra-Bold' }, { id: '800', label: 'Extra-Bold' },
{ id: '900', label: 'Ultra-Bold' }, { id: '900', label: 'Ultra-Bold' },
]; ];
this.optsShadowType = [
{ id: '', label: 'Outside' },
{ id: 'inset', label: 'Inside' },
];
this.optsFonts = [ this.optsFonts = [
'Arial, Helvetica' + ss, 'Arial, Helvetica' + ss,
'Arial Black, Gadget' + ss, 'Arial Black, Gadget' + ss,
@ -106,6 +116,7 @@ export default class PropertyFactory {
'inherit', 'inherit',
]; ];
this.fixedLetSpace = ['normal', 'initial', 'inherit']; this.fixedLetSpace = ['normal', 'initial', 'inherit'];
this.requireFlex = { display: ['flex'] };
this.init(); this.init();
} }
@ -115,17 +126,14 @@ export default class PropertyFactory {
} }
init() { init() {
const { fixedValues, requireFlex, typeNumber } = this;
this.props = {}; this.props = {};
const requireFlex = { display: ['flex'] };
const optsFlex = [{ id: 'flex-start' }, { id: 'flex-end' }, { id: 'center' }];
const optsFlexAlign = [...optsFlex, { id: 'baseline' }, { id: 'stretch' }];
const { fixedValues } = this;
// Build default built-in properties (the order, in the array here below, matters) // Build default built-in properties (the order, in the array here below, matters)
// [propertyName, propertyDefinition, extendFromProperty] // [propertyName, propertyDefinition, extendFromProperty]
[ [
// Number types // Number types
['text-shadow-h', { type: this.typeNumber, default: '0', units: this.unitsSizeNoPerc }], ['text-shadow-h', { type: typeNumber, default: '0', units: this.unitsSizeNoPerc }],
['top', { default: 'auto', units: this.unitsSize, fixedValues }, 'text-shadow-h'], ['top', { default: 'auto', units: this.unitsSize, fixedValues }, 'text-shadow-h'],
['right', {}, 'top'], ['right', {}, 'top'],
['bottom', {}, 'top'], ['bottom', {}, 'top'],
@ -162,13 +170,13 @@ export default class PropertyFactory {
['box-shadow-spread', {}, 'text-shadow-h'], ['box-shadow-spread', {}, 'text-shadow-h'],
['transition-duration', { default: '2', units: this.unitsTime }, 'border-radius-c'], ['transition-duration', { default: '2', units: this.unitsTime }, 'border-radius-c'],
['perspective', {}, 'border-radius-c'], ['perspective', {}, 'border-radius-c'],
['transform-rotate-x', { functionName: 'rotateX', units: this.unitsAngle, default: '0', type: this.typeNumber }], ['transform-rotate-x', { functionName: 'rotateX', units: this.unitsAngle, default: '0', type: typeNumber }],
['transform-rotate-y', { functionName: 'rotateY' }, 'transform-rotate-x'], ['transform-rotate-y', { functionName: 'rotateY' }, 'transform-rotate-x'],
['transform-rotate-z', { functionName: 'rotateZ' }, 'transform-rotate-x'], ['transform-rotate-z', { functionName: 'rotateZ' }, 'transform-rotate-x'],
['transform-scale-x', { default: '1', functionName: 'scaleX', units: undefined }, 'transform-rotate-x'], ['transform-scale-x', { default: '1', functionName: 'scaleX', units: undefined }, 'transform-rotate-x'],
['transform-scale-y', { functionName: 'scaleY' }, 'transform-scale-x'], ['transform-scale-y', { functionName: 'scaleY' }, 'transform-scale-x'],
['transform-scale-z', { functionName: 'scaleZ' }, 'transform-scale-x'], ['transform-scale-z', { functionName: 'scaleZ' }, 'transform-scale-x'],
['order', { type: this.typeNumber, default: '0', requiresParent: requireFlex }], ['order', { type: typeNumber, default: '0', requiresParent: requireFlex }],
['flex-grow', {}, 'order'], ['flex-grow', {}, 'order'],
['flex-shrink', { default: '1' }, 'order'], ['flex-shrink', { default: '1' }, 'order'],
@ -188,55 +196,17 @@ export default class PropertyFactory {
['background-image', { type: this.typeFile, functionName: 'url' }], ['background-image', { type: this.typeFile, functionName: 'url' }],
// Select types // Select types
[ ['display', { type: this.typeSelect, default: 'block', options: this.opstDisplay }],
'display',
{
type: this.typeSelect,
default: 'block',
options: this.opstDisplay,
},
],
['flex-direction', { default: 'row', options: this.optsDir, requires: requireFlex }, 'display'], ['flex-direction', { default: 'row', options: this.optsDir, requires: requireFlex }, 'display'],
['flex-wrap', { default: 'nowrap', options: this.optsWrap }, 'flex-direction'], ['flex-wrap', { default: 'nowrap', options: this.optsWrap }, 'flex-direction'],
[ ['justify-content', { default: 'flex-start', options: this.optsJustCont }, 'flex-wrap'],
'justify-content', ['align-items', { default: 'stretch', options: this.optsFlexAlign }, 'flex-wrap'],
{ ['align-content', { options: this.optsAlignCont }, 'align-items'],
default: 'flex-start', ['align-self', { default: 'auto', options: this.optsAlignSelf, requiresParent: requireFlex }, 'display'],
options: [...optsFlex, { id: 'space-between' }, { id: 'space-around' }, { id: 'space-evenly' }],
},
'flex-wrap',
],
['align-items', { default: 'stretch', options: optsFlexAlign }, 'flex-wrap'],
[
'align-content',
{
options: [...optsFlex, { id: 'space-between' }, { id: 'space-around' }, { id: 'stretch' }],
},
'align-items',
],
[
'align-self',
{
default: 'auto',
options: [{ id: 'auto' }, ...optsFlexAlign],
requiresParent: requireFlex,
},
'display',
],
['font-family', { default: 'Arial, Helvetica, sans-serif', options: this.optsFonts }, 'display'], ['font-family', { default: 'Arial, Helvetica, sans-serif', options: this.optsFonts }, 'display'],
['font-weight', { default: '400', options: this.optsWeight }, 'display'], ['font-weight', { default: '400', options: this.optsWeight }, 'display'],
['border-style', { default: 'solid', options: this.optsBorderStyle }, 'display'], ['border-style', { default: 'solid', options: this.optsBorderStyle }, 'display'],
[ ['box-shadow-type', { default: '', options: this.optsShadowType }, 'display'],
'box-shadow-type',
{
default: '',
options: [
{ id: '', label: 'Outside' },
{ id: 'inset', label: 'Inside' },
],
},
'display',
],
['background-repeat', { default: 'repeat', options: this.optsBgRepeat }, 'display'], ['background-repeat', { default: 'repeat', options: this.optsBgRepeat }, 'display'],
['background-position', { default: 'left top', options: this.optsBgPos }, 'display'], ['background-position', { default: 'left top', options: this.optsBgPos }, 'display'],
['background-attachment', { default: 'scroll', options: this.optsBgAttach }, 'display'], ['background-attachment', { default: 'scroll', options: this.optsBgAttach }, 'display'],
@ -378,772 +348,5 @@ export default class PropertyFactory {
}); });
return result; return result;
for (var i = 0, len = props.length; i < len; i++) {
var obj = {};
var prop = props[i];
obj.property = prop;
// Property
// switch (prop) {
// // case 'border-radius-c':
// // obj.property = 'border-radius';
// // break;
// }
// Fixed values
// switch (prop) {
// // case 'top':
// // case 'right':
// // case 'bottom':
// // case 'left':
// // case 'margin-top':
// // case 'margin-right':
// // case 'margin-bottom':
// // case 'margin-left':
// // case 'padding-top':
// // case 'padding-right':
// // case 'padding-bottom':
// // case 'padding-left':
// // case 'width':
// // case 'max-width':
// // case 'min-width':
// // case 'height':
// // case 'max-height':
// // case 'min-height':
// // case 'flex-basis':
// case 'n':
// obj.fixedValues = ['initial', 'inherit', 'auto'];
// break;
// // case 'font-size':
// case 'n':
// obj.fixedValues = [
// 'medium',
// 'xx-small',
// 'x-small',
// 'small',
// 'large',
// 'x-large',
// 'xx-large',
// 'smaller',
// 'larger',
// 'length',
// 'initial',
// 'inherit'
// ];
// break;
// // case 'letter-spacing':
// // case 'line-height':
// case 'n':
// obj.fixedValues = ['normal', 'initial', 'inherit'];
// break;
// }
// Type
switch (
prop
// case 'float':
// case 'position':
// case 'text-align':
// obj.type = 'radio';
// break;
// case 'display':
// case 'flex-direction':
// case 'flex-wrap':
// case 'justify-content':
// case 'align-items':
// case 'align-content':
// case 'align-self':
// case 'font-family':
// case 'font-weight':
// case 'border-style':
// case 'box-shadow-type':
// case 'background-repeat':
// case 'background-position':
// case 'background-attachment':
// case 'background-size':
// case 'transition-property':
// case 'transition-timing-function':
// case 'cursor':
// case 'overflow':
// case 'overflow-x':
// case 'overflow-y':
// obj.type = 'select';
// break;
// case 'top':
// case 'right':
// case 'bottom':
// case 'left':
// case 'margin-top':
// case 'margin-right':
// case 'margin-bottom':
// case 'margin-left':
// case 'padding-top':
// case 'padding-right':
// case 'padding-bottom':
// case 'padding-left':
// case 'min-height':
// case 'min-width':
// case 'max-height':
// case 'max-width':
// case 'width':
// case 'height':
// case 'font-size':
// case 'letter-spacing':
// case 'line-height':
// case 'text-shadow-h':
// case 'text-shadow-v':
// case 'text-shadow-blur':
// case 'border-radius-c':
// case 'border-top-left-radius':
// case 'border-top-right-radius':
// case 'border-bottom-left-radius':
// case 'border-bottom-right-radius':
// case 'border-width':
// case 'box-shadow-h':
// case 'box-shadow-v':
// case 'box-shadow-blur':
// case 'box-shadow-spread':
// case 'transition-duration':
// case 'perspective':
// case 'transform-rotate-x':
// case 'transform-rotate-y':
// case 'transform-rotate-z':
// case 'transform-scale-x':
// case 'transform-scale-y':
// case 'transform-scale-z':
// case 'order':
// case 'flex-grow':
// case 'flex-shrink':
// case 'flex-basis':
// obj.type = 'integer';
// break;
// case 'margin':
// case 'padding':
// case 'border-radius':
// case 'border':
// case 'transform':
// obj.type = 'composite';
// break;
// case 'color':
// case 'text-shadow-color':
// case 'background-color':
// case 'border-color':
// case 'box-shadow-color':
// obj.type = 'color';
// break;
// case 'text-shadow':
// case 'box-shadow':
// case 'background':
// case 'transition':
// obj.type = 'stack';
// break;
// case 'background-image':
// obj.type = 'file';
// break;
) {
}
// Defaults
switch (
prop
// case 'float':
// case 'background-color':
// case 'text-shadow':
// obj.defaults = 'none';
// break;
// // case 'display':
// obj.defaults = 'block';
// break;
// // case 'flex-direction':
// obj.defaults = 'row';
// break;
// // case 'flex-wrap':
// obj.defaults = 'nowrap';
// break;
// // case 'justify-content':
// obj.defaults = 'flex-start';
// break;
// // case 'align-items':
// obj.defaults = 'stretch';
// break;
// // case 'align-content':
// obj.defaults = 'stretch';
// break;
// // case 'align-self':
// obj.defaults = 'auto';
// break;
// // case 'position':
// obj.defaults = 'static';
// break;
// case 'margin-top':
// case 'margin-right':
// case 'margin-bottom':
// case 'margin-left':
// case 'padding-top':
// case 'padding-right':
// case 'padding-bottom':
// case 'padding-left':
// case 'text-shadow-h':
// case 'text-shadow-v':
// case 'text-shadow-blur':
// case 'border-radius-c':
// case 'box-shadow-h':
// case 'box-shadow-v':
// case 'box-shadow-spread':
// case 'perspective':
// case 'transform-rotate-x':
// case 'transform-rotate-y':
// case 'transform-rotate-z':
// case 'order':
// case 'flex-grow':
// obj.defaults = 0;
// break;
// case 'border-top-left-radius':
// case 'border-top-right-radius':
// case 'border-bottom-left-radius':
// case 'border-bottom-right-radius':
// obj.defaults = '0px';
// break;
// case 'transform-scale-x':
// case 'transform-scale-y':
// case 'transform-scale-z':
// case 'flex-shrink':
// obj.defaults = 1;
// break;
// case 'box-shadow-blur':
// obj.defaults = '5px';
// break;
// case 'top':
// case 'right':
// case 'bottom':
// case 'left':
// case 'min-height':
// case 'min-width':
// case 'max-height':
// case 'max-width':
// case 'width':
// case 'height':
// case 'background-size':
// case 'cursor':
// case 'flex-basis':
// obj.defaults = 'auto';
// break;
// // case 'font-family':
// obj.defaults = 'Arial, Helvetica, sans-serif';
// break;
// // case 'font-size':
// // case 'border-width':
// obj.defaults = 'medium';
// break;
// // case 'font-weight':
// obj.defaults = '400';
// break;
// // case 'letter-spacing':
// // case 'line-height':
// obj.defaults = 'normal';
// break;
// case 'color':
// case 'text-shadow-color':
// case 'border-color':
// case 'box-shadow-color':
// obj.defaults = 'black';
// break;
// case 'text-align':
// obj.defaults = 'left';
// break;
// case 'border-style':
// obj.defaults = 'solid';
// break;
// // case 'box-shadow-type':
// obj.defaults = '';
// break;
// // case 'background-repeat':
// obj.defaults = 'repeat';
// break;
// // case 'background-position':
// obj.defaults = 'left top';
// break;
// // case 'background-attachment':
// obj.defaults = 'scroll';
// break;
// // case 'transition-property':
// obj.defaults = 'width';
// break;
// // case 'transition-duration':
// obj.defaults = '2';
// break;
// // case 'transition-timing-function':
// obj.defaults = 'ease';
// break;
// // case 'overflow':
// // case 'overflow-x':
// // case 'overflow-y':
// obj.defaults = 'visible';
// break;
) {
}
/*
* Add styleable dependency on other properties. Allows properties to be
* dynamically hidden or shown based on values of other properties.
*
* Property will be styleable if all of the properties (keys) in the
* requires object have any of the values specified in the array.
*/
// switch (prop) {
// // case 'flex-direction':
// // case 'flex-wrap':
// // case 'justify-content':
// // case 'align-items':
// // case 'align-content':
// // obj.requires = { display: ['flex'] };
// // break;
// // case 'order':
// // case 'flex-basis':
// // case 'flex-grow':
// // case 'flex-shrink':
// // case 'align-self':
// // obj.requiresParent = { display: ['flex'] };
// // break;
// }
// Units
// switch (prop) {
// case 'top':
// case 'bottom':
// case 'margin-top':
// case 'margin-bottom':
// case 'padding-top':
// case 'padding-bottom':
// case 'min-height':
// case 'max-height':
// case 'height':
// obj.units = ['px', '%', 'vh'];
// break;
// case 'right':
// case 'left':
// case 'margin-right':
// case 'margin-left':
// case 'padding-right':
// case 'padding-left':
// case 'min-width':
// case 'max-width':
// case 'width':
// obj.units = ['px', '%', 'vw'];
// break;
// case 'flex-basis':
// obj.units = ['px', '%', 'vw', 'vh'];
// break;
// case 'text-shadow-v':
// case 'text-shadow-h':
// case 'text-shadow-blur':
// case 'border-radius-c':
// case 'border-top-left-radius':
// case 'border-top-right-radius':
// case 'border-bottom-left-radius':
// case 'border-bottom-right-radius':
// case 'box-shadow-h':
// case 'box-shadow-v':
// obj.units = ['px', '%'];
// break;
// case 'font-size':
// case 'letter-spacing':
// case 'line-height':
// obj.units = ['px', 'em', 'rem', '%'];
// break;
// case 'border-width':
// obj.units = ['px', 'em'];
// break;
// case 'box-shadow-blur':
// case 'box-shadow-spread':
// case 'perspective':
// obj.units = ['px'];
// break;
// case 'transition-duration':
// obj.units = ['s'];
// break;
// case 'transform-rotate-x':
// case 'transform-rotate-y':
// case 'transform-rotate-z':
// obj.units = ['deg'];
// break;
// }
// Min/Max
// switch (prop) {
// case 'padding-top':
// case 'padding-right':
// case 'padding-bottom':
// case 'padding-left':
// case 'min-height':
// case 'min-width':
// case 'max-height':
// case 'max-width':
// case 'width':
// case 'height':
// case 'font-size':
// case 'text-shadow-blur':
// case 'border-radius-c':
// case 'border-top-left-radius':
// case 'border-top-right-radius':
// case 'border-bottom-left-radius':
// case 'border-bottom-right-radius':
// case 'border-width':
// case 'box-shadow-blur':
// case 'transition-duration':
// case 'perspective':
// case 'flex-basis':
// obj.min = 0;
// break;
// }
// Preview
// switch (prop) {
// case 'text-shadow':
// case 'box-shadow':
// case 'background':
// obj.preview = true;
// break;
// }
// Detached
// switch (prop) {
// case 'background':
// obj.detached = true;
// break;
// }
// Functions
// switch (prop) {
// // // case 'transform-rotate-x':
// // obj.functionName = 'rotateX';
// // break;
// // // case 'transform-rotate-y':
// // obj.functionName = 'rotateY';
// // break;
// // // case 'transform-rotate-z':
// // obj.functionName = 'rotateZ';
// // break;
// // // case 'transform-scale-x':
// // obj.functionName = 'scaleX';
// // break;
// // // case 'transform-scale-y':
// // obj.functionName = 'scaleY';
// // break;
// // // case 'transform-scale-z':
// // obj.functionName = 'scaleZ';
// // break;
// // case 'background-image':
// // obj.functionName = 'url';
// // break;
// }
// Options
// switch (prop) {
// case 'float':
// obj.list = [{ value: 'none' }, { value: 'left' }, { value: 'right' }];
// break;
// case 'display':
// obj.list = [
// { value: 'block' },
// { value: 'inline' },
// { value: 'inline-block' },
// { value: 'flex' },
// { value: 'none' }
// ];
// break;
// case 'flex-direction':
// obj.list = [
// { value: 'row' },
// { value: 'row-reverse' },
// { value: 'column' },
// { value: 'column-reverse' }
// ];
// break;
// case 'flex-wrap':
// obj.list = [
// { value: 'nowrap' },
// { value: 'wrap' },
// { value: 'wrap-reverse' }
// ];
// break;
// case 'justify-content':
// obj.list = [
// { value: 'flex-start' },
// { value: 'flex-end' },
// { value: 'center' },
// { value: 'space-between' },
// { value: 'space-around' },
// { value: 'space-evenly' }
// ];
// break;
// case 'align-items':
// obj.list = [
// { value: 'flex-start' },
// { value: 'flex-end' },
// { value: 'center' },
// { value: 'baseline' },
// { value: 'stretch' }
// ];
// break;
// case 'align-content':
// obj.list = [
// { value: 'flex-start' },
// { value: 'flex-end' },
// { value: 'center' },
// { value: 'space-between' },
// { value: 'space-around' },
// { value: 'stretch' }
// ];
// break;
// case 'align-self':
// obj.list = [
// { value: 'auto' },
// { value: 'flex-start' },
// { value: 'flex-end' },
// { value: 'center' },
// { value: 'baseline' },
// { value: 'stretch' }
// ];
// break;
// case 'position':
// obj.list = [
// { value: 'static' },
// { value: 'relative' },
// { value: 'absolute' },
// { value: 'fixed' }
// ];
// break;
// case 'font-family':
// var ss = ', sans-serif';
// var fonts = [
// 'Arial, Helvetica' + ss,
// 'Arial Black, Gadget' + ss,
// 'Brush Script MT' + ss,
// 'Comic Sans MS, cursive' + ss,
// 'Courier New, Courier, monospace',
// 'Georgia, serif',
// 'Helvetica' + ss,
// 'Impact, Charcoal' + ss,
// 'Lucida Sans Unicode, Lucida Grande' + ss,
// 'Tahoma, Geneva' + ss,
// 'Times New Roman, Times, serif',
// 'Trebuchet MS, Helvetica' + ss,
// 'Verdana, Geneva' + ss
// ];
// obj.list = [];
// for (var j = 0, l = fonts.length; j < l; j++) {
// var font = {};
// font.value = fonts[j];
// font.name = fonts[j].split(',')[0];
// obj.list.push(font);
// }
// break;
// case 'font-weight':
// obj.list = [
// { value: '100', name: 'Thin' },
// { value: '200', name: 'Extra-Light' },
// { value: '300', name: 'Light' },
// { value: '400', name: 'Normal' },
// { value: '500', name: 'Medium' },
// { value: '600', name: 'Semi-Bold' },
// { value: '700', name: 'Bold' },
// { value: '800', name: 'Extra-Bold' },
// { value: '900', name: 'Ultra-Bold' }
// ];
// break;
// case 'text-align':
// obj.list = [
// { value: 'left' },
// { value: 'center' },
// { value: 'right' },
// { value: 'justify' }
// ];
// break;
// case 'border-style':
// obj.list = [
// { value: 'none' },
// { value: 'solid' },
// { value: 'dotted' },
// { value: 'dashed' },
// { value: 'double' },
// { value: 'groove' },
// { value: 'ridge' },
// { value: 'inset' },
// { value: 'outset' }
// ];
// break;
// case 'box-shadow-type':
// obj.list = [
// { value: '', name: 'Outside' },
// { value: 'inset', name: 'Inside' }
// ];
// break;
// case 'background-repeat':
// obj.list = [
// { value: 'repeat' },
// { value: 'repeat-x' },
// { value: 'repeat-y' },
// { value: 'no-repeat' }
// ];
// break;
// case 'background-position':
// obj.list = [
// { value: 'left top' },
// { value: 'left center' },
// { value: 'left bottom' },
// { value: 'right top' },
// { value: 'right center' },
// { value: 'right bottom' },
// { value: 'center top' },
// { value: 'center center' },
// { value: 'center bottom' }
// ];
// break;
// case 'background-attachment':
// obj.list = [
// { value: 'scroll' },
// { value: 'fixed' },
// { value: 'local' }
// ];
// break;
// case 'background-size':
// obj.list = [
// { value: 'auto' },
// { value: 'cover' },
// { value: 'contain' }
// ];
// break;
// case 'transition-property':
// obj.list = [
// { value: 'all' },
// { value: 'width' },
// { value: 'height' },
// { value: 'background-color' },
// { value: 'transform' },
// { value: 'box-shadow' },
// { value: 'opacity' }
// ];
// break;
// case 'transition-timing-function':
// obj.list = [
// { value: 'linear' },
// { value: 'ease' },
// { value: 'ease-in' },
// { value: 'ease-out' },
// { value: 'ease-in-out' }
// ];
// break;
// case 'cursor':
// obj.list = [
// { value: 'auto' },
// { value: 'pointer' },
// { value: 'copy' },
// { value: 'crosshair' },
// { value: 'grab' },
// { value: 'grabbing' },
// { value: 'help' },
// { value: 'move' },
// { value: 'text' }
// ];
// break;
// case 'overflow':
// case 'overflow-x':
// case 'overflow-y':
// obj.list = [
// { value: 'visible' },
// { value: 'hidden' },
// { value: 'scroll' },
// { value: 'auto' }
// ];
// break;
// }
// Properties
switch (
prop
// // case 'margin':
// obj.properties = this.build([
// 'margin-top',
// 'margin-right',
// 'margin-bottom',
// 'margin-left'
// ]);
// break;
// // case 'padding':
// obj.properties = this.build([
// 'padding-top',
// 'padding-right',
// 'padding-bottom',
// 'padding-left'
// ]);
// break;
// case 'text-shadow':
// obj.properties = this.build([
// 'text-shadow-h',
// 'text-shadow-v',
// 'text-shadow-blur',
// 'text-shadow-color'
// ]);
// break;
// // case 'border':
// obj.properties = this.build([
// 'border-width',
// 'border-style',
// 'border-color'
// ]);
// break;
// // case 'border-radius':
// obj.properties = this.build([
// 'border-top-left-radius',
// 'border-top-right-radius',
// 'border-bottom-right-radius',
// 'border-bottom-left-radius'
// ]);
// break;
// case 'box-shadow':
// obj.properties = this.build([
// 'box-shadow-h',
// 'box-shadow-v',
// 'box-shadow-blur',
// 'box-shadow-spread',
// 'box-shadow-color',
// 'box-shadow-type'
// ]);
// break;
// case 'background':
// obj.properties = this.build([
// 'background-image',
// 'background-repeat',
// 'background-position',
// 'background-attachment',
// 'background-size'
// ]);
// break;
// case 'transition':
// obj.properties = this.build([
// 'transition-property',
// 'transition-duration',
// 'transition-timing-function'
// ]);
// break;
// case 'transform':
// obj.properties = this.build([
// 'transform-rotate-x',
// 'transform-rotate-y',
// 'transform-rotate-z',
// 'transform-scale-x',
// 'transform-scale-y',
// 'transform-scale-z'
// ]);
// break;
) {
}
objs.push(obj);
}
return objs;
} }
} }

Loading…
Cancel
Save