Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

How to provide the loading of the page styles on demand (when specific page visited) in Blazor?

$
0
0

Assume that the application has N pages, where N can be arbitrarily large. Ideally:

  • When user has visited page A, only styles for page A must be loaded but not for other pages (assume that all styles for A.razor are in A.razor.css).
  • when user has moved to page B, only styles for page B must be loaded but not for other pages (assume that all styles for B.razor are in B.razor.css).

I am not sure on which file refers

<link href="@Assets["{PACKAGE ID/ASSEMBLY NAME}.styles.css"]" rel="stylesheet">

I have read the documentation but as far as I have checked the output files below obj, all styles are bundled to single file which does not match with above desired behavior.

If Blazor can not load the page dependent styles on demand, I suppose I don't need the scoped styles because I am using the BEM-like convention so the CSS class name reusage is basically impossible.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>