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

Feature request: add 'class' parameter to svg() #3174

Closed
frankharrison-wj opened this issue Jul 31, 2018 · 11 comments
Closed

Feature request: add 'class' parameter to svg() #3174

frankharrison-wj opened this issue Jul 31, 2018 · 11 comments

Comments

@frankharrison-wj
Copy link

Would be great for the svg() function to allow a second 'class' parameter which would inject that class name into the SVG before inlining it. I built my own plugin to do this but would be nice to have out-of-the-box!

@brandonkelly
Copy link
Member

Not sure I’m following. You mean so it ends up like this?

<svg class="<TheClassName>" ... />

@frankharrison-wj
Copy link
Author

Yep – can also be done with a find and replace on the text, but would be nice to have it as part of the svg() function if possible.

@brandonkelly
Copy link
Member

I’m not really interested in making the svg() function more complicated than it needs to be. You could just wrap the SVG in a <div> with the class name instead.

@frankharrison-wj
Copy link
Author

Fair enough – I'll stick to my plugin!

@benface
Copy link
Contributor

benface commented Nov 28, 2018

@frankharrison-wj Have you released this plugin somewhere by any chance? :)

@brandonkelly
Copy link
Member

I’ve actually seen the light on why a class attribute would be super helpful, so reopening this and will see if we can get it into 3.1 before it goes out of beta.

@brandonkelly brandonkelly reopened this Nov 28, 2018
@benface
Copy link
Contributor

benface commented Nov 28, 2018

@brandonkelly Great! Have you been using functional CSS by any chance? ;)

@brandonkelly
Copy link
Member

Haha yes :)

brandonkelly added a commit that referenced this issue Nov 29, 2018
@brandonkelly
Copy link
Member

OK added for the next 3.1 beta release :)

@benface
Copy link
Contributor

benface commented Nov 29, 2018

That was fast!

@frankharrison-wj
Copy link
Author

Ah that's great! Was about to say that I'd not released my plugin anywhere, as it's probably not super-stable and relies on being used exactly as I use it! But glad to see I'm not going to need it soon.

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

3 participants