If you take a step back and think about the 'cascade' in Cascading Style Sheets, you can forget "I know that font awesome will normally inherit the anchor color. However..." and just write your rules regardless of Angular or font-awesome. If some include rule is annoying... delete it.
I'm not sure what version of Angular you are using - or really how it works these days... but in a few of the 5+ versions - it was suggested that you keep the href
in there - but with no value. <a href class='button'>...
- so, check that as a possibility. Something here might help: Valid to use <a> (anchor tag) without href attribute?
JSfiddle
https://jsfiddle.net/sheriffderek/kzrnq7Ly/22/
Markup
<p>A <a href><span>standardd link</span></a> in a paragraph.</p>
<!-- example component that might use icons -->
<nav class="social-networks">
<ul class="network-list">
<li class="network name">
<a href class="link">
<i class="fa fa-pencil"></i>
</a>
</li>
<li class="network name">
<a href class="link">
<i class="fa fa-trash"></i>
</a>
</li>
<li class="network name">
<a href class="link">
<i class="fa fa-align-justify"></i>
</a>
</li>
</ul>
</nav>
Styles
/* general setup */
a {
display: block;/* big touchable areas */
text-decoration: none;
color: inherit;
}
a:hover {
cursor: pointer;
}
ul { /* probably already in your 'reset' */
margin: 0;
padding: 0;
list-style: none;
}
p a {
display: inline-block;
text-decoration: underline;
color: darkgray;
}
p a:hover {
color: red;
}
/* 3rd party setup */
.fas {
color: inherit;
/* this is what you probably want */
/* or you have some conflicting rules */
font-size: 30px; /* a default? nope... doesn't work */
}
/* specific component */
.social-networks .network-list {
display: flex;
flex-direction: row;
color: lightblue;
transform: translate(-1rem, 0)
}
.social-networks .link {
font-size: 30px;
padding: 1rem; /* lots of space for fingers */
transition: .5s;
}
.social-networks .link:hover {
color: red;
transition: 0s;
}
The bigger question is if an in-singlepageapp "link" should even be an anchor tag in the first place...