user3792705:
Yo sé cómo cargar CSS.
injectCss(styles) {
let styleSheet = document.createElement("style");
styleSheet.type = 'text/css';
styleSheet.innerText = styles;
document.head.appendChild(styleSheet);
}
Cómo descargarlo?
vadivel a:
Espero que esto te ayude.
function injectCss(styles) {
let styleSheet = document.createElement("style");
styleSheet.type = 'text/css';
styleSheet.setAttribute("id", "dunamicstylesheet");
styleSheet.innerText = styles;
document.head.appendChild(styleSheet);
}
//Create-styleSheet
injectCss('dynamic.css');
//remove-styleSheet
var stylesheet = document.getElementById('dunamicstylesheet');
stylesheet.parentNode.removeChild(stylesheet);