-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Conversation
src/lib/icon/icon.ts
Outdated
}, | ||
encapsulation: ViewEncapsulation.None, | ||
preserveWhitespaces: false, | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class MatIcon extends _MatIconMixinBase implements OnChanges, OnInit, CanColor { | ||
|
||
/** Whether the icon should be inline. */ |
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.
Expand comment to explain what "inline" means?
set inline(inline: boolean) { | ||
this._inline = coerceBooleanProperty(inline); | ||
} | ||
private _inline: boolean = false; |
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.
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; |
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.
Does IE11 support inherit
? Any reason for not using 1em
?
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.
FYI: inherit
is supported since IE8.
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.
Ah, I was thinking of initial
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.
We could use 1em
instead of inherit
if you would like, I don't have a super strong preference at this point.
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.
inherit
should be fine, I mixed up the IE support in my head
8c53470
to
0f25d65
Compare
src/lib/icon/icon.spec.ts
Outdated
import { MatIconModule } from './index'; | ||
import { MatIconRegistry, getMatIconNoHttpProviderError } from './icon-registry'; | ||
import { FAKE_SVGS } from './fake-svgs'; | ||
import { wrappedErrorMessage } from '@angular/cdk/testing'; |
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.
Looks like your IDE added some spaces here and elsewhere. WebStorm lets you configure this, not sure about Code.
0f25d65
to
7e22481
Compare
99cbd17
to
95799c1
Compare
95799c1
to
818ac4d
Compare
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
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.
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. |
Fixes #9742