Created
April 8, 2024 13:12
-
-
Save edjw/398a394f1f4fdc11079e5b2a574250be to your computer and use it in GitHub Desktop.
CSS Naked Day JS
This file contains 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
const styleElements = document.querySelectorAll( | |
'link[rel="stylesheet"], style' | |
); | |
const inlineStyleElements = document.querySelectorAll("[style]"); | |
for (const styleElement of styleElements) { | |
if (styleElement.parentNode) { | |
styleElement.parentNode.removeChild(styleElement); | |
} | |
} | |
for (const inlineStyleElement of inlineStyleElements) { | |
inlineStyleElement.removeAttribute("style"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment