Skip to content

fix(icon): allow svg stroke to be passed in - #643

Closed
btsiders wants to merge 2 commits into
ionic-team:masterfrom
btsiders:patch-1
Closed

btsiders wants to merge 2 commits into
ionic-team:masterfrom
btsiders:patch-1

Conversation

@btsiders

@btsiders btsiders commented Dec 6, 2018

Copy link
Copy Markdown

Related to ionic-team/ionic-framework#16483.

@brane53 asked that the stroke not be set at all, but I think setting it via a CSS var gives the most flexibility.

@ZachMoreno

Copy link
Copy Markdown

+1

@TomBourretViv

Copy link
Copy Markdown

Is there any news for this pull request ? I didn't find any solution to remove the default 'stroke' on my custom icons...

@patr0cl0

patr0cl0 commented Apr 4, 2019

Copy link
Copy Markdown

I haven't find a way to remove the magic stroke as well. Would be cool if someone could look around at this PR please.

@btsiders

btsiders commented Apr 4, 2019

Copy link
Copy Markdown
Author

I have no idea what happened to the code since the initial PR, but I have fixed it back up to not have any conflicts again.

@anagstef

Copy link
Copy Markdown

The way @btsiders implemented this does not introduce any breaking changes, but being able to turn stroke off is much needed. I think it should be merged.

@steebchen

Copy link
Copy Markdown

Can somebody please merge this? This is a must have for custom icons as it seems most of them are displayed incorrectly.

@anagstef

anagstef commented May 6, 2019

Copy link
Copy Markdown

@brandyscarney @liamdebeasi hey, i'm tagging you, cause maybe you have missed this Pull Request. It's a really important fix for custom icons. :)

@brandyscarney

brandyscarney commented May 14, 2019 •

Copy link
Copy Markdown
Member

Thanks so much for the PR! I fixed this a little different, in the PR here: #688

Basically I removed stroke entirely since it shouldn't be there even for ionicons, and moved the fill to the host element which allows developers to override them without any CSS variables:

ion-icon {
  stroke: blue;
  fill: red;
}

I've released a dev build for this in Ionic, see my comment here: ionic-team/ionic-framework#16483 (comment)

Please comment on that issue if you see any problems, thanks again!!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants