Last active
January 18, 2024 21:42
-
-
Save luislobo14rap/d7bd4f6f2bc6449803b438e02bee1dfc to your computer and use it in GitHub Desktop.
create-style.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create-style.js v1 | |
function createStyle(cssString) { | |
const head = document.querySelector("head"), | |
style = document.createElement("style") | |
style.setAttribute("type", "text/css") | |
style.append(document.createTextNode(cssString)) | |
head.append(style) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment