blazor telerik custom theme

4 posts, 1 answers
  1. khashayar
    khashayar avatar
    13 posts
    Member since:
    Sep 2019

    Posted 16 Oct Link to this post

    hi, i was wondering to know if there is a way to give custom style to each telerik component individually i have already tried using class and id but some of components do not accept class or id i also  tried this https://themebuilder.telerik.com/blazor-ui but unfortunately  there is a very big problem with colors and sometimes they don't match and will result in an awkward component which most parts has same color 
  2. Answer
    Marin Bratanov
    Admin
    Marin Bratanov avatar
    4889 posts

    Posted 17 Oct Link to this post

    Hello,

    The concept of our themes is that components always match each other, and to that end the themes use shared "components" that have the same classes and styling - for example headers, titlebars, buttons, etc.

    The theme builder operates by using a few base variables and extracts further colors from them. It is up to you to choose the initial colors and you can preview the results on the right hand side. You can then manually tweak things for better precision.

    If you want to implement tweaks per control, you can inspect the rendered HTML and see the available classes. Usually the component wrapping element has a class like k-treeview (for the treeview, for example) that you can cascade through. Most components have a Class attribute and if some doesn't, you can always cascade through a parent class from your layout.

    If you start implementing CSS overrides per component, you may find the following useful:

    Regards,
    Marin Bratanov
    Progress Telerik

     UI for Blazor
  3. khashayar
    khashayar avatar
    13 posts
    Member since:
    Sep 2019

    Posted 17 Oct in reply to Marin Bratanov Link to this post

    thank you for your answer but i wanna know if inspecting an element to copy and use its class in code is  a correct way or not i have always felt this is an awkward way to style an element  

  4. Marin Bratanov
    Admin
    Marin Bratanov avatar
    4889 posts

    Posted 17 Oct Link to this post

    Hi,

    Inspecting the elements and creating CSS rules that override our built-in appearance is the correct approach for small tweaks or per-instance alterations.

    For changing the overall look of all the components, I recommend creating a custom theme. You can still add tweaks to it.

     

    Regards,
    Marin Bratanov
    Progress Telerik

     UI for Blazor
Back to Top