Skip to content

Can't apply color to custom icons #402

@aoor9

Description

@aoor9

I'm using icons library on Nuxt UI (still I don't know whose issue this is) for my Nuxt project which uses Tailwind v4 , and I set up some custom icons through a JSON file:

{
    "icons": {
        "arrow-small-right": {
            "body": "<path fill=\"currentColor\" d=...
        },
        "auction": {
            "body": "<path fill=\"currentColor\" d=...
        },
...
    }
}
// nuxt.config.ts

import customIcons from './icons.json' with { type: 'json' };

...

 icon: {
        customCollections: [{
            prefix: 'custom',
            icons: customIcons.icons,
            width: 512,
            height: 512,
        }],
    }

They can be imported, however when I try to change their color like text-white or fill-white, it doesn't work.

What I noticed is that icons imported from Iconify have important css rules such as mask-*, while mine don't.
So how am I supposed to inject these rules inside them, if there is a way?

p.s. sorry for creating my issue without completing it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions