advice Question

Can I use the clamp function to scale an SVG image.

Avatar of dlearman1
dlearman1Flag for United States of America asked on
Web DevelopmentCSS* SVG* SASS (Syntactically Awesome Stylesheets)
5 Comments1 Solution6 ViewsLast Modified:

I would like to scale an svg image using the clamp function. Something like this:

<div class="l-wrapper-page">
       <a class="l-wrapper-page__logo" href="#"><img src="./_img/graphics/logos/serena-logo-sm.svg" width="clamp(140px, calc((#{.06544vw + 75.07853})) * 1px, 240px)" height="auto" alt="Serena Construction Logo">

I've tried a few tweaks to the code, but nothing seems to work. Looking up clamp it is supposed to work wherever a length is called for.  Is there a reason this application doesn't work: relating to SVG or clamp specs?  Is there a way to modify the code so it will work?

Join our community to see this answer!
Unlock 1 Answer and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros