equivalent to assetsService.loadCss
# help-with-umbraco
m
There used to be an 'assetsService' that we could use to load css on runtime. Is there an equivalent for that on v14?
a
Nope. Prior to 14.2, Umbraco loaded a
user-defined.css
, and the idea was that you could overwrite this with your custom CSS. But it didn't really work with Umbraco's Razor Class Library, which is why it was removed. I tried asking a bit about it via a comment to the PR that removed the
user-defined.css
, but I haven't received a reply back. You can see the PR here: https://github.com/umbraco/Umbraco-CMS/pull/16792
m
Thanks Anders. That's really unfortunate. In trying to migrate my Iconic package to v14 and without a way of loading css won't work 😩 I'll keep an eye on that ticket.
a
You can inject a new
<link/>
element into the DOM if you really need to. Warren has an example for that in this thread: https://discord.com/channels/869656431308189746/1268501698620559461
As for the PR that I linked to earlier, it's already merged and closed, and may not get any further activity. So might be better to create a new issue about loading custom CSS files.
12 Views