Declined
Last Updated: 29 Mar 2022 07:18 by ADMIN
Dan
Created on: 27 Oct 2021 04:48
Category: UI for Blazor
Type: Feature Request
0
Add a Resource Helper for CSS & Script locations

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).

2 comments
ADMIN
Joana
Posted on: 29 Mar 2022 07:18

Hello Dan,

As my colleague Dimo suggested, such feature should be added in application level. However, we did evaluate it and wait for any other feedback or demand on the topic.

So, I will close the feature request. However, we do not dismiss such feature requests and if the demand arises we will look into it again.

Regards,
Joana
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

ADMIN
Dimo
Posted on: 02 Nov 2021 10:15

Hello Dan,

I see the practical benefit of your suggestion, so thank you for raising it. On the other hand, we think that this task should be handled at application level, rather than in the component library.

We will leave the item for community review and voting, and revisit it in the future.

Regards,
Dimo
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.