code: function appendCSS(cssText, element) {
    console.log(element);
    const styleElement = document.createElement('style');
    styleElement.setAttribute('type', 'text/css');
    styleElement.innerHTML = cssText;
    const refNode = element.hasChildNodes() ? element.children[0] : null;
    element.insertBefore(styleElement, refNode);
  }
docs: import htmlToImage from 'html-to-image'; var htmlToImage = require('html-to-image');