0

I am getting the following style in my Chrome browser developer inspector

.footer-content__nav[_ngcontent-ema-c214] li[_ngcontent-ema-c214] a[_ngcontent-ema-c214] {
    color: #fff;
    text-decoration: none;
}

This style is set elsewhere in my application however I just need to change the style color for a specific component so I do not want to change it on the global component.

Here is the global component

TS

selector: 'app-page-footer',

CSS

.footer-content__nav {

      li {
        padding: 0 10px;
    
        a {
          color: $white;
          text-decoration: none;
          &:hover,
          &:focus {
            color: $dark;
          }      
        }
    
      }
    }

HTML

<ul class="footer-content__nav">
  <li>
    <a>...
    </a>
  </li>
</ul>

Here is my local component

CSS

.footer-content__nav {

  li {
    padding: 0 10px;

    a {
      color: $dark;
      text-decoration: none;
      &:hover,
      &:focus {
        color: $dark;
      }      
    }

  }
}

HTML

<app-page-footer></app-page-footer>

Is there a way I can achieve this? Right now my local style doesn't even show up in the Chrome dev tools styles.

1
  • I’m not sure if I understand you correctly, but in case I do, you might want to look into ::ng-deep Commented Mar 23, 2022 at 20:10

1 Answer 1

1

The global CSS style will always override the local one, so I think you could just delete either one depending on the color you want

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.