Skip to content

Instantly share code, notes, and snippets.

@lucasmazza
Last active November 29, 2021 01:37
Show Gist options
  • Select an option

  • Save lucasmazza/4402036 to your computer and use it in GitHub Desktop.

Select an option

Save lucasmazza/4402036 to your computer and use it in GitHub Desktop.
The 20 something lines of Compass that I need.
require 'compass'
require 'tmpdir'
template = %Q{
@import "icons/*.png";
@include all-icons-sprites;
}
options = {
:syntax => :scss,
:line_comments => false,
:cache => false,
:force => true,
:load_paths => [Compass::Frameworks[:compass].stylesheets_directory, Compass::SpriteImporter.new]
}
Compass.configuration do |config|
config.sprite_load_path << Dir.pwd
config.generated_images_path = Dir.pwd
config.images_path = Dir.pwd
config.on_sprite_saved do |filename|
puts filename
end
end
engine = Sass::Engine.new(template, options)
puts engine.render
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment