[Configuration] Allow additional sass options to be specified in the compass configuration using the sass_options property.
This commit is contained in:
parent
047be06a0a
commit
802bca6174
@ -14,7 +14,8 @@ module Compass
|
|||||||
:output_style,
|
:output_style,
|
||||||
:environment,
|
:environment,
|
||||||
:http_images_path,
|
:http_images_path,
|
||||||
:additional_import_paths
|
:additional_import_paths,
|
||||||
|
:sass_options
|
||||||
]
|
]
|
||||||
|
|
||||||
attr_accessor *ATTRIBUTES
|
attr_accessor *ATTRIBUTES
|
||||||
@ -206,6 +207,7 @@ module Compass
|
|||||||
plugin_opts = {:template_location => locations}
|
plugin_opts = {:template_location => locations}
|
||||||
plugin_opts[:style] = output_style if output_style
|
plugin_opts[:style] = output_style if output_style
|
||||||
plugin_opts[:line_comments] = default_line_comments if environment
|
plugin_opts[:line_comments] = default_line_comments if environment
|
||||||
|
plugin_opts.merge!(sass_options || {})
|
||||||
plugin_opts
|
plugin_opts
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -223,7 +225,7 @@ module Compass
|
|||||||
engine_opts = {:load_paths => sass_load_paths}
|
engine_opts = {:load_paths => sass_load_paths}
|
||||||
engine_opts[:style] = output_style if output_style
|
engine_opts[:style] = output_style if output_style
|
||||||
engine_opts[:line_comments] = default_line_comments if environment
|
engine_opts[:line_comments] = default_line_comments if environment
|
||||||
engine_opts
|
engine_opts.merge!(sass_options || {})
|
||||||
end
|
end
|
||||||
|
|
||||||
def sass_load_paths
|
def sass_load_paths
|
||||||
|
@ -89,4 +89,23 @@ EXPECTED
|
|||||||
assert_equal expected_serialization, Compass.configuration.serialize
|
assert_equal expected_serialization, Compass.configuration.serialize
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_sass_options
|
||||||
|
contents = <<-CONFIG
|
||||||
|
sass_options = {:foo => 'bar'}
|
||||||
|
CONFIG
|
||||||
|
|
||||||
|
Compass.configuration.parse_string(contents, "test_sass_options")
|
||||||
|
|
||||||
|
assert_equal 'bar', Compass.configuration.to_sass_engine_options[:foo]
|
||||||
|
assert_equal 'bar', Compass.configuration.to_sass_plugin_options[:foo]
|
||||||
|
|
||||||
|
expected_serialization = <<EXPECTED
|
||||||
|
# Require any additional compass plugins here.
|
||||||
|
# To enable relative image paths using the images_url() function:
|
||||||
|
# http_images_path = :relative
|
||||||
|
sass_options = {:foo=>"bar"}
|
||||||
|
EXPECTED
|
||||||
|
assert_equal expected_serialization, Compass.configuration.serialize
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
Loading…
Reference in New Issue
Block a user