This is a migrated thread and some comments may be shown as answers.

Generic color class according to theme

2 Answers 65 Views
Button
This is a migrated thread and some comments may be shown as answers.
Olivier
Top achievements
Rank 1
Iron
Olivier asked on 19 Nov 2020, 04:33 PM

Hi there,

I worked with other frameworks in the past (bootstrap, PrimeNG, Vuetify...), and everytime there was a possibility to apply a class to button like class="btn-error". After digging documentation, I can't see such option with kendo-ui angular.

You may say I could apply style on buttons, but I would have preffer a class reffering directly to theme, in order to keep consitency when we will send our app to a webdesigner.

The question is : am I missing something in the docs ? Or is this not supported ATM ?

Thank you !

2 Answers, 1 is accepted

Sort by
0
Martin Bechev
Telerik team
answered on 23 Nov 2020, 08:03 AM

Hi Olivier,

Kendo Angular Button component uses the generic button element as a base and adds some additional kendo specific functionalities through the kendoButton directive. To apply any custom CSS code,  use class attribute, or ngClass Angular directive:

   <button kendoButton (click)="onButtonClick()" class="custom-class">Browse</button>
   <button kendoButton (click)="onButtonClick()" [ngClass]={'custom-class:true'}">Browse</button>

To style DropDownListButton, or SplitButton, use buttonClass option to customize the main button, and popupClass (property supported in popupSettings)  to specify a list of CSS classes that are used to style the popup:

<kendo-dropdownbutton [data]="data" [popuSettings]={popupClass: 'custom-class'}>
   User Settings
 </kendo-dropdownbutton>

I hope this helps.

Regards,
Martin
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/.

0
Olivier
Top achievements
Rank 1
Iron
answered on 23 Nov 2020, 08:46 AM

Hi. Thanks for reply. I was aware of this, just wondering if built-in classes were already included, especially with Material base theme, as it usually is in other frameworks.

I'll create my own classes then.

Thank you :).

Tags
Button
Asked by
Olivier
Top achievements
Rank 1
Iron
Answers by
Martin Bechev
Telerik team
Olivier
Top achievements
Rank 1
Iron
Share this question
or