-
Notifications
You must be signed in to change notification settings - Fork 153
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
Feature request: inset gradients! #173
Comments
As discussed in the linked issue it is not possible to use CSS gradients with SVG icons, so you'll have to use SVG gradients instead. The solution described in FortAwesome/Font-Awesome#11925 (comment) should work with fa-icon ::ng-deep svg * {
fill: url(#lgrad);
} As for the nicer API I'm not sure:
Having said that I would like to hear more ideas and feedback on this feature request. |
Have you considered using a mask to accomplish this,? Here's a codepen I through together using a rainbow gradient for the apple icon. |
Only if this was such easy. @seanreiser this is the angular component. Here is an exemple with your solution: |
Nice solution @devoto13 ! https://stackblitz.com/edit/fontawesome-angular-gradient-background-fix-173 This could be documented somewhere? |
The only problem with this solution is that you can't have a transparent mask... I consider this should not be an end solution. |
Sure. Was thinking to introduce a Recipes section in the documentation to include docs on how to implement common things. I'll take a look at it, when I have time.
Can you provide an example of what is "transparent mask"? Something like this? |
Is it possible to disable SVG rendering with angular-fontawesome? Something like this would be perfect
WorkaroundAs this issue is open for 5+ years, I have have no hopes for a proper solution any time soon. If you need to apply a gradient to Also for some reason, the icon is clipped. .status-production {
background: radial-gradient(at 80% 72%, rgba(0, 200, 81, 1.0) 0%, rgba(0, 200, 81, 1.0) 30%, #4285F4 33%, #7DACF5 100%);
color: var(--cui-body-bg); /* Dynamic bg-color for light and dark mode */
display: inline-block;
} <fa-icon
[mask]="['fas', 'square-full']"
[icon]="['fas', 'plug-circle-check']"
[size]="'4x'"
class="status-production"></fa-icon> My solution for this is, to import Font Awesome globally in
This enables the option to use Font Awsome as a web font and solves the gradient issue and I can also use the icons in third party libraries through the unicode value. Also no clipping. .status-production {
background-image: radial-gradient(at 80% 72%, rgba(0, 200, 81, 1.0) 0%, rgba(0, 200, 81, 1.0) 30%, #4285F4 33%, #7DACF5 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
} <i class="fas fa-plug-circle-check fa-4x status-production"></i> |
Describe the problem you'd like to see solved or task you'd like to see made easier
A way to apply inset gradients on icons.
Is this in relation to an existing part of angular-fontawesome or something new?
This is new for angular-fontawesome but not for Font-Awesome as described here:
FortAwesome/Font-Awesome#11925
What is 1 thing that we can do when building this feature that will guarantee that it is awesome?
Make it easy to use 🌟
Why would other angular-fontawesome users care about this?
Because gradients are beautiful ✨
On a scale of 1 (sometime in the future) to 10 (absolutely right now), how soon would you recommend we make this feature?
6 - This feature was easy to implement with the oldest version...
Thank you for your precious work!
The text was updated successfully, but these errors were encountered: