Adding DOM Header Insertion to be Available for Offline Use

The example below is loading tailwind version 2.

<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
<script>
    function loadRemoteCSS(url) {
        $.get(url, function(cssContent) {
            $('<style>')
                .appendTo('head')
                .attr({
                    type: 'text/css'
                })
                .text(cssContent);
        });
    }
    $(document).ready(function() {
        loadRemoteCSS('https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css');
    });
</script>

Last updated