Skip to content

feat(icon): add input for inline styling of icons #9984

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 1 commit into from
Mar 9, 2018

Conversation

josephperrott
Copy link
Member

@josephperrott josephperrott commented Feb 16, 2018

Fixes #9742

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Feb 16, 2018
},
encapsulation: ViewEncapsulation.None,
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class MatIcon extends _MatIconMixinBase implements OnChanges, OnInit, CanColor {

/** Whether the icon should be inline. */
Copy link
Member

Choose a reason for hiding this comment

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

Expand comment to explain what "inline" means?

set inline(inline: boolean) {
this._inline = coerceBooleanProperty(inline);
}
private _inline: boolean = false;
Copy link
Member

Choose a reason for hiding this comment

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

Would be good to have one unit test that uses this.

@@ -10,6 +10,13 @@ $mat-icon-size: 24px !default;
fill: currentColor;
height: $mat-icon-size;
width: $mat-icon-size;

&.mat-icon-inline {
font-size: inherit;
Copy link
Member

Choose a reason for hiding this comment

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

Does IE11 support inherit? Any reason for not using 1em?

Copy link
Contributor

Choose a reason for hiding this comment

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

FYI: inherit is supported since IE8.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I was thinking of initial

Copy link
Member Author

Choose a reason for hiding this comment

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

We could use 1em instead of inherit if you would like, I don't have a super strong preference at this point.

Copy link
Member

Choose a reason for hiding this comment

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

inherit should be fine, I mixed up the IE support in my head

import { MatIconModule } from './index';
import { MatIconRegistry, getMatIconNoHttpProviderError } from './icon-registry';
import { FAKE_SVGS } from './fake-svgs';
import { wrappedErrorMessage } from '@angular/cdk/testing';
Copy link
Member

Choose a reason for hiding this comment

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

Looks like your IDE added some spaces here and elsewhere. WebStorm lets you configure this, not sure about Code.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

FYI I don't always get an email if you just push a commit. Adding a comment after addressing comments will do a better job making sure I see it.

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker target: major This PR is targeted for the next major release labels Mar 7, 2018
@jelbourn jelbourn merged commit be1fc08 into angular:master Mar 9, 2018
@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 8, 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 target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(icon): create convenience input/attribute for inlining icons into text areas
4 participants