Skip to content

Commit 7d59dc5

Browse files
committed
refactor(button): use color binding for fab button color
* No longer creates extra CSS selectors to set the default color for round buttons to `accent`.
1 parent c946631 commit 7d59dc5

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

src/lib/button/_button-theme.scss

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -103,18 +103,6 @@
103103
.mat-icon-button {
104104
@include _mat-button-ripple-color($theme, default);
105105
}
106-
107-
// TODO(devversion): The color class accent should be just set from TS code. No need for this.
108-
.mat-fab, .mat-mini-fab {
109-
background-color: mat-color($accent);
110-
color: mat-color($accent, default-contrast);
111-
112-
// Button fab elements are using the accent palette by default. The color classes won't
113-
// be set on the element. To have a proper ripple color for those, we set the ripple color.
114-
.mat-ripple-element {
115-
background-color: mat-color($accent, default-contrast, 0.2);
116-
}
117-
}
118106
}
119107

120108

src/lib/button/button.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ export class MdButton extends _MdButtonMixinBase implements OnDestroy, CanDisabl
117117
private _focusOriginMonitor: FocusOriginMonitor) {
118118
super();
119119
this._focusOriginMonitor.monitor(this._elementRef.nativeElement, this._renderer, true);
120+
121+
if (this._isRoundButton) {
122+
this.color = 'accent';
123+
}
120124
}
121125

122126
ngOnDestroy() {

0 commit comments

Comments
 (0)