Hello! I would like to import a specific CSS file depending on a slug's value.
I was wondering if there is a way to do this from a server component?
Current client code looks like this:
useEffect(() =>
{
const cssHref = `/colors/${/* SLUG */}.css`;
const link = document.createElement('link');
link.rel = 'stylesheet';
link.href = cssHref;
link.onload = () => setCssLoaded(true);
link.onerror = () => setCssLoaded(true);
document.head.appendChild(link);
return () =>
{
document.head.removeChild(link);
};
}, []);