Skip to content

Add a class name to the generated svg element to target them in css #7

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
gubug opened this issue May 27, 2022 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@gubug
Copy link

gubug commented May 27, 2022

Is it possible to add a class name, eg. "bootstrap-icon" or "bicon", to the generated svg element ?
maybe also a kebab case version of the icon name

the idea is to target the icons easily with css in order to correct alignment with text for example

<svg width="1em" height="1em" class="bicon bicon-bookmark" viewBox="0 0 16 16" fill="currentColor" role="img" focusable="false">...</svg>

@tommyip tommyip added the enhancement New feature or request label May 28, 2022
@tommyip
Copy link
Owner

tommyip commented May 28, 2022

Good idea!

@alcalyn
Copy link

alcalyn commented Jan 8, 2024

I also need this, for testing purpose. I was checking a <i> element was the expected icon. Now, with this lib, I can no longer make assertions on the icon in cypress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants