New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

broccoli-sass-image-compiler

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-sass-image-compiler

Compress images to Base64 Data URIs in variables and output to SCSS file

  • 0.0.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

broccoli-sass-image-compiler

MIT License

This is a broccoli library for processing image files and creating SASS variables with Data URIs in them.

NOTES:

  1. file names must make good SASS variable names. Names like "my awesome image.gif" will not work because of the spaces.
  2. file names don't need the $ prefix.
  3. file names should be unique regardless of folder depth. This script is "dumb" and just uses the file name.
  4. Do a little dance.
  5. Make a little love.
  6. Get down tonight.

Usage

In your Brocfile.js:

var sassImageCompiler = require('broccoli-sass-image-compiler');

var imageTree = sassImageCompiler('/some_dir', {
	inputFiles: [
		'**/*.png', // all png files
		'someFile.svg' // specific svg file
	],

	// specify the output file you want created
	outputFile: '/compiled-images.scss'
});

Then in your SASS

@import 'path/to/compiled-images';

.custom-class {
	background-image: url($someFile); // derived from 'someFile.svg'
}

.other-class {
	background-image: url($icon_16x16); // if you had a file named "whatever/icon_16x16.png"
}

Keywords

FAQs

Package last updated on 03 Jul 2014

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