merge from stable branch

This commit is contained in:
Eric Meyer 2012-04-27 16:03:38 -06:00
commit 275bb0762f
13 changed files with 60 additions and 19 deletions

View File

@ -31,8 +31,12 @@ The Documentation for the [latest preview release](http://beta.compass-style.org
* [Vertical Rhythm Module] The `establish-baseline` mixin now styles the * [Vertical Rhythm Module] The `establish-baseline` mixin now styles the
`<html>` element instead of the `<body>` element. This makes the `<html>` element instead of the `<body>` element. This makes the
vertical rhythm module work better with `rem` based measurements. vertical rhythm module work better with `rem` based measurements.
* [CSS3] Add 3D transform support for Mozillia, IE, and Opera. * [CSS3] Added 3D transform support for Mozillia, IE, and Opera.
* [CSS3] Add `-ms` support for css3 columns. Add support for the columns shorthand property. * [CSS3] Added `-ms` support for css3 columns. Add support for the columns shorthand property.
* [CLI] Added a `-I` option for adding sass import paths via the CLI during compilation and project set up.
* [Configuration] For better ruby and rails integration, the `add_import_path` command now accepts
[Sass::Importer](http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#custom_importers) objects
and [Ruby Pathname](http://www.ruby-doc.org/stdlib-1.9.3/libdoc/pathname/rdoc/Pathname.html) objects.
0.12.1 (03/14/2012) 0.12.1 (03/14/2012)
------------------- -------------------

View File

@ -91,7 +91,7 @@ layout: homepage
%img(src="/images/compass.app.png") %img(src="/images/compass.app.png")
%p %p
Buy <a href="http://compass.handlino.com/">Compass.app</a> Buy <a href="http://compass.handlino.com/">Compass.app</a>
for Windows and Mac for just $7. for Windows and Mac for just $10.
%p.note %p.note
Note: Compass.app is a product of Handlino, Inc but Note: Compass.app is a product of Handlino, Inc but
30% of all proceeds go to Compass's charity of choice: <a href="http://umdf.org/compass">UMDF.org</a>. 30% of all proceeds go to Compass's charity of choice: <a href="http://umdf.org/compass">UMDF.org</a>.

View File

@ -18,7 +18,7 @@ documented_functions:
%p %p
These color functions are useful for creating generic libraries that have to accept a These color functions are useful for creating generic libraries that have to accept a
range of inputs. For more color functions see range of inputs. For more color functions see
<a href="http://sass-lang.com/yardoc/Sass/Script/Functions.html">the sass reference <a href="http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html">the sass reference
documentation</a> documentation</a>
#adjust-lightness.helper #adjust-lightness.helper

View File

@ -1,9 +1,12 @@
@import "shared"; @import "shared";
// Change the appearance for Mozilla, Webkit and the future // Change the appearance for Mozilla, Webkit and possibly the future.
// The appearance property is currently not present in any newer CSS specification.
// //
// @param $ap // There is no official list of accepted values, but you might check these source:
// [ none | normal | icon | window | button | menu | field ] // Mozilla : https://developer.mozilla.org/en/CSS/-moz-appearance
// Webkit : http://code.google.com/p/webkit-mirror/source/browse/Source/WebCore/css/CSSValueKeywords.in?spec=svnf1aea559dcd025a8946aa7da6e4e8306f5c1b604&r=63c7d1af44430b314233fea342c3ddb2a052e365
// (search for 'appearance' within the page)
@mixin appearance($ap) { @mixin appearance($ap) {
$ap: unquote($ap); $ap: unquote($ap);

View File

@ -67,8 +67,8 @@
// Reset the font and vertical alignment. // Reset the font and vertical alignment.
@mixin reset-font { @mixin reset-font {
font-size: 100%;
font: inherit; font: inherit;
font-size: 100%;
vertical-align: baseline; } vertical-align: baseline; }
// Resets the outline when focus. // Resets the outline when focus.

View File

@ -69,7 +69,11 @@ $base-half-leader: $base-leader / 2;
} }
} }
// resets the baseline to 1 leading unit // Resets the line-height to 1 vertical rhythm unit.
// Does not work on elements whose font-size is different from $base-font-size.
//
// @deprecated This mixin will be removed in the next release.
// Please use the `adjust-leading-to` mixin instead.
@mixin reset-baseline { @mixin reset-baseline {
@include adjust-leading-to(1, if($relative-font-sizing, $base-font-size, $base-font-size)); @include adjust-leading-to(1, if($relative-font-sizing, $base-font-size, $base-font-size));
} }
@ -109,12 +113,13 @@ $base-half-leader: $base-leader / 2;
// Calculate rhythm units. // Calculate rhythm units.
@function rhythm( @function rhythm(
$lines: 1, $lines: 1,
$font-size: $base-font-size $font-size: $base-font-size,
$offset: 0
) { ) {
@if not $relative-font-sizing and $font-size != $base-font-size { @if not $relative-font-sizing and $font-size != $base-font-size {
@warn "$relative-font-sizing is false but a relative font size was passed to the rhythm function"; @warn "$relative-font-sizing is false but a relative font size was passed to the rhythm function";
} }
$rhythm: $font-unit * $lines * $base-line-height / $font-size; $rhythm: $font-unit * ($lines * $base-line-height - $offset) / $font-size;
// Round the pixels down to nearest integer. // Round the pixels down to nearest integer.
@if unit($rhythm) == px { @if unit($rhythm) == px {
$rhythm: floor($rhythm); $rhythm: floor($rhythm);
@ -181,7 +186,7 @@ $base-half-leader: $base-leader / 2;
style: $border-style; style: $border-style;
width: $font-unit * $width / $font-size; width: $font-unit * $width / $font-size;
}; };
padding-#{$side}: $font-unit / $font-size * ($lines * $base-line-height - $width); padding-#{$side}: rhythm($lines, $font-size, $offset: $width);
} }
// Apply borders and whitespace equally to all sides. // Apply borders and whitespace equally to all sides.
@ -193,7 +198,7 @@ $base-half-leader: $base-leader / 2;
style: $border-style; style: $border-style;
width: $font-unit * $width / $font-size; width: $font-unit * $width / $font-size;
}; };
padding: $font-unit / $font-size * ($lines * $base-line-height - $width); padding: rhythm($lines, $font-size, $offset: $width);
} }
// Apply a leading border. // Apply a leading border.

View File

@ -22,7 +22,7 @@ $default-has-layout-approach: zoom !default;
} }
@mixin has-layout-zoom { @mixin has-layout-zoom {
@if $legacy-support-for-ie { @if $legacy-support-for-ie6 or $legacy-support-for-ie7 {
*zoom: 1; *zoom: 1;
} }
} }

View File

@ -13,8 +13,13 @@ module Compass
Compass::Frameworks::ALL.each do |framework| Compass::Frameworks::ALL.each do |framework|
locations << [framework.stylesheets_directory, File.join(css_path || css_dir || ".", framework.name)] locations << [framework.stylesheets_directory, File.join(css_path || css_dir || ".", framework.name)]
end end
load_paths = []
resolve_additional_import_paths.each do |additional_path| resolve_additional_import_paths.each do |additional_path|
if additional_path.is_a?(String)
locations << [additional_path, File.join(css_path || css_dir || ".", File.basename(additional_path))] locations << [additional_path, File.join(css_path || css_dir || ".", File.basename(additional_path))]
else
load_paths << additional_path
end
end end
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
@ -23,13 +28,14 @@ module Compass
plugin_opts[:cache_location] = cache_path unless cache_path.nil? plugin_opts[:cache_location] = cache_path unless cache_path.nil?
plugin_opts.merge!(sass_options || {}) plugin_opts.merge!(sass_options || {})
plugin_opts[:load_paths] ||= [] plugin_opts[:load_paths] ||= []
plugin_opts[:load_paths] += load_paths
plugin_opts[:load_paths] << Compass::SpriteImporter.new plugin_opts[:load_paths] << Compass::SpriteImporter.new
plugin_opts plugin_opts
end end
def resolve_additional_import_paths def resolve_additional_import_paths
(additional_import_paths || []).map do |path| (additional_import_paths || []).map do |path|
if project_path && !absolute_path?(path) if path.is_a?(String) && project_path && !absolute_path?(path)
File.join(project_path, path) File.join(project_path, path)
else else
path path

View File

@ -79,6 +79,7 @@ module Compass
end end
def add_import_path(*paths) def add_import_path(*paths)
paths.map!{|p| defined?(Pathname) && Pathname === p ? p.to_s : p}
# The @added_import_paths variable works around an issue where # The @added_import_paths variable works around an issue where
# the additional_import_paths gets overwritten during parse # the additional_import_paths gets overwritten during parse
@added_import_paths ||= [] @added_import_paths ||= []

View File

@ -26,6 +26,13 @@ module Compass::Exec::GlobalOptionsParser
::Compass.configuration.discover Pathname.new(frameworks_dir).realpath ::Compass.configuration.discover Pathname.new(frameworks_dir).realpath
end end
opts.on('-I IMPORT_PATH',
"Makes files under the IMPORT_PATH folder findable by Sass's @import directive."
) do |import_path|
require 'pathname'
::Compass.configuration.add_import_path Pathname.new(import_path).realpath
end
opts.on('-q', '--quiet', :NONE, 'Quiet mode.') do opts.on('-q', '--quiet', :NONE, 'Quiet mode.') do
self.options[:quiet] = true self.options[:quiet] = true
end end
@ -34,7 +41,7 @@ module Compass::Exec::GlobalOptionsParser
self.options[:trace] = true self.options[:trace] = true
end end
opts.on('--force', :NONE, 'Allows some failing commands to succeed instead.') do opts.on('--force', :NONE, 'Allows compass to overwrite existing files.') do
self.options[:force] = true self.options[:force] = true
end end

View File

@ -108,7 +108,7 @@ module Compass::SassExtensions::Functions::Sprites
unless VALID_SELECTORS.include?(selector.value) unless VALID_SELECTORS.include?(selector.value)
raise Sass::SyntaxError, "Invalid Selctor did you mean one of: #{VALID_SELECTORS.join(', ')}" raise Sass::SyntaxError, "Invalid Selctor did you mean one of: #{VALID_SELECTORS.join(', ')}"
end end
Sass::Script::Bool.new map.send(:"has_#{selector.value}?", sprite) Sass::Script::Bool.new map.send(:"has_#{selector.value}?", sprite.value)
end end
Sass::Script::Functions.declare :sprite_has_selector, [:map, :sprite, :selector] Sass::Script::Functions.declare :sprite_has_selector, [:map, :sprite, :selector]

View File

@ -14,8 +14,8 @@ time, mark, audio, video {
margin: 0; margin: 0;
padding: 0; padding: 0;
border: 0; border: 0;
font-size: 100%;
font: inherit; font: inherit;
font-size: 100%;
vertical-align: baseline; } vertical-align: baseline; }
body { body {

View File

@ -240,6 +240,21 @@ EXPECTED
assert_correct expected_serialization.split("\n"), Compass.configuration.serialize.split("\n") assert_correct expected_serialization.split("\n"), Compass.configuration.serialize.split("\n")
end end
def test_additional_import_paths_can_be_importers
contents = StringIO.new(<<-CONFIG)
http_path = "/"
project_path = "/home/chris/my_compass_project"
css_dir = "css"
additional_import_paths = ["../foo"]
add_import_path Sass::Importers::Filesystem.new("/tmp/foo")
CONFIG
Compass.add_configuration(contents, "test_additional_import_paths")
assert Compass.configuration.sass_load_paths.find{|p| p.is_a?(Sass::Importers::Filesystem) && p.root == "/tmp/foo"}
assert Compass.configuration.to_sass_plugin_options[:load_paths].find{|p| p.is_a?(Sass::Importers::Filesystem) && p.root == "/tmp/foo"}
end
def test_config_with_pathname def test_config_with_pathname
contents = StringIO.new(<<-CONFIG) contents = StringIO.new(<<-CONFIG)
http_path = "/" http_path = "/"