Even after upgrading to IgniteUI for Angular 12.0.5 I've been unable to make a custom button theme work with the usual igx-css-vars approach, neither in Firefox or Chrome. The alternative, not recommended mixin-based (igx-button) solution for IE11 works ok, however.
You can check it by modifying the basic angular button example in the doc with the custom theme supplied at the styling section. I've done it in this code sandbox.
Hello Alfred,Thank you for posting in our community.What I can suggest for achieving your requirement is to set $igx-legacy-support variable, which allows you to produce styles for ever-green and old browsers, to false:
src/_variables.scss
$legacy-support: false;
Then, you should import your custom styles in src/styles.scss::root { @include igx-palette-vars($palette); @include igx-css-vars($custom-button-theme); }
:root { @include igx-palette-vars($palette); @include igx-css-vars($custom-button-theme); }
You can also style only a specific component as in the following example:
$custom-button-theme: igx-button-theme( $foreground: #fdfdfd, $hover-foreground: #fdfdfd, $background: #345779, $hover-background: #2e4d6b, $focus-foreground: #fdfdfd, $focus-background: #2e4d6b, $disabled-foreground: #bbb ); :host { @include igx-css-vars($custom-button-theme); }I created a small sample illustrating my approach, which you can find here. Please test it on your side and let me know wether you find it helpful.Please let me know if you have any further questions and concerns.Regards,Viktor KombovEntry Level Software DeveloperInfragistics, Inc.
$custom-button-theme: igx-button-theme( $foreground: #fdfdfd, $hover-foreground: #fdfdfd, $background: #345779, $hover-background: #2e4d6b, $focus-foreground: #fdfdfd, $focus-background: #2e4d6b, $disabled-foreground: #bbb ); :host { @include igx-css-vars($custom-button-theme); }