-
Notifications
You must be signed in to change notification settings - Fork 6.8k
refactor(button): use color binding for fab button color #4694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(button): use color binding for fab button color #4694
Conversation
@devversion change looks good, not sure what you mean by the |
@jelbourn I thought that if someone renders a |
Oh yeah, that would be a problem. When I added the |
Yeah with that it was totally reasonable to just skip in non-browser environments. What do you think about the other approach I added to the PR description? |
I think that alternate approach would be necessary |
7d59dc5
to
4f32240
Compare
@jelbourn Done. This should be the "Angular"-way of ensuring that it works with Universal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
src/lib/button/button.ts
Outdated
@@ -57,17 +62,28 @@ export class MdIconButtonCssMatStyler {} | |||
selector: 'button[md-fab], button[mat-fab], a[md-fab], a[mat-fab]', | |||
host: {'class': 'mat-fab'} | |||
}) | |||
export class MdFabCssMatStyler {} | |||
export class MdFab { | |||
constructor(@Self() @Optional() button: MdButton, @Self() @Optional() anchor: MdAnchor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here and in MdMiniFab, looks like we want to use forwardRef
since those components are defined further down the file. This caused problems internally, surprised our tests didn't have trouble with them.
* No longer creates extra CSS selectors to set the default color for round buttons to `accent`.
4f32240
to
09eac85
Compare
@andrewseguin Done. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No longer creates extra CSS selectors to set the default color for round buttons to
accent
.@tinayuangao @jelbourn This needs some confirmation in regards to the
_hasAttributeWithPrefix
method. TheisBrowser
check in that method doesn't seem to be a good solution for Universal?Another possible approach
To be sure that this works in Univeral we can also do it the following way: