igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

Change CSS Style of Grid Buttons

Open brookhutchinson opened this issue 7 years ago • 5 comments

Question

How do I change the CSS styling for each of the grid buttons that display (top right) of grid?

I would like to change the css styling of each button from "flat" to "raised", the background color and text color of each button, and maybe the size of each button.

Examples Column Pinning Button Column Hiding Button Export to Excel Button

  • igniteui-angular version: 8.0.0
  • browser: Google Chrome

brookhutchinson avatar Jun 27 '19 13:06 brookhutchinson

@rmkrmk This is not related to styling, rather, the question asks how do 'we' change the encapsulated button type from 'raised' to 'flat'.

simeonoff avatar Jun 28 '19 13:06 simeonoff

Actually the question is also about changing size, background and text color.

gedinakova avatar Jun 28 '19 13:06 gedinakova

@brookhutchinson, currently the IgxGrid and the toolbar does not support altering of the directives (or their parameters) applied to the toolbar buttons (i.e. it is not be possible to change the buttons from flat to raised).

rmkrmk avatar Jun 28 '19 14:06 rmkrmk

@brookhutchinson When it comes to styling the encapsulated buttons, you can always use the igx-button-theme mixin.

In your component styles file, do something like:

$toolbar-btn: igx-button-theme(
    $raised-resting-shadow: none,
    $raised-hover-shadow: none,
    $raised-focused-shadow: none,
    $raised-background: transparent
);

:host::ng-deep {
    @include igx-button($toolbar-btn);
}

This should pretty much make the raised button similar in styles to the flat one.

There are plenty more theme properties on the raised button you can change to make it just how you want. Take a look at the documentation.

simeonoff avatar Jun 29 '19 08:06 simeonoff

@rmkrmk I think it's useful if we expose the button types as inputs.

kdinev avatar Jul 04 '19 07:07 kdinev