Skip to content
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

Add support for color attribute to radio #4039

Closed
wants to merge 6 commits into from

Conversation

rtrompier
Copy link

I have added an Input COLOR to allow tu user to choose the color like the checkbox component.
The color can be primary, accent, or warn.

screen shot 2017-04-11 at 21 40 13

screen shot 2017-04-11 at 21 40 23

screen shot 2017-04-11 at 21 40 30

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Apr 11, 2017
.mat-radio-ripple .mat-ripple-element {
background-color: mat-color($warn, 0.26);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

I have the feeling that we could move that into a mixin? So we don't have to repeat code three times.

Copy link
Author

Choose a reason for hiding this comment

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

Yes sure ;)
I will create a mixin, you're right.

@rtrompier
Copy link
Author

@devversion Added mixin & Default color (accent)

@jelbourn
Copy link
Member

@rtrompier could you rebase this PR?

@rtrompier
Copy link
Author

rtrompier commented May 20, 2017

@jelbourn Should be good ;)

border-color: mat-color($foreground, secondary-text);
}
.mat-radio-button {
//default color (accent)
Copy link
Member

Choose a reason for hiding this comment

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

Our indentation is +2, not +4

}
.mat-radio-button {
//default color (accent)
&:not(.mat-primary):not(.mat-accent):not(.mat-warn) {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this :not expression should be necessary; the radio should just have accent be the default color.

.mat-radio-ripple .mat-ripple-element {
background-color: mat-color($accent, 0.26);
}
@mixin radio-theme-color($color, $foreground) {
Copy link
Member

Choose a reason for hiding this comment

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

This mixin is going to generate a lot of css output; only styles that are directly affected by the palette swap should be defined within.

@@ -396,6 +406,9 @@ export class MdRadioButton implements OnInit, AfterViewInit, OnDestroy {
/** Whether the ripple effect on click should be disabled. */
private _disableRipple: boolean;

/** Current color. Can be `primary`, `accent`, or `warn`. */
private _color: string;
Copy link
Member

Choose a reason for hiding this comment

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

The type should use the string literal values

private _color: 'primary' | 'accent' | 'warn';

Choose a reason for hiding this comment

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

Is there any way to use straight color values like for example #00FF00 or rgb(255,100,0) from HTML ?

@devversion
Copy link
Member

@rtrompier Thanks for your work on this PR. It looks like your PR is no longer up-to-date and there isn't any activity here.

I'm going to address the color binding for radios in #5068

@devversion devversion closed this Jun 11, 2017
@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 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
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