styledoc.js
function getPreviewContainerStyle(options) {
        var preview_container_style = "";

        var padding_value = options.preview_padding;
        if (typeof padding_value === "number") {
            padding_value = [ padding_value ];
        }
        if (isArray(padding_value)) {
            preview_container_style += "padding: " + padding_value.join("px ") + "px !important; ";
        }

        if (options.background_color) {
            preview_container_style += "background-color: " + options.background_color + " !important; ";
        }

        return preview_container_style.replace(/\s$/, "") || undefined;
    }
function getPreviewContainerStyle(options) {
        var preview_container_style = "";

        var padding_value = options.preview_padding;
        if (typeof padding_value === "number") {
            padding_value = [ padding_value ];
        }
        if (isArray(padding_value)) {
            preview_container_style += "padding: " + padding_value.join("px ") + "px !important; ";
        }

        if (options.background_color) {
            preview_container_style += "background-color: " + options.background_color + " !important; ";
        }

        return preview_container_style.replace(/\s$/, "") || undefined;
    }
function getPreviewContainerStyle ( options ) { var preview_container_style = "" ; var padding_value = options . preview_padding ; if ( typeof padding_value === "number" ) { padding_value = [ padding_value ] ; } if ( isArray ( padding_value ) ) { preview_container_style += "padding: " + padding_value . join ( "px " ) + "px !important; " ; } if ( options . background_color ) { preview_container_style += "background-color: " + options . background_color + " !important; " ; } return preview_container_style . replace ( / \s$ / , "" ) || undefined ; }
Generate value for the preview container "style" attribute
@param {object} options
@param {number|number[]} [options.preview_padding] Padding value(s) for preview container (4 or [4, 8], or [4, 0, 12, 8] etc.)
@param {string} [options.background_color] Background color CSS value for both main showcase page and preview iframe pages
@returns {string|undefined} Undefined value denies redundant attribute creating: $elem.attr("style", undefined)
@todo enable string value for preview_padding (like "4px 8px")?
Generate value for the preview container style attribute