Skip to content

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

Merged
merged 3 commits into from
Jun 7, 2017

Conversation

devversion
Copy link
Member

@devversion devversion commented May 20, 2017

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. The isBrowser 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:

image

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 20, 2017
@jelbourn
Copy link
Member

@devversion change looks good, not sure what you mean by the _hasAttributeWithPrefix / isBrowser stuff, though. That isBrowser check is specific there so that Universal does work.

@devversion
Copy link
Member Author

@jelbourn I thought that if someone renders a fab button on the server the _hasAttributeWithPrefix will always return false (due to the isBrowser check) and therefore the fab will not get the accent color by default.

@jelbourn
Copy link
Member

Oh yeah, that would be a problem. When I added the isBrowser check, the only thing that this was used for only dealt with styles for user interaction.

@devversion
Copy link
Member Author

devversion commented May 22, 2017

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?

@jelbourn
Copy link
Member

I think that alternate approach would be necessary

@devversion devversion force-pushed the refactor/round-button-color branch from 7d59dc5 to 4f32240 Compare May 23, 2017 19:20
@devversion
Copy link
Member Author

@jelbourn Done. This should be the "Angular"-way of ensuring that it works with Universal.

Copy link
Contributor

@tinayuangao tinayuangao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@devversion devversion added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels May 31, 2017
@@ -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) {
Copy link
Contributor

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.

@andrewseguin andrewseguin removed the action: merge The PR is ready for merge by the caretaker label Jun 7, 2017
* No longer creates extra CSS selectors to set the default color for round buttons to `accent`.
@devversion devversion force-pushed the refactor/round-button-color branch from 4f32240 to 09eac85 Compare June 7, 2017 20:56
@devversion
Copy link
Member Author

@andrewseguin Done.

@devversion devversion added the action: merge The PR is ready for merge by the caretaker label Jun 7, 2017
@andrewseguin andrewseguin merged commit 37df5d3 into angular:master Jun 7, 2017
@devversion devversion deleted the refactor/round-button-color branch November 11, 2017 10:23
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants