Module: Sass
- Extended by:
- Version
- Defined in:
- lib/sass.rb,
lib/sass/css.rb,
lib/sass/exec.rb,
lib/sass/repl.rb,
lib/sass/root.rb,
lib/sass/scss.rb,
lib/sass/util.rb,
lib/sass/error.rb,
lib/sass/engine.rb,
lib/sass/logger.rb,
lib/sass/plugin.rb,
lib/sass/script.rb,
lib/sass/shared.rb,
lib/sass/scss/rx.rb,
lib/sass/version.rb,
lib/sass/selector.rb,
lib/sass/callbacks.rb,
lib/sass/importers.rb,
lib/sass/tree/node.rb,
lib/sass/util/test.rb,
lib/sass/environment.rb,
lib/sass/plugin/rack.rb,
lib/sass/scss/parser.rb,
lib/sass/cache_stores.rb,
lib/sass/script/lexer.rb,
lib/sass/script/parser.rb,
lib/sass/importers/base.rb,
lib/sass/script/funcall.rb,
lib/sass/tree/root_node.rb,
lib/sass/tree/warn_node.rb,
lib/sass/script/variable.rb,
lib/sass/scss/css_parser.rb,
lib/sass/selector/simple.rb,
lib/sass/tree/debug_node.rb,
lib/sass/util/subset_map.rb,
lib/sass/logger/log_level.rb,
lib/sass/script/css_lexer.rb,
lib/sass/tree/import_node.rb,
lib/sass/tree/return_node.rb,
lib/sass/cache_stores/base.rb,
lib/sass/cache_stores/null.rb,
lib/sass/script/css_parser.rb,
lib/sass/scss/script_lexer.rb,
lib/sass/selector/sequence.rb,
lib/sass/tree/content_node.rb,
lib/sass/cache_stores/chain.rb,
lib/sass/scss/script_parser.rb,
lib/sass/scss/static_parser.rb,
lib/sass/tree/function_node.rb,
lib/sass/tree/variable_node.rb,
lib/sass/cache_stores/memory.rb,
lib/sass/tree/mixin_def_node.rb,
lib/sass/importers/filesystem.rb,
lib/sass/plugin/configuration.rb,
lib/sass/cache_stores/filesystem.rb,
lib/sass/selector/comma_sequence.rb,
lib/sass/plugin/staleness_checker.rb,
lib/sass/selector/simple_sequence.rb,
lib/sass/selector/abstract_sequence.rb
Overview
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.
Defined Under Namespace
Modules: CacheStores, Callbacks, Exec, Importers, Logger, Media, Plugin, SCSS, Script, Selector, Shared, Supports, Tree, Util, Version Classes: CSS, Callable, Engine, Environment, Repl, SyntaxError, UnitConversionError
Constant Summary collapse
- 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.
File.expand_path(File.join(__FILE__, "../../.."))
- VERSION =
A string representing the version of Sass. A more fine-grained representation is available from Sass.version.
- MERB_LOADED =
true
- RAILS_LOADED =
true
- GENERIC_LOADED =
true
Constants included from Util
Util::CHARSET_REGEXPS, Util::ENCODINGS_TO_CHECK, Util::RUBY_ENGINE, Util::RUBY_VERSION
Class Attribute Summary collapse
-
.logger
Returns the value of attribute logger.
Class Method Summary collapse
-
.compile(contents, options = {})
Compile a Sass or SCSS string to CSS.
-
.compile_file(filename, *args)
Compile a file on disk to CSS.
-
.load_paths ⇒ Array<String, Pathname, Sass::Importers::Base>
The global load paths for Sass files.
Methods included from Version
Methods included from Util
#abstract, #ap_geq?, #ap_geq_3?, #array_minus, #atomic_create_and_write_file, #av_template_class, #caller_info, #check_encoding, #check_range, #check_sass_encoding, #destructure, #enum_cons, #enum_slice, #enum_with_index, #extract!, #extract_values, #flatten, #glob, #group_by_to_a, #has?, #hash_to_a, #inject_values, #inspect_obj, #intersperse, #ironruby?, #jruby1_6?, #jruby?, #jruby_version, #lcs, #macruby?, #map_hash, #map_keys, #map_vals, #merge_adjacent_strings, #ord, #paths, #powerset, #rails_env, #rails_root, #rbx?, #restrict, #ruby1?, #ruby1_8?, #ruby1_8_6?, #sass_warn, #scope, #set_eql?, #set_hash, #silence_sass_warnings, #silence_warnings, #strip_string_array, #subsequence?, #substitute, #to_hash, #undefined_conversion_error_char, #version_geq, #version_gt, #windows?, #with_extracted_values
Class Attribute Details
.logger
Returns the value of attribute logger.
11 12 13 |
# File 'lib/sass/logger.rb', line 11
def logger
@logger
end
|
Class Method Details
.compile(contents, options = {})
Compile a Sass or SCSS string to CSS. Defaults to SCSS.
52 53 54 55 |
# File 'lib/sass.rb', line 52
def self.compile(contents, options = {})
options[:syntax] ||= :scss
Engine.new(contents, options).to_css
end
|
.compile_file(filename, options = {}) ⇒ String .compile_file(filename, css_filename, options = {})
Compile a file on disk to CSS.
76 77 78 79 80 81 82 83 84 85 86 87 |
# 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 ⇒ Array<String, Pathname, Sass::Importers::Base>
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
: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.
37 38 39 40 |
# File 'lib/sass.rb', line 37
def self.load_paths
@load_paths ||= ENV['SASS_PATH'] ?
ENV['SASS_PATH'].split(Sass::Util.windows? ? ';' : ':') : []
end
|