Skip to content

detect if icon is from the brands package #17419

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

Open
wants to merge 2 commits into
base: 5.x
Choose a base branch
from

Conversation

i-just
Copy link
Contributor

@i-just i-just commented Jun 10, 2025

Description

This PR adds a mechanism for detecting whether the selected icon is from the “brands” package.

When displaying icons from the Icon field, you need to specify the correct classes for the icon, or it will not display as expected.

For example, to display a standard “angle right” icon, you can use:

<i class="fa-solid fa-angle-right"></i> 

To display a “bluesky” icon, you should use:

<i class="fa-brands fa-bluesky"></i> 

Providing both fa-solid and fa-brands will only work in a limited number of cases.

This PR adds a mechanism for checking whether the selected icon is from the “brands” package.

To test whether the selected icon is from the “brands” package, you can use the following

<i class="{{ brandsIcon(entry.myIconField) ? 'fa-brands' : 'fa-solid' }} fa-{{ entry.myIconField }}"></i>

Related issues

#17402

@i-just i-just requested a review from brandonkelly June 10, 2025 12:41
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

Successfully merging this pull request may close these issues.

1 participant