Method: Sass::CSS#initialize

Defined in:
lib/sass/css.rb

#initialize(template, options = {}) ⇒ CSS

Returns a new instance of CSS.

Parameters:

  • template (String)

    The CSS stylesheet. This stylesheet can be encoded using any encoding that can be converted to Unicode. If the stylesheet contains an @charset declaration, that overrides the Ruby encoding (see the encoding documentation)

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :old (Boolean) — default: false

    Whether or not to output old property syntax (:color blue as opposed to color: blue). This is only meaningful when generating Sass code, rather than SCSS.



28
29
30
31
32
33
34
35
36
37
# File 'lib/sass/css.rb', line 28

def initialize(template, options = {})
  if template.is_a? IO
    template = template.read
  end

  @options = options.dup
  # Backwards compatibility
  @options[:old] = true if @options[:alternate] == false
  @template = template
end