Sass::Engine < Object
| Use Case | Command | Description |
|---|---|---|
| Read Sass template | template = File.read('stylesheets/sassy.sass') | Read the Sass file content |
| Create engine | sass_engine = Sass::Engine.new(template) | Instantiate engine with template |
| Render to CSS | output = sass_engine.render | Compile Sass to CSS |
| Render with sourcemap | sass_engine.render_with_sourcemap | Compile with source map |
| Set options | sass_engine = Sass::Engine.new(template, options) | Pass custom options (e.g. :style => :compressed) |
This class handles the parsing and compilation of the Sass template. Example usage:
template = File.read('stylesheets/sassy.sass')
sass_engine = Sass::Engine.new(template)
output = sass_engine.render
puts output
COMMENT_CHAR: The character that designates the beginning of a comment, either Sass or CSS.CONTENT_RE: [not documented]CSS_COMMENT_CHAR: The character that follows the general COMMENT_CHAR and designates a CSS comment, which is embedded in the CSS document.DEFAULT_OPTIONS: The default options for Sass::Engine. @api publicDIRECTIVES: [not documented]DIRECTIVE_CHAR: The character used to denote a compiler directive.ESCAPE_CHAR: Designates a non-parsed rule.FUNCTION_RE: [not documented]MIXIN_DEFINITION_CHAR: Designates block as mixin definition rather than CSS rules to outputMIXIN_DEF_RE: [not documented]MIXIN_INCLUDE_CHAR: Includes named mixin declared using MIXIN_DEFINITION_CHARMIXIN_INCLUDE_RE: [not documented]PROPERTY_CHAR: The character that begins a CSS property.PROPERTY_OLD: The regex that matches and extracts data from properties of the form `:name prop`.SASS_COMMENT_CHAR: The character that follows the general COMMENT_CHAR and designates a Sass comment, which is not output as a CSS comment.SASS_LOUD_COMMENT_CHAR: The character that indicates that a comment allows interpolation and should be preserved even in :compressed mode.for_filenewnormalize_optionsparse_interp_dependenciesdependenciesoptionsrenderrender_with_sourcemapsource_encodingto_cssto_treeoptions (attr_reader)Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-29 05:28 @216.73.217.46
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