
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
gulp-css-urlencode-inline-svgs
Advanced tools
Makes CSS-inlined data:image/xml+svg compatible with Firefox and IE
gulp-css-urlencode-inline-svgs
Data URIs make sprites easier. SVGs make resolution independence easier.
Putting them together seems like an obvious win. You might think that because
the contents of an SVG is just XML text, you could just paste them right into
your stylesheets! But the spec says that data:image/xml+svg
must be URL
encoded. So you still need to pass them through an encoding stage like you
would for base64'ing other image types.
Here's a gulp plugin that does that. It works on plain CSS so put it in your pipe after your compiler and autoprefixer, but before your minifier.
var urlencode = require('gulp-css-urlencode-inline-svgs');
gulp.task('styles', function () {
gulp.src('src/styles/index.scss')
.pipe(sass())
.pipe(prefix())
.pipe(urlencode()) // New hotness
.pipe(cssmin())
.pipe(gulp.dest('public'));
});
background-image: url('data:image/svg+xml;utf8, <svg version="1.1" ... etc
background-image: url('data:image/svg+xml;utf8, %3Csvg%20version%3D%22 ... etc
}\n
. Might want to provide a different one.FAQs
Makes CSS-inlined data:image/xml+svg compatible with Firefox and IE
The npm package gulp-css-urlencode-inline-svgs receives a total of 296 weekly downloads. As such, gulp-css-urlencode-inline-svgs popularity was classified as not popular.
We found that gulp-css-urlencode-inline-svgs 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.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.