ri > Sass::Plugin

📦 Sass::Plugin

This module provides a single interface to the compilation of Sass/SCSS files for an application. It provides global options and checks whether CSS files need to be updated.

This module is used as the primary interface with Sass when it's used as a plugin for various frameworks. All Rack-enabled frameworks are supported out of the box. The plugin is automatically activated for Rails and Merb. Other frameworks must enable it explicitly; see Sass::Plugin::Rack.

This module has a large set of callbacks available to allow users to run code (such as logging) when certain things happen. All callback methods are of the form on_#{name}, and they all take a block that's called when the given action occurs.

Note that this class proxies almost all methods to its Sass::Plugin::Compiler instance. See #compiler.

✨ Example Using a Callback

Sass::Plugin.on_updating_stylesheet do |template, css|
  puts "Compiling #{template} to #{css}"
end
Sass::Plugin.update_stylesheets
  #=> Compiling app/sass/screen.scss to public/stylesheets/screen.css
  #=> Compiling app/sass/print.scss to public/stylesheets/print.css
  #=> Compiling app/sass/ie.scss to public/stylesheets/ie.css

@see Sass::Plugin::Compiler


🚀 Quick Reference

Use CaseCommandDescription
Update all stylesheetsSass::Plugin.update_stylesheetsChecks and updates all stylesheets that need recompilation
Force update all stylesheetsSass::Plugin.force_update_stylesheetsUpdates all stylesheets regardless of timestamps
Check for updatesSass::Plugin.check_for_updatesChecks which stylesheets need updating without compiling
Set global optionsSass::Plugin.optionsReturns or sets options (e.g. :template_location, :css_location)
Register a callbackSass::Plugin.on_updating_stylesheet { |template, css| ... }Run code when a stylesheet is about to be updated

🔧 Instance Methods


📋 Attributes

Sass::Plugin
📦 Sass::Plugin 🚀 Quick Reference
🔧 Instance Methods 📋 Attributes

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-29 22:53 @216.73.216.177
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format