You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This could just be me not understanding how the library works, but I have been unable to find any information in regards to rendering CSS from a partial. For example:
In this instance, I have Smidge.RequiresCss("/lib/example/example.min.css") in the Navigation partial, which does not get rendered. If I put @await Smidge.CssHereAsync(debug: true) below where this partial is being rendered, it works fine.
Please could anyone advise me on how I can get CSS from my partials to render in the head of my HTML document/if this is possible?
The text was updated successfully, but these errors were encountered:
You cannot require assets in a partial. This is a common question but you can a conversation about that here #145 (comment)
To recap:
Creating dynamic bundles in partial views is problematic for various reasons:
If any partial view is cached, it breaks
If you want to use progressive rendering, it breaks
If you use child actions or view components, it breaks (generally speaking)
Depending on how you have structured your views, it may not work because the ordering of when partial views are executed isn't always the same. Razor generally renders things from the inside out but in .NET Core I don't think this is always the case especially since progressive rendering is possible
This could just be me not understanding how the library works, but I have been unable to find any information in regards to rendering CSS from a partial. For example:
In this instance, I have
Smidge.RequiresCss("/lib/example/example.min.css")
in theNavigation
partial, which does not get rendered. If I put@await Smidge.CssHereAsync(debug: true)
below where this partial is being rendered, it works fine.Please could anyone advise me on how I can get CSS from my partials to render in the head of my HTML document/if this is possible?
The text was updated successfully, but these errors were encountered: