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

Styles not applied on iOS #106

Open
ihor-zinchenko opened this issue Jul 10, 2020 · 5 comments
Open

Styles not applied on iOS #106

ihor-zinchenko opened this issue Jul 10, 2020 · 5 comments

Comments

@ihor-zinchenko
Copy link

<svg-icon
  src="/assets/img/logo.svg"
  class="header__logo-img"
  svgClass="svg-icon"
  [viewBox]="'auto'"
  [ngClass]="{
    'white': isDarkMode && !isOpenMenu
  }"
></svg-icon>
.header__logo-img {
      path {
        transition: all .3s;
      }

      &.white {
        path.white {
          fill: #fff;
        }
      }

      &:not(.white) {
        path.dark {
          fill: #42474C;
        }
      }
    }

on iOS (chrome, safari) styles not applied
On the Android and windows works correctly

@czeckd
Copy link
Owner

czeckd commented Jul 10, 2020

Could you provide a sample SVG to replicate this and what do you have defined as the svg-icon class? Thanks.

@ihor-zinchenko
Copy link
Author

ihor-zinchenko commented Jul 13, 2020

@czeckd try that https://dropmefiles.com/MzSmN, thanks)

@czeckd
Copy link
Owner

czeckd commented Jul 13, 2020

I'm not able to reproduce this: I see the d in the example.svg toggle between white and black on iOS browsers. Is this the expected behavior?

I do not have any styling in the svg-icon class though. Maybe that is part of the issue?

@setianke
Copy link

setianke commented Feb 25, 2021

@czeckd @ihor-zinchenko

I was facing the same issue and tested a lot, the issue is caused by the view encapsulation, for me a quick work around was adding ::ng-deep before my css class/selector like ::ng-deep .svg-class the issue only occurs when the styles for the class is inside a view encapsulated component. Maybe the view encapsulation strategy for the svg-icon component could be changed but I am not sure about the issues that could cause.

@czeckd thank you for this great library and your open source work, appreciated

@czeckd
Copy link
Owner

czeckd commented Feb 25, 2021

@setianke - You are welcome and thank you for diving deep into this. Any ideas on how you'd change the view encapsulation. My first thought is that it might introduce more issues.

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

3 participants