/*eslint max-statements:0,complexity:0,no-invalid-this:0*/

export const getStyles = function getStyles() {
  const {
    italic,
    bold,
    caps,
    margin,
    padding,
    textColor,
    textFont,
    textSize,
    textAlign,
    bgColor,
    bgImage,
    bgDarken
  } = this.props;

  const styles = {};

  if (typeof italic === "boolean") {
    styles.fontStyle = italic ? "italic" : "normal";
  }
  if (typeof bold === "boolean") {
    styles.fontWeight = bold ? "bold" : "normal";
  }
  if (typeof caps === "boolean") {
    styles.textTransform = caps ? "uppercase" : "none";
  }
  if (margin) {
    styles.margin = margin;
  }
  if (padding) {
    styles.padding = padding;
  }
  if (textColor) {
    let color = "";
    if (!this.context.styles.colors.hasOwnProperty(textColor)) {
      color = textColor;
    } else {
      color = this.context.styles.colors[textColor];
    }
    styles.color = color;
  }
  if (textFont) {
    let font = "";
    if (!this.context.styles.fonts.hasOwnProperty(textFont)) {
      font = textFont;
    } else {
      font = this.context.styles.fonts[textFont];
    }
    styles.fontFamily = font;
  }
  if (textSize) {
    styles.fontSize = textSize;
  }
  if (textAlign) {
    styles.textAlign = textAlign;
  }
  if (bgColor) {
    let color = "";
    if (!this.context.styles.colors.hasOwnProperty(bgColor)) {
      color = bgColor;
    } else {
      color = this.context.styles.colors[bgColor];
    }
    styles.backgroundColor = color;
  }
  if (bgImage) {
    if (bgDarken) {
      styles.backgroundImage =
      `linear-gradient( rgba(0, 0, 0, ${bgDarken}), rgba(0, 0, 0, ${bgDarken}) ), url(${bgImage})`;
    } else {
      styles.backgroundImage = `url(${bgImage})`;
    }
    styles.backgroundSize = "cover";
    styles.backgroundPosition = "center center";
  }
  return styles;
};


@@ -264,16 +264,58 @@
 bgDarken
+,%0A    bgSize,%0A    bgPosition,%0A    bgRepeat
 %0A  %7D = t
@@ -1790,16 +1790,26 @@
 ndSize =
+ bgSize %7C%7C
  %22cover%22
@@ -1841,16 +1841,30 @@
 sition =
+ bgPosition %7C%7C
  %22center
@@ -1873,16 +1873,84 @@
 enter%22;%0A
+    if (bgRepeat) %7B%0A      styles.backgroundRepeat = bgRepeat;%0A    %7D%0A
   %7D%0A  re

Add bg{Size,Position,Repeat} to base