src/translate.js
function translateValue(sceneDrawGroup, ccssProperty, ccssValue) {
    if (ccssProperty.indexOf('comp-op') >= 0) {
        switch (ccssValue) {
            case 'src-over':
                return 'overlay';
            case 'plus':
                return 'add';
            default:
                return ccssValue;
        }
    }
    if (referenceCSS[ccssProperty].type === 'color') {
        return getColorFromLiteral(sceneDrawGroup, ccssValue, ccssProperty.indexOf('fill') >= 0);
    }
    if (ccssProperty.indexOf('width') >= 0) {
        ccssValue += 'px';
    }
    if (ccssProperty.indexOf('allow-overlap') >= 0) {
        ccssValue = !ccssValue;
    }
    return ccssValue;
}
function translateValue(sceneDrawGroup, ccssProperty, ccssValue) {
    if (ccssProperty.indexOf('comp-op') >= 0) {
        switch (ccssValue) {
            case 'src-over':
                return 'overlay';
            case 'plus':
                return 'add';
            default:
                return ccssValue;
        }
    }
    if (referenceCSS[ccssProperty].type === 'color') {
        return getColorFromLiteral(sceneDrawGroup, ccssValue, ccssProperty.indexOf('fill') >= 0);
    }
    if (ccssProperty.indexOf('width') >= 0) {
        ccssValue += 'px';
    }
    if (ccssProperty.indexOf('allow-overlap') >= 0) {
        ccssValue = !ccssValue;
    }
    return ccssValue;
}
function translateValue ( sceneDrawGroup , ccssProperty , ccssValue ) { if ( ccssProperty . indexOf ( 'comp-op' ) >= 0 ) { switch ( ccssValue ) { case 'src-over' : return 'overlay' ; case 'plus' : return 'add' ; default : return ccssValue ; } } if ( referenceCSS [ ccssProperty ] . type === 'color' ) { return getColorFromLiteral ( sceneDrawGroup , ccssValue , ccssProperty . indexOf ( 'fill' ) >= 0 ) ; } if ( ccssProperty . indexOf ( 'width' ) >= 0 ) { ccssValue += 'px' ; } if ( ccssProperty . indexOf ( 'allow-overlap' ) >= 0 ) { ccssValue = ! ccssValue ; } return ccssValue ; }
Translates a ccssValue from the reference standard to the Tangram standard
Translates a ccssValue from the reference standard to the Tangram standard