Is it possible to manipulate a style tag loaded from an external CSS file using plain JavaScript?
I'm attempting to apply custom styles to a style tag fetched from a CSS file,
The issue lies in my struggle to convert the file content into a string
I've searched for a solution like
import baseStyle from "./css/style.css"
//or
const baseStyle require("./css/style.css")
So, the concept is to parse it within the HTML
const cssStyle = document.createElement("style");
cssStyle.innerHTML = baseStyle;
const doc = iframe.contentDocument;
doc.head.appendChild(cssStyle)
Currently, I'm using GrapesJs and attempting to analyze CSS from a framework
Appreciate any assistance
I've tried various methods to load the CSS, but haven't found a working solution