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

Icon not centering in Angular Material #65

Open
essesse opened this issue Aug 3, 2016 · 1 comment
Open

Icon not centering in Angular Material #65

essesse opened this issue Aug 3, 2016 · 1 comment
Assignees

Comments

@essesse
Copy link

essesse commented Aug 3, 2016

When setting the size of an icon it was not being centered in an element when it should have been (using layout-align="center center"). Setting the icon size to "48" produced an icon with the correct size, but the parent ng-md-icon element still had css properties (height/width) set to 24px.

A potential solution is as follows around line 38:

// size
if (attr.size !== undefined) {
size = attr.size;
}

changes to:

// size
if (attr.size !== undefined) {
size = attr.size;
element.css('height', size + 'px');
element.css('width', size + 'px);
}

This inlined the css styles and fixed the issue.

Cheers

Simon

@urmilparikh
Copy link
Contributor

That's a good idea, @essesse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants