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.
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
| Use Case | Command | Description |
|---|---|---|
| Update all stylesheets | Sass::Plugin.update_stylesheets | Checks and updates all stylesheets that need recompilation |
| Force update all stylesheets | Sass::Plugin.force_update_stylesheets | Updates all stylesheets regardless of timestamps |
| Check for updates | Sass::Plugin.check_for_updates | Checks which stylesheets need updating without compiling |
| Set global options | Sass::Plugin.options | Returns or sets options (e.g. :template_location, :css_location) |
| Register a callback | Sass::Plugin.on_updating_stylesheet { |template, css| ... } | Run code when a stylesheet is about to be updated |
check_for_updateschecked_for_updatescompilerforce_update_stylesheetsmethod_missingoptionsrespond_to?update_stylesheetschecked_for_updates (attr_accessor)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)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format