Skip to content
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

Is there a way to use both the Solid and Regular form of an icon? #1

Open
coredumperror opened this issue Jan 12, 2022 · 1 comment

Comments

@coredumperror
Copy link

I've been busily converting my Wagtail site from wagtail-fontawesome to wagtail-font-awesome-svg, to make it work with Wagtail 2.15, but I've just run into an issue I'm not sure how to resolve. Our existing site uses the Solid and Regular versions of the "user" icon, and I don't see any obvious way to register and use both of them.

The system appears to use the final part of the .svg file's name as the "name" for the icon, and both of these "user" icons are named user.svg. They're just in different folders, which doesn't seem to be addressable in the icon_name or icon settings for menus/blocks.

What can I do?

@allcaps
Copy link
Collaborator

allcaps commented Oct 28, 2022

@coredumperror Sorry, I've missed your query. AFAIK the icons are referenced by id.

So, you might copy one of the two icons into your own project template folder, and make the id unique.

<symbol id="icon-user" viewbox="0 0 448 512"> -> <symbol id="icon-user-solid" viewbox="0 0 448 512">

@hooks.register("register_icons")
def register_icons(icons):
    return icons + [
        'wagtailfontawesomesvg/regular/user.svg',
        'path/to/app/user.svg',
        ...
    ]

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

No branches or pull requests

2 participants