Skip to content

Instantly share code, notes, and snippets.

@neodigm
Created October 29, 2019 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save neodigm/64a200499a97cd7967997be85334bc1f to your computer and use it in GitHub Desktop.
Save neodigm/64a200499a97cd7967997be85334bc1f to your computer and use it in GitHub Desktop.
Remove all Bootstrap CSS from a page. Useful for Tailwind migration testing. Vanilla JavaScript ES5.
var eSS = document.querySelectorAll('link[rel=stylesheet]');
for(var i=0;i<eSS.length;i++){
if( typeof eSS[i].href != "undefined" ){
if( eSS[i].href.indexOf("bootstrap") != -1 ){
eSS[i].parentNode.removeChild(eSS[i]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment