klarsys / klarsys/angular-material-icons

Icon not centering in Angular Material

Open
#65 1 comment 0 reactions 1 assignee Claimed by @urmilparikh View on GitHub
enhancement
Dominant language
HTML
Stars
553
Forks
148
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.