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

setting the stroke color #784

Closed
noorbakerally opened this issue Feb 18, 2020 · 11 comments
Closed

setting the stroke color #784

noorbakerally opened this issue Feb 18, 2020 · 11 comments

Comments

@noorbakerally
Copy link

I am using the icon people-outline using the HTML:
<ion-icon name="people-outline" class="overviewIcon" style="color: blue;"></ion-icon>

The color remains black even with the style. How can I change the border color or the fill color of the icon ?

@andreas-aeschlimann
Copy link

andreas-aeschlimann commented Feb 19, 2020

I can confirm this issue in my Angular project.

Looks like it's different for every icon. For example, menu-sharp does change to white by css while menu doesn't?

@allanevargas
Copy link

allanevargas commented Feb 21, 2020

I can also confirm that I am having this issue in my ionic application project.

<script src="https://unpkg.com/ionicons@5.0.0/dist/ionicons.js"></script>

Some icons seem to work fine but I noticed it when an icon was missing from a page and it turns out that icon had been deleted/renamed so I picked a similar icon to replace it with, attaching the same class to it.

<ion-icon class="arrow" name="chevron-back"></ion-icon>

ion-icon.arrow {
    color: var(--ion-color-default) !important;
    vertical-align: middle;
}

The class above does not seem to work. I even replaced the variable to just the colour red and that did nothing.

It's odd that some icons work as normal and that it was also working before I started using the new version. Would really appreciate a fix on this ASAP.

@andreas-aeschlimann
Copy link

Yep...

This issue is probably a duplicate of #778. You can use the CSS property filter to invert the color to white, at least.

@streamliner18
Copy link

Need developer attention on this!! Seems like many SVG icons have hard-coded stroke colors which is really annoying..

@zenorocha
Copy link

Same here, I can't use it because of this :(

@peterpeterparker
Copy link
Contributor

peterpeterparker commented Mar 15, 2020

The problem is the following I think: most outline icons have path defined with fixed stroke:#000;, therefore they are always rendered black.

These should probably be modified with stroke:currentColor;, if I'm not wrong.

I've provided a PR #805 to fix this issue.

@boradakash
Copy link

Agree with @peterpeterparker . There are few icons with stroke:#000 because of which the style on ion-icon is not working.

@hades200082
Copy link

#817 also references this

@Perdixo75
Copy link

Try this :

[ionicons] Deprecated script, please remove: <script src="https://unpkg.com/ionicons@5.1.2/dist/ionicons.js"></script>
To improve performance it is recommended to set the differential scripts in the head as follows:
<script type="module" src="https://unpkg.com/ionicons@5.1.2/dist/ionicons/ionicons.esm.js"></script>
<script nomodule="" src="https://unpkg.com/ionicons@5.1.2/dist/ionicons/ionicons.js"></script>

@aPixelInSpace
Copy link

Thank you Perdixo75. That fixed the issue for me.

@webdevreza
Copy link

thanks Perdixo75. It works

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

No branches or pull requests