Skip to content

Icon not centering in Angular Material #65

@essesse

Description

@essesse

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions