JSFiddle - React, Tailwind, and code Playground

JavaScript

window.URL = window.URL || window.webkitURL;

var blob = new Blob(['body { color: red; }'], {type: 'text/css'});

var link = document.createElement('link');
link.rel = 'stylesheet';
link.href = window.URL.createObjectURL(blob);
document.body.appendChild(link);



var a = document.createElement('a');
    a.href = window.URL.createObjectURL(blob);
    a.download = 'filename.css';
    a.textContent = 'Download file!';
    document.body.appendChild(a);