You can do all this with pure "JavaScript" without using the "DOM".
const sheet = (await imoprt("css-url", { with: { type: "css" } })).default; // This can also be used in "shadowRoot". document.adoptedStyleSheets = [sheet];