Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
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 228 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
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.