
Product
Introducing Socket Fix for Safe, Automated Dependency Upgrades
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
sass-svg-uri
Advanced tools
A Sass module with Jakob Eriksen's function to encode SVG markup into optimized data:
URIs. Uses Hugo Giraudel's str-replace function to percent-encode characters that aren’t URL-safe.
As of version 2.0 this only supports Dart Sass 1.33.0
and above.
Import the module and use the encode
function.
@use "sass-svg-uri";
.icon {
background-image: sass-svg-uri.encode('<svg xmlns="http://www.w3.org/2000/svg"> ... </svg>');
}
This would output:
.icon {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E% ... %3C/svg%3E");
}
To learn more:
FAQs
Sass module to encode SVGs as an optimized data URI
We found that sass-svg-uri demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Automatically fix and test dependency updates with socket fix—a new CLI tool that turns CVE alerts into safe, automated upgrades.
Security News
CISA denies CVE funding issues amid backlash over a new CVE foundation formed by board members, raising concerns about transparency and program governance.
Product
We’re excited to announce a powerful new capability in Socket: historical data and enhanced analytics.