Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

postcss-base64

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

postcss-base64

Replace values in url() statements with base64 encoded strings.

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

postcss-base64, a PostCSS plugin, replaces values inside url() functions with their base64 encoded strings.

GitHub | NPM | @jelmerdemaat

Build Status bitHound Code bitHound Dependencies

Use

Load this plugin as a PostCSS module and give either or both of these options:

OptionLol whut?
extensionsAn array of extensions of files that have to be encoded, including the leading dot. Example: ['.svg']
patternA valid regex pattern to match against the string inside url() definitions to encode. Example: /<svg.*<\/svg>/i

Only strings inside url(...) functions are replaced.

Partially replacing strings with the pattern option is possible.

NodeJS

var opts = {
    extensions: ['.png', '.svg'],
    pattern: /<svg.*<\/svg>/i
};

output = postcss().use(base64(opts)).process(src).css;

Keywords

FAQs

Package last updated on 15 Dec 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc