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

Options suggestion #8

Open
mm-tom opened this issue Feb 25, 2016 · 3 comments
Open

Options suggestion #8

mm-tom opened this issue Feb 25, 2016 · 3 comments

Comments

@mm-tom
Copy link

mm-tom commented Feb 25, 2016

You mention suggestions for options are welcome, so here goes...

It would be really handy to be able to pass in a set of attributes to apply to the svg node.

In my instance, I'd like to be able to set the id and also perhaps store some other information in arbitrary attributes.

@nfroidure
Copy link
Owner

You mean adding attributes to the outputted SVG iconsfrom font glyphs ?

If so, an option like option.attributesMapproviding a an objet to map source SVG font glyphs attributes to the corresponding SVG icon element could make the job.

Something like:

svgfont2svgicons({
  attributesMap: {
    'target-id' : 'id',
    'metadata' : 'metadata',
  },
});

On the other side, doing SVG manipulations would better sit in a different module imo (separation of concerns etc.).

Edit: s/svgicons2svgfont/svgfont2svgicons/ ;)

@mm-tom
Copy link
Author

mm-tom commented Feb 26, 2016

Yes, exactly that.

My slight issue is that my svg font doesn't contain the attributes either, but I do have them to hand.

I'll fork and try to add something in myself. Maybe something separate would be cleaner.

@nfroidure
Copy link
Owner

In case you write a separate module, feel free to PR the README to claim its existence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants