We have found an issue when upgrading a v8 site to Umbraco 10, some of our stylesheets are not being included by Smidge when the SmidgeHelper.RequireCss is called in a partial.
tldr: Does anyone know an alternative way to include CSS that is required for a certain section of the page only when it is required in Umbraco 9+.
In the past we included the CSS for some sections of the website in the partial that output that sections code. Stuff like a notice bar or a countdown that could be switched on and off would have the Html.RequireCss call in the partial. This all worked fine but after the upgrade and converting these calls to SmidgeHelper.RequireCss not all of them work.
Researching why this may be I have found a few threads on github (this and some of the threads it's linked to) where Shannon explains it only worked in ClientDependency because of a hack which hasn't been included in Smidge. And what we used to do is essentially impossible.
With the Client Dependency hack gone it seems like we are going backwards to having every style for every part of the site downloaded regardless of their requirement. And even though Smidge allows the creation of bundles, I don't see how this prevents that. I maybe just not understanding Smidge properly, but if so could someone who does understand it point me in the right direction.
Calling Smidge in Partials
We have found an issue when upgrading a v8 site to Umbraco 10, some of our stylesheets are not being included by Smidge when the SmidgeHelper.RequireCss is called in a partial.
tldr: Does anyone know an alternative way to include CSS that is required for a certain section of the page only when it is required in Umbraco 9+.
In the past we included the CSS for some sections of the website in the partial that output that sections code. Stuff like a notice bar or a countdown that could be switched on and off would have the Html.RequireCss call in the partial. This all worked fine but after the upgrade and converting these calls to SmidgeHelper.RequireCss not all of them work.
Researching why this may be I have found a few threads on github (this and some of the threads it's linked to) where Shannon explains it only worked in ClientDependency because of a hack which hasn't been included in Smidge. And what we used to do is essentially impossible.
With the Client Dependency hack gone it seems like we are going backwards to having every style for every part of the site downloaded regardless of their requirement. And even though Smidge allows the creation of bundles, I don't see how this prevents that. I maybe just not understanding Smidge properly, but if so could someone who does understand it point me in the right direction.
is working on a reply...