Load a CSS file dynamically

// Create new link element
const link = document.createElement('link');
link.setAttribute('rel', 'stylesheet');
link.setAttribute('href', '/path/to/js/file.css');
// Append to the `head` element
document.head.appendChild(link);

See also