Currently when setting up a new Blazor app I need to go to the docs each time or look at a reference project to remember the resource paths for the CSS files. Additionally once you have a project if you are relying on a CDN but later update the NuGet package your app will be referencing the wrong css bundle unless you remembered to also update your layout.
Instead of having this as a magic string that is required in each project, it would be great if a new helper class could be introduced. As an example it might look something like:
public class TelerikResources
{
public class Cdn
{
public class Default
{
public string Path = "";
}
public class Bootstrap
{
public string Path = "";
}
public class Material
{
public string Path = "";
}
}
public class Local
{
public class Default
{
public string Path = "";
}
public class Bootstrap
{
public string Path = "";
}
public class Material
{
public string Path = "";
}
}
}
This would have the benefit that in the layout you might simply have:
<link href="@TelerikResources.Cdn.Bootstrap.Path" rel="stylesheet" />
This has a few benefits. It's easier to remember, easier to discover the other available prebuilt styles, and removes issues with pointing at the wrong path after updating library versions (assuming that you're using the Cdn rather than local resource).