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

SVG inline code #239

Open
MarinescuLucia opened this issue Mar 15, 2023 · 1 comment
Open

SVG inline code #239

MarinescuLucia opened this issue Mar 15, 2023 · 1 comment
Labels
new feature Request for a new feature or functionality to be added to the project.

Comments

@MarinescuLucia
Copy link

What problem does this address?

A user asked if it would be possible to change the way SVG icons are displayed so they can be easily styled with CSS. I'll add his suggestion below.

  After discovering that SVG’s are inserted as src attribute in an <img>, I looked into how I could get it inline and found that editing the includes/front.php and changing one line will do the trick – then you can style how you will with CSS and colours / SVG elements can be targeted for interaction.
  
  The line 492 is the one to edit:
  
  <img src="%s" class="%s" aria-hidden="true" alt="%s"%s%s%s/>',
  
  Changed to:
  
  file_get_contents(esc_url( wp_get_attachment_url( $meta['icon'] ) )),
  
  Will output the raw SVG from the media library.

He also asked if it would be possible to add additional measurement units.

Suggested here.

What is your proposed solution?

No response

@MarinescuLucia MarinescuLucia added the new feature Request for a new feature or functionality to be added to the project. label Mar 15, 2023
@mauricenaef
Copy link

Any progress on this. Would love the feature as well but don't want to fiddle with the source code.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Request for a new feature or functionality to be added to the project.
Projects
None yet
Development

No branches or pull requests

2 participants