This question has been asked before in this post. But I don't think its still working with the new font-awesome because they use svg
and path
elements.
This question is about having a border around the icon, instead of having it around the outer circle.
Some of the solutions found that I tried, but did not work:
.fa-female, .fa-music{
color: #BBB;
}
.fa-female{
-webkit-text-fill-color: #BBB;
-webkit-text-stroke-width: 1px;
-webkit-text-stroke:4px #00FF00;
}
.fa-music{
text-shadow: 0px 0px 3px #00FF00;
}
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
<!-- Female Icon -->
<span class="fa-layers fa-fw fa-8x" style="color: rgb(190, 53, 48)">
<i class="fas fa-circle"></i>
<i class="fas fa-female fa-inverse" data-fa-transform="shrink-6 fa-border"></i>
</span>
<!-- Music Icon -->
<span class="fa-layers fa-fw fa-8x" style="color: rgb(190, 53, 48)">
<i class="fas fa-circle"></i>
<i class="fas fa-music fa-inverse" data-fa-transform="shrink-8 fa-border"></i>
</span>
<i class="fas fa-music fa-inverse fa-5x" style="color: black;"></i>
Edit: Solution that worked in a codesnippet
Solution by reiallenramos
.fa-music g g path {
stroke: black;
stroke-width: 10;
}
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
<!-- Music Icon -->
<span class="fa-layers fa-fw fa-8x" style="color: rgb(190, 53, 48)">
<i class="fas fa-circle"></i>
<i class="fas fa-music fa-inverse" data-fa-transform="shrink-8 fa-border"></i>
</span>
To increase fa-border-all font awesome icon size, use the fa-lg (33% increase), fa-2x, fa-3x, fa-4x, or fa-5x classes along with icon class fa-border-all.
I had to dissect the internals of font-awesome.
.fa-music g g path {
stroke: black;
stroke-width: 10;
}
The new FontAwesome way would be layers: https://fontawesome.com/how-to-use/svg-with-js#layering
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
<span class="fa-layers fa-fw fa-5x">
<i class="fas fa-circle" style="color:black"></i>
<i class="fas fa-circle" data-fa-transform="shrink-3" style="color:Tomato"></i>
<i class="fa-inverse fas fa-female" data-fa-transform="shrink-6"></i>
</span>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With