### Home Classes Methods

### In Files

- lib/sass.rb
- lib/sass/callbacks.rb
- lib/sass/script/variable.rb
- lib/sass/script/css_parser.rb
- lib/sass/script/css_lexer.rb
- lib/sass/script/lexer.rb
- lib/sass/script/funcall.rb
- lib/sass/script/parser.rb
- lib/sass/error.rb
- lib/sass/cache_stores.rb
- lib/sass/repl.rb
- lib/sass/selector.rb
- lib/sass/util/test.rb
- lib/sass/util/subset_map.rb
- lib/sass/engine.rb
- lib/sass/environment.rb
- lib/sass/scss/script_lexer.rb
- lib/sass/scss/parser.rb
- lib/sass/scss/script_parser.rb
- lib/sass/scss/css_parser.rb
- lib/sass/scss/static_parser.rb
- lib/sass/scss/rx.rb
- lib/sass/tree/node.rb
- lib/sass/tree/function_node.rb
- lib/sass/tree/return_node.rb
- lib/sass/tree/content_node.rb
- lib/sass/tree/variable_node.rb
- lib/sass/tree/debug_node.rb
- lib/sass/tree/import_node.rb
- lib/sass/tree/root_node.rb
- lib/sass/tree/warn_node.rb
- lib/sass/tree/mixin_def_node.rb
- lib/sass/script.rb
- lib/sass/util.rb
- lib/sass/shared.rb
- lib/sass/plugin/configuration.rb
- lib/sass/plugin/staleness_checker.rb
- lib/sass/plugin/rack.rb
- lib/sass/cache_stores/memory.rb
- lib/sass/cache_stores/chain.rb
- lib/sass/cache_stores/filesystem.rb
- lib/sass/cache_stores/base.rb
- lib/sass/cache_stores/null.rb
- lib/sass/version.rb
- lib/sass/css.rb
- lib/sass/importers.rb
- lib/sass/logger/log_level.rb
- lib/sass/root.rb
- lib/sass/logger.rb
- lib/sass/importers/base.rb
- lib/sass/importers/filesystem.rb
- lib/sass/scss.rb
- lib/sass/selector/simple_sequence.rb
- lib/sass/selector/simple.rb
- lib/sass/selector/sequence.rb
- lib/sass/selector/comma_sequence.rb
- lib/sass/selector/abstract_sequence.rb
- lib/sass/plugin.rb
- lib/sass/exec.rb

### Namespace

- MODULE Sass::CacheStores
- MODULE Sass::Callbacks
- MODULE Sass::Exec
- MODULE Sass::Importers
- MODULE Sass::Logger
- MODULE Sass::Media
- MODULE Sass::Plugin
- MODULE Sass::SCSS
- MODULE Sass::Script
- MODULE Sass::Selector
- MODULE Sass::Shared
- MODULE Sass::Supports
- MODULE Sass::Tree
- MODULE Sass::Util
- MODULE Sass::Version
- CLASS Sass::CSS
- CLASS Sass::Engine
- CLASS Sass::Environment
- CLASS Sass::Repl
- CLASS Sass::SyntaxError
- CLASS Sass::UnitConversionError

### Methods

- ::compile
- ::compile_file
- ::load_paths

### Class/Module Index

Quicksearch

- Sass
- Sass::CSS
- Sass::CacheStores
- Sass::CacheStores::Base
- Sass::CacheStores::Chain
- Sass::CacheStores::Filesystem
- Sass::CacheStores::Memory
- Sass::CacheStores::Null
- Sass::Callbacks
- Sass::Callbacks::InstanceMethods
- Sass::Engine
- Sass::Engine::Line
- Sass::Environment
- Sass::Exec
- Sass::Exec::Generic
- Sass::Exec::Sass
- Sass::Exec::SassConvert
- Sass::Exec::Scss
- Sass::Importers
- Sass::Importers::Base
- Sass::Importers::Filesystem
- Sass::Logger
- Sass::Logger::Base
- Sass::Logger::LogLevel
- Sass::Logger::LogLevel::ClassMethods
- Sass::Media
- Sass::Media::Query
- Sass::Media::QueryList
- Sass::Plugin
- Sass::Plugin::Compiler
- Sass::Plugin::Configuration
- Sass::Plugin::MerbBootLoader
- Sass::Plugin::Rack
- Sass::Plugin::StalenessChecker
- Sass::Repl
- Sass::SCSS
- Sass::SCSS::CssParser
- Sass::SCSS::Parser
- Sass::SCSS::RX
- Sass::SCSS::ScriptLexer
- Sass::SCSS::ScriptParser
- Sass::SCSS::StaticParser
- Sass::Script
- Sass::Script::ArgList
- Sass::Script::Bool
- Sass::Script::Color
- Sass::Script::CssLexer
- Sass::Script::CssParser
- Sass::Script::Funcall
- Sass::Script::Functions
- Sass::Script::Functions::EvaluationContext
- Sass::Script::Interpolation
- Sass::Script::Lexer
- Sass::Script::List
- Sass::Script::Literal
- Sass::Script::Node
- Sass::Script::Null
- Sass::Script::Number
- Sass::Script::Operation
- Sass::Script::Parser
- Sass::Script::String
- Sass::Script::StringInterpolation
- Sass::Script::UnaryOperation
- Sass::Script::Variable
- Sass::Selector
- Sass::Selector::AbstractSequence
- Sass::Selector::Attribute
- Sass::Selector::Class
- Sass::Selector::CommaSequence
- Sass::Selector::Element
- Sass::Selector::Id
- Sass::Selector::Interpolation
- Sass::Selector::Parent
- Sass::Selector::Placeholder
- Sass::Selector::Pseudo
- Sass::Selector::SelectorPseudoClass
- Sass::Selector::Sequence
- Sass::Selector::Simple
- Sass::Selector::SimpleSequence
- Sass::Selector::Universal
- Sass::Shared
- Sass::Supports
- Sass::Supports::Condition
- Sass::Supports::Declaration
- Sass::Supports::Interpolation
- Sass::Supports::Negation
- Sass::Supports::Operator
- Sass::SyntaxError
- Sass::Tree
- Sass::Tree::CharsetNode
- Sass::Tree::CommentNode
- Sass::Tree::ContentNode
- Sass::Tree::CssImportNode
- Sass::Tree::DebugNode
- Sass::Tree::DirectiveNode
- Sass::Tree::EachNode
- Sass::Tree::ExtendNode
- Sass::Tree::ForNode
- Sass::Tree::FunctionNode
- Sass::Tree::IfNode
- Sass::Tree::ImportNode
- Sass::Tree::MediaNode
- Sass::Tree::MixinDefNode
- Sass::Tree::MixinNode
- Sass::Tree::Node
- Sass::Tree::PropNode
- Sass::Tree::ReturnNode
- Sass::Tree::RootNode
- Sass::Tree::RuleNode
- Sass::Tree::SupportsNode
- Sass::Tree::TraceNode
- Sass::Tree::VariableNode
- Sass::Tree::Visitors
- Sass::Tree::Visitors::Base
- Sass::Tree::Visitors::CheckNesting
- Sass::Tree::Visitors::Convert
- Sass::Tree::Visitors::Cssize
- Sass::Tree::Visitors::DeepCopy
- Sass::Tree::Visitors::Extend
- Sass::Tree::Visitors::Perform
- Sass::Tree::Visitors::SetOptions
- Sass::Tree::Visitors::ToCss
- Sass::Tree::WarnNode
- Sass::Tree::WhileNode
- Sass::UnitConversionError
- Sass::Util
- Sass::Util::MultibyteStringScanner
- Sass::Util::StaticConditionalContext
- Sass::Util::SubsetMap
- Sass::Util::Test
- Sass::Version
- ActionController
- ActionController::Base
- Object

No matching classes.

# Sass

The module that contains everything Sass-related:

- {Sass::Engine} is the class used to render Sass/SCSS within Ruby code.

- {Sass::Plugin} is interfaces with web frameworks (Rails and Merb in particular).

- {Sass::SyntaxError} is raised when Sass encounters an error.

- {Sass::CSS} handles conversion of CSS to Sass.

Also see the {file:SASS_REFERENCE.md full Sass reference}.

We keep configuration in its own self-contained file so that we can load it independently in Rails 3, where the full plugin stuff is lazy-loaded.

### Constants

Callable

  A Sass mixin or function.

  `name`: `String` : The name of the mixin/function.

  `args`: `Array<(Script::Node, Script::Node)>` : The arguments for the mixin/function.

      Each element is a tuple containing the variable node of the argument
      and the parse tree for the default value of the argument.

  `splat`: `Script::Node?` : The variable node of the splat argument for this callable, or null.

  `environment`: {Sass::Environment} : The environment in which the mixin/function was defined.

      This is captured so that the mixin/function can have access
      to local variables defined in its scope.

  `tree`: `Array<Tree::Node>` : The parse tree for the mixin/function.

  `has_content`: `Boolean` : Whether the callable accepts a content block.

  `type`: `String` : The user-friendly name of the type of the callable.

ROOT_DIR

  The root directory of the Sass source tree. This may be overridden by the package manager if the lib directory is separated from the main source tree. @api public

VERSION

  A string representing the version of Sass. A more fine-grained representation is available from Sass.version. @api public

### Attributes

logger[RW]

### Public Class Methods

compile(contents, options = {}) click to toggle source

Compile a Sass or SCSS string to CSS. Defaults to SCSS.

@param contents [String] The contents of the Sass file. @param options [{Symbol => Object}] An options hash;

    see {file:SASS_REFERENCE.md#sass_options the Sass options documentation}

@raise [Sass::SyntaxError] if there's an error in the document @raise [Encoding::UndefinedConversionError] if the source encoding

    cannot be converted to UTF-8

@raise [ArgumentError] if the document uses an unknown encoding with `@charset`

    # File lib/sass.rb, line 52
    def self.compile(contents, options = {})
      options[:syntax] ||= :scss
      Engine.new(contents, options).to_css
    end

compile_file(filename, *args) click to toggle source

Compile a file on disk to CSS.

@param filename [String] The path to the Sass, SCSS, or CSS file on disk. @param options [{Symbol => Object}] An options hash;

    see {file:SASS_REFERENCE.md#sass_options the Sass options documentation}

@raise [Sass::SyntaxError] if there's an error in the document @raise [Encoding::UndefinedConversionError] if the source encoding

    cannot be converted to UTF-8

@raise [ArgumentError] if the document uses an unknown encoding with `@charset`

@overload compile_file(filename, options = {})

    Return the compiled CSS rather than writing it to a file.

    @return [String] The compiled CSS.

@overload compile_file(filename, css_filename, options = {})

    Write the compiled CSS to a file.

    @param css_filename [String] The location to which to write the compiled CSS.

    # File lib/sass.rb, line 76
    def self.compile_file(filename, *args)
      options = args.last.is_a?(Hash) ? args.pop : {}
      css_filename = args.shift
      result = Sass::Engine.for_file(filename, options).render
      if css_filename
        options[:css_filename] ||= css_filename
        open(css_filename,"w") {|css_file| css_file.write(result)}
        nil
      else
        result
      end
    end

load_paths() click to toggle source

The global load paths for Sass files. This is meant for plugins and libraries to register the paths to their Sass stylesheets to that they may be `@imported`. This load path is used by every instance of [Sass::Engine]. They are lower-precedence than any load paths passed in via the {file:SASS_REFERENCE.md#load_paths-option `:load_paths` option}.

If the `SASS_PATH` environment variable is set, the initial value of `load_paths` will be initialized based on that. The variable should be a colon-separated list of path names (semicolon-separated on Windows).

Note that files on the global load path are never compiled to CSS themselves, even if they aren't partials. They exist only to be imported.

@example

    Sass.load_paths << File.dirname(__FILE__ + '/sass')

@return [Array<String, Pathname, Sass::Importers::Base>]

    # File lib/sass.rb, line 37
    def self.load_paths
      @load_paths ||= ENV['SASS_PATH'] ?
        ENV['SASS_PATH'].split(Sass::Util.windows? ? ';' : ':') : []
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.