Merge branch 'master' into no_rails_integration

This commit is contained in:
Scott Davis 2012-01-02 11:40:11 -05:00
commit 810a543400
23 changed files with 198 additions and 29 deletions

View File

@ -2,5 +2,5 @@
:major: 0
:minor: 12
:state: alpha
:build: 2
:build: 3
:name: Alnilam

View File

@ -17,12 +17,20 @@ The Documentation for the [latest preview release](http://beta.compass-style.org
0.12.alpha.3 (UNRELEASED)
-------------------------
* Removed -ms prefix from box-sizing
* Added sprite_names sass function
* Added -ms prefix to transitions
* Added support for `--debug-info` and `--no-debug-info` to compass compile
0.12.alpha.3 (12/23/2011)
-------------------------
* The `$round-to-nearest-half-line` config variable was added. When
true, the vertical rhythm module will round line heights to the
nearest half-line to avoid awkwardly large gaps between lines of text.
Defaults to false.
* Added `reset-baseline` to the vertical rhythm module so you can force the baseline to reset.
* Merges in the stable changes between 0.11.5 and 0.11.6.
0.12.alpha.2 (11/28/2011)
-------------------------
@ -61,11 +69,18 @@ The Documentation for the [latest preview release](http://beta.compass-style.org
`generated-image-url()` helper function. These should rarely be needed and
will default to your corresponding image directories and paths.
0.11.6 (UNRELEASED)
0.11.6 (12/23/2011)
-------------------
* Added `user-select` mixin to control the selection model and granularity of an element.
It accepts one argument (`$select`) from the following options: `none` | `text` | `toggle` | `element` | `elements` | `all` | `inherit`.
It accepts one argument (`$select`) from the following options:
`none` | `text` | `toggle` | `element` | `elements` | `all` | `inherit`.
* The border-image property now takes a keyword called `fill` to
indicate that the image should also fill the element. If you pass the
`fill` keyword to the `border-image` mixin it will only be output in the
standard (non-prefixed) versions of the property.
* Don't use the deprecated callback method `on_updating_stylesheet` in Sass if
the new version is available.
0.11.5 (07/10/2011)
-------------------

View File

@ -0,0 +1,29 @@
.advertisement {
padding: 8px 5px !important;
text-align: center;
line-height: 1.1em !important;
@include opacity(0);
@include transition(opacity 1s ease-in 3s);
&.visible {
@include opacity(1);
}
a:not(.pagerankspam) {
display: block;
color: white;
@extend .heading-font;
text-decoration: none;
&:hover {
@include text-shadow(0 0 2px #aaa);
}
}
.pagerankspam { font-size: 9px; }
.dark & {
@extend .code-block-dark;
img:hover { @include single-box-shadow(white); }
}
.light & {
@extend .code-block-light;
a:not(.pagerankspam) { color: #222}
img:hover { @include single-box-shadow(#222); }
}
}

View File

@ -13,6 +13,7 @@
@import "partials/nav";
@import "partials/sidebar";
@import "partials/ads";
@import "partials/main";
@import "partials/code";
@import "partials/example";
@ -25,4 +26,4 @@
html.dark { @include dark-theme(true); }
html.light { @include light-theme(true); }
html.light { @include light-theme(true); }

View File

@ -3,3 +3,8 @@
- sidebar_item ||= sidebar_item(@item)
- sidebar_item ||= reference_item(:stylesheet => @default_stylesheet)
%ul= item_tree(sidebar_item, :depth => 1, :omit_self => get_var(:omit_self){true}, :heading_level => get_var(:heading_level){1}, :heading_depth => get_var(:heading_depth){10})
.advertisement
<script type="text/javascript">(function(){ var fusion = document.createElement('script'); fusion.src = window.location.protocol + '//adn.fusionads.net/api/1.0/ad.js?zoneid=158&rand=' + Math.floor(Math.random()*9999999); fusion.async = true; (document.head || document.getElementsByTagName('head')[0]).appendChild(fusion); })(); $(function(){ $(".advertisement").addClass("visible")});</script>
#fusion_ad
%a.pagerankspam(href="http://fusionads.net") Powered by Fusion

View File

@ -17,6 +17,7 @@ $default-border-radius: 5px !default;
// .crazy { @include border-radius(1px 3px 5px 7px, 2px 4px 6px 8px)}
//
// Which generates:
//
// .simple {
// -webkit-border-radius: 4px 4px;
// -moz-border-radius: 4px / 4px;

View File

@ -8,6 +8,6 @@
@mixin box-sizing($bs) {
$bs: unquote($bs);
@include experimental(box-sizing, $bs,
-moz, -webkit, not -o, -ms, not -khtml, official
-moz, -webkit, not -o, not -ms, not -khtml, official
);
}

View File

@ -91,12 +91,12 @@
// Border image property support for vendor prefixing properties and values.
@mixin border-image($value) {
@if $experimental-support-for-mozilla { -moz-border-image: -moz(-compass-list($value)); }
@if $support-for-original-webkit-gradients { -webkit-border-image: -owg(-compass-list($value)); }
@if $experimental-support-for-webkit { -webkit-border-image: -webkit(-compass-list($value)); }
@if $experimental-support-for-opera { -o-border-image: -o(-compass-list($value)); }
@if $experimental-support-for-svg { border-image: -svg(-compass-list($value)); }
border-image: $value;
@if $experimental-support-for-mozilla { -moz-border-image: -moz(reject(-compass-list($value), fill)); }
@if $support-for-original-webkit-gradients { -webkit-border-image: -owg(reject(-compass-list($value), fill)); }
@if $experimental-support-for-webkit { -webkit-border-image: -webkit(reject(-compass-list($value), fill)); }
@if $experimental-support-for-opera { -o-border-image: -o(reject(-compass-list($value), fill)); }
@if $experimental-support-for-svg { border-image: -svg(reject(-compass-list($value), fill)); }
border-image: $value;
}
// List style image property support for vendor prefixing within values.

View File

@ -30,7 +30,7 @@ $default-transition-delay: false !default;
@mixin transition-property($properties: $default-transition-property) {
@include experimental(transition-property, unquote($properties),
-moz, -webkit, -o, not -ms, not -khtml, official
-moz, -webkit, -o, -ms, not -khtml, official
);
}
@ -42,7 +42,7 @@ $default-transition-delay: false !default;
@mixin transition-duration($duration: $default-transition-duration) {
@if type-of($duration) == string { $duration: unquote($duration); }
@include experimental(transition-duration, $duration,
-moz, -webkit, -o, not -ms, not -khtml, official
-moz, -webkit, -o, -ms, not -khtml, official
);
}
@ -54,7 +54,7 @@ $default-transition-delay: false !default;
@mixin transition-timing-function($function: $default-transition-function) {
@include experimental(transition-timing-function, unquote($function),
-moz, -webkit, -o, not -ms, not -khtml, official
-moz, -webkit, -o, -ms, not -khtml, official
);
}
@ -66,7 +66,7 @@ $default-transition-delay: false !default;
@mixin transition-delay($delay: $default-transition-delay) {
@if type-of($delay) == string { $delay: unquote($delay); }
@include experimental(transition-delay, $delay,
-moz, -webkit, -o, not -ms, not -khtml, official
-moz, -webkit, -o, -ms, not -khtml, official
);
}
@ -87,7 +87,7 @@ $default-transition-delay: false !default;
-moz,
not -webkit,
-o,
not -ms,
-ms,
not -khtml,
official
);
@ -97,7 +97,7 @@ $default-transition-delay: false !default;
-moz,
-webkit,
-o,
not -ms,
-ms,
not -khtml,
official
);
@ -128,6 +128,6 @@ $default-transition-delay: false !default;
}
$transition : compact($transition-1, $transition-2, $transition-3, $transition-4, $transition-5, $transition-6, $transition-7, $transition-8, $transition-9, $transition-10);
@include experimental(transition, $transition,
-moz, -webkit, -o, not -ms, not -khtml, official
-moz, -webkit, -o, -ms, not -khtml, official
);
}

View File

@ -22,7 +22,7 @@ $round-to-nearest-half-line: false !default;
// Ensure there is at least this many pixels
// of vertical padding above and below the text.
$min-line-padding: 2px;
$min-line-padding: 2px !default;
// $base-font-size but in your output unit of choice.
// Defaults to 1em when `$relative-font-sizing`

View File

@ -3,11 +3,13 @@
background-color: $header-color;
&.even, &:nth-child(2n) {
background-color: $header-color - $dark-intersection; } }
tr.odd {
td {
background-color: $odd-row-color;
&.even, &:nth-child(2n) {
background-color: $odd-row-color - $dark-intersection; } } }
tr {
&.odd, &:nth-child(2n+1) {
td {
background-color: $odd-row-color;
&.even, &:nth-child(2n) {
background-color: $odd-row-color - $dark-intersection; } } }
}
tr.even {
td {
background-color: $even-row-color;

View File

@ -17,6 +17,14 @@ module Compass
opts.on("--time", "Display compilation times.") do
self.options[:time] = true
end
opts.on("--debug-info", "Turns on sass's debuging information") do
self.options[:debug_info]= true
end
opts.on("--no-debug-info", "Turns on sass's debuging information") do
self.options[:debug_info]= false
end
super
end
end
@ -56,6 +64,10 @@ module Compass
compiler_opts.merge!(options)
compiler_opts[:sass_files] = explicit_sass_files
compiler_opts[:cache_location] = determine_cache_location
if options.include?(:debug_info) && options[:debug_info]
compiler_opts[:sass][:debug_info] = options.delete(:debug_info)
end
puts compiler_opts.inspect
compiler_opts
end

View File

@ -67,9 +67,13 @@ module Compass
end
end
unless @callbacks_loaded
Sass::Plugin.on_updated_stylesheet do |sass_file, css_file|
Compass.configuration.run_stylesheet_saved(css_file)
on_saved = Proc.new do |sass_file, css_file|
Compass.configuration.run_stylesheet_saved(css_file)
end
if Sass::Plugin.respond_to?(:on_updated_stylesheet)
Sass::Plugin.on_updated_stylesheet(&on_saved)
else
Sass::Plugin.on_updating_stylesheet(&on_saved)
end
Sass::Plugin.on_compilation_error do |e, filename, css|

View File

@ -74,6 +74,11 @@ module Compass::SassExtensions::Functions::Lists
Sass::Script::List.new list.values[start_index..end_index], list.separator
end
# removes the given values from the list.
def reject(list, *values)
Sass::Script::List.new(list.value.reject{|v| values.any?{|o| v == o}}, list.separator)
end
# returns the first value of a space delimited list.
def first_value_of(list)
if list.is_a?(Sass::Script::String)

View File

@ -9,6 +9,13 @@ module Compass::SassExtensions::Functions::Sprites
self[variable_name.to_s.gsub(/-/,"_")]
end
end
#Returns a list of all sprite names
def sprite_names(map)
Sass::Script::List.new(map.sprite_names.map { |f| Sass::Script::String.new(f) }, ' ')
end
Sass::Script::Functions.declare :sprite_names, [:map]
# Returns the system path of the sprite file
def sprite_path(map)
Sass::Script::String.new(map.name_and_hash)

View File

@ -0,0 +1,9 @@
.div {
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box; }
.div {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box; }

View File

@ -1,6 +1,7 @@
.single-transition-without-delay {
-webkit-transition: all 0.6s ease-out;
-moz-transition: all 0.6s ease-out;
-ms-transition: all 0.6s ease-out;
-o-transition: all 0.6s ease-out;
transition: all 0.6s ease-out; }
@ -8,5 +9,20 @@
-webkit-transition: all 0.6s ease-out;
-webkit-transition-delay: 0.2s;
-moz-transition: all 0.6s ease-out 0.2s;
-ms-transition: all 0.6s ease-out 0.2s;
-o-transition: all 0.6s ease-out 0.2s;
transition: all 0.6s ease-out 0.2s; }
.transition-duration-string {
-webkit-transition-duration: 0.2s, 0.5s, 0.2s;
-moz-transition-duration: 0.2s, 0.5s, 0.2s;
-ms-transition-duration: 0.2s, 0.5s, 0.2s;
-o-transition-duration: 0.2s, 0.5s, 0.2s;
transition-duration: 0.2s, 0.5s, 0.2s; }
.transition-duration-list {
-webkit-transition-duration: 0.2s, 0.5s, 0.2s;
-moz-transition-duration: 0.2s, 0.5s, 0.2s;
-ms-transition-duration: 0.2s, 0.5s, 0.2s;
-o-transition-duration: 0.2s, 0.5s, 0.2s;
transition-duration: 0.2s, 0.5s, 0.2s; }

View File

@ -34,3 +34,23 @@ p.light-with-args {
p.dark-with-args {
background-color: #5f1210;
color: blue; }
th {
background-color: white; }
th.even, th:nth-child(2n) {
background-color: yellow; }
tr.odd td, tr:nth-child(2n+1) td {
background-color: white; }
tr.odd td.even, tr.odd td:nth-child(2n), tr:nth-child(2n+1) td.even, tr:nth-child(2n+1) td:nth-child(2n) {
background-color: yellow; }
tr.even td {
background-color: red; }
tr.even td.even, tr.even td:nth-child(2n) {
background-color: red; }
tfoot th, tfoot td {
background-color: white; }
tfoot th.even, tfoot th:nth-child(2n), tfoot td.even, tfoot td:nth-child(2n) {
background-color: yellow; }

View File

@ -0,0 +1,8 @@
@import "compass/css3/box-sizing";
.div {
@include box-sizing(content-box);
}
.div {
@include box-sizing(border-box);
}

View File

@ -2,3 +2,5 @@
.single-transition-without-delay { @include single-transition(all, 0.6s, ease-out); }
.single-transition-with-delay { @include single-transition(all, 0.6s, ease-out, 0.2s); }
.transition-duration-string { @include transition-duration("0.2s, 0.5s, 0.2s"); }
.transition-duration-list { @include transition-duration((0.2s, 0.5s, 0.2s)); }

View File

@ -15,3 +15,6 @@ p.light { @include contrasted(#B0201E); }
p.dark { @include contrasted(#5F1210); }
p.light-with-args { @include contrasted(#B0201E, green, blue); }
p.dark-with-args { @include contrasted(#5F1210, green, blue); }
@include alternating-rows-and-columns(red, white, blue);

View File

@ -807,11 +807,37 @@ class SpritesTest < Test::Unit::TestCase
}
.colors-blue {
background-position:0 0;
}.colors-yellow {
}
.colors-yellow {
background-position:0 -10px;
}
CSS
assert_correct clean(css), clean(other_css)
end
it "should have a sprite_name function that returns the names of the sprites in a sass list" do
css = render <<-SCSS
$colors-inline:true;
@import "colors/*.png";
@each $color in sprite_names($colors-sprites) {
.\#{$color} {
width:0px;
}
}
SCSS
other_css = <<-CSS
.colors-sprite {
background-image:url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAUCAAAAACRhfOKAAAAHElEQVR42mM5wQADLP8JMRlIUIvE/IdgctLTNgCHDhEQVD4ceAAAAABJRU5ErkJggg==');
}
.blue {
width:0px;
}
.yellow {
width:0px;
}
CSS
assert_correct clean(css), clean(other_css)
end
end

View File

@ -152,6 +152,10 @@ class SassExtensionsTest < Test::Unit::TestCase
Compass::SassExtensions::Functions::ImageSize::ImageProperties.new(object)
end
def test_reject
assert_equal "b d", evaluate("reject(a b c d, a, c)")
assert_equal "a b c d", evaluate("reject(a b c d, e)")
end
protected
def evaluate(value)