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

compass-import-once

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

compass-import-once

  • 1.0.5
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Import Once

This plugin changes the behavior of Sass's @import directive so that if the same sass file is imported more than once, the second import will be a no-op. This allows dependencies to behave how most people expect them to behave and provides a considerable performance improvement for some sass projects.

Note: Although this plugin is maintained by compass, it can be used without compass in any Sass-based project.

Installation

Either add this line to your application's Gemfile if you have one:

gem 'compass-import-once', :require => 'compass/import-once/activate'

And then execute:

$ bundle

Or install it yourself as:

$ gem install compass-import-once

Usage

To use with the Sass command line:

sass -r 'compass/import-once/activate' ...

To enable in non-compass environments there's two options:

require 'compass/import-once/activate'

or you can activate it conditionally:

require 'compass/import-once'
Compass::ImportOnce.activate!

Forcing an Import

If a file must be imported a second time, you can force it by adding an exclamation mark to the end of the import url. E.g.

@import "something";
@import "something!"; // this will be imported again.

FAQs

Package last updated on 04 Aug 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