From 7d9ab20be04fa948bda82febe0ed642012838d81 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 12 Jun 2010 08:02:31 -0700 Subject: [PATCH 01/81] Allow a slightly earlier version of rubygems -- to make our ubuntu users happy. --- compass.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compass.gemspec b/compass.gemspec index 20350f28..a98566a3 100644 --- a/compass.gemspec +++ b/compass.gemspec @@ -13,7 +13,7 @@ Gem::Specification.new do |gemspec| gemspec.executables = %w(compass) gemspec.has_rdoc = false gemspec.require_paths = %w(lib) - gemspec.rubygems_version = "1.3.6" + gemspec.rubygems_version = "1.3.5" gemspec.summary = %q{A Real Stylesheet Framework} gemspec.add_dependency('haml', '>= 3.0.4') gemspec.files = %w(README.markdown LICENSE.markdown VERSION.yml Rakefile) From 8dc719ac22c9dddc392d1214813ac7e464ce3486 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 8 Jul 2010 22:19:11 -0700 Subject: [PATCH 02/81] Less buggy import resolver. Closes GH-139. --- doc-src/layouts/blueprint.haml | 2 +- doc-src/layouts/core.haml | 2 +- doc-src/lib/stylesheets.rb | 33 +++++++++++++++++---------------- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/doc-src/layouts/blueprint.haml b/doc-src/layouts/blueprint.haml index b17f15a1..e1797ced 100644 --- a/doc-src/layouts/blueprint.haml +++ b/doc-src/layouts/blueprint.haml @@ -1,5 +1,5 @@ - render 'main' do %aside(role="sidebar") %nav#local-nav - %ul=item_tree(reference_item(:stylesheet => "_blueprint.scss"), :depth => 2, :omit_self => false, :heading_level => 2) + %ul=item_tree(reference_item(:stylesheet => "blueprint.scss"), :depth => 2, :omit_self => false, :heading_level => 2) %article= yield \ No newline at end of file diff --git a/doc-src/layouts/core.haml b/doc-src/layouts/core.haml index 15b59b99..b146930d 100644 --- a/doc-src/layouts/core.haml +++ b/doc-src/layouts/core.haml @@ -1,5 +1,5 @@ - render 'main' do - content_for :module_nav do - %ul= item_tree(reference_item(:stylesheet => "_compass.scss"), :depth => 1, :omit_self => true, :headings => false) + %ul= item_tree(reference_item(:stylesheet => "compass.scss"), :depth => 1, :omit_self => true, :headings => false) %aside(role="sidebar")= render 'partials/sidebar', :default_stylesheet => "_compass.scss" %article= yield \ No newline at end of file diff --git a/doc-src/lib/stylesheets.rb b/doc-src/lib/stylesheets.rb index 28c8186f..f22e86e6 100644 --- a/doc-src/lib/stylesheets.rb +++ b/doc-src/lib/stylesheets.rb @@ -30,9 +30,9 @@ end def reference_item(options) stylesheet = options[:stylesheet] - @site.cached("reference/item/#{stylesheet}") do - path = stylesheet_path(stylesheet) - if path + path = stylesheet_path(stylesheet) + if path + @site.cached("reference/item/#{path}") do @items.detect do |i| if i.identifier =~ /^\/reference/ && i[:stylesheet] i[:stylesheet] == path @@ -54,27 +54,28 @@ def reference_path(options) end def import_paths - paths = Compass::Frameworks::ALL.inject([]) {|m, f| m << f.stylesheets_directory} - paths.map!{|p|[p, '']} + paths = [] if @item[:stylesheet] paths << [File.join(Compass::Frameworks[@item[:framework]].stylesheets_directory, - File.dirname(@item[:stylesheet])), File.dirname(@item[:stylesheet])] + File.dirname(@item[:stylesheet])), + @item[:stylesheet]["/"] ? File.dirname(@item[:stylesheet]) : ""] end + + paths += Compass::Frameworks::ALL.inject([]) {|m, f| m << f.stylesheets_directory}.map!{|p|[p, '']} paths end def stylesheet_path(ss) - @site.cached("stylesheet/path/#{ss}") do - possible_names = possible_filenames_for_stylesheet(ss) - import_paths.each do |import_path| - possible_names.each do |filename| - full_path = File.join(import_path.first, filename) - if File.exist?(full_path) - return "#{import_path.last}#{"/" if import_path.last && import_path.last.length > 0}#{filename}" - end + possible_names = possible_filenames_for_stylesheet(ss) + import_paths.each do |import_path| + possible_names.each do |filename| + full_path = File.join(import_path.first, filename) + if File.exist?(full_path) + return "#{import_path.last}#{"/" if import_path.last && import_path.last.length > 0}#{filename}" end end end + nil end def possible_filenames_for_stylesheet(ss) @@ -85,9 +86,9 @@ def possible_filenames_for_stylesheet(ss) extensions = if ext.size > 0 [ext] else - [".sass", ".scss"] + [".scss", ".sass"] end - basenames = [base, "_#{base}"] + basenames = ["_#{base}", base] filenames = [] basenames.each do |basename| extensions.each do |extension| From f4a1e85f34236d57f6d87231a08c5a1434b513d9 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 8 Jul 2010 22:33:50 -0700 Subject: [PATCH 03/81] Fix confusing error scenario on windows. Closes GH-156. --- lib/compass/exec/project_options_parser.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/compass/exec/project_options_parser.rb b/lib/compass/exec/project_options_parser.rb index 6ef5471a..2209353b 100644 --- a/lib/compass/exec/project_options_parser.rb +++ b/lib/compass/exec/project_options_parser.rb @@ -13,19 +13,19 @@ module Compass::Exec::ProjectOptionsParser end opts.on('--sass-dir SRC_DIR', "The source directory where you keep your sass stylesheets.") do |sass_dir| - self.options[:sass_dir] = sass_dir + self.options[:sass_dir] = sass_dir.tr('\\','/') end opts.on('--css-dir CSS_DIR', "The target directory where you keep your css stylesheets.") do |css_dir| - self.options[:css_dir] = css_dir + self.options[:css_dir] = css_dir.tr('\\','/') end opts.on('--images-dir IMAGES_DIR', "The directory where you keep your images.") do |images_dir| - self.options[:images_dir] = images_dir + self.options[:images_dir] = images_dir.tr('\\','/') end opts.on('--javascripts-dir JS_DIR', "The directory where you keep your javascripts.") do |javascripts_dir| - self.options[:javascripts_dir] = javascripts_dir + self.options[:javascripts_dir] = javascripts_dir.tr('\\','/') end opts.on('-e ENV', '--environment ENV', [:development, :production], 'Use sensible defaults for your current environment.', From e79232a7ab2de53e56fb1ab6372e4a0093c4f4d0 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 9 Jul 2010 09:26:44 -0700 Subject: [PATCH 04/81] [Compass Core] Add missing clearfix import to horizontal-list. --- .../stylesheets/compass/utilities/lists/_horizontal-list.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss b/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss index a1c9d99f..fcc5af2f 100644 --- a/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss +++ b/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss @@ -16,6 +16,7 @@ // +horizontal-list-item @import "bullets"; +@import "compass/utilities/general/clearfix"; @import "compass/utilities/general/reset"; @import "compass/utilities/general/float"; From 31fc7015d10a724a96e6dcddc7ee572a8cc55820 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 9 Jul 2010 09:42:37 -0700 Subject: [PATCH 05/81] test case for lists. --- test/fixtures/stylesheets/compass/config.rb | 1 + .../stylesheets/compass/css/lists.css | 83 ++++++++++++++++++ .../stylesheets/compass/images/4x6.png | Bin 0 -> 875 bytes .../stylesheets/compass/sass/lists.scss | 8 ++ 4 files changed, 92 insertions(+) create mode 100644 test/fixtures/stylesheets/compass/css/lists.css create mode 100644 test/fixtures/stylesheets/compass/images/4x6.png create mode 100644 test/fixtures/stylesheets/compass/sass/lists.scss diff --git a/test/fixtures/stylesheets/compass/config.rb b/test/fixtures/stylesheets/compass/config.rb index 1b3ad842..4f5ba70d 100644 --- a/test/fixtures/stylesheets/compass/config.rb +++ b/test/fixtures/stylesheets/compass/config.rb @@ -7,3 +7,4 @@ output_style = :nested # To enable relative image paths using the images_url() function: # http_images_path = :relative http_images_path = "/images" +line_comments = false diff --git a/test/fixtures/stylesheets/compass/css/lists.css b/test/fixtures/stylesheets/compass/css/lists.css new file mode 100644 index 00000000..f14e3bd0 --- /dev/null +++ b/test/fixtures/stylesheets/compass/css/lists.css @@ -0,0 +1,83 @@ +ul.horizontal { + margin: 0; + padding: 0; + border: 0; + outline: 0; + overflow: hidden; + display: inline-block; } + ul.horizontal { + display: block; } + ul.horizontal li { + list-style-image: none; + list-style-type: none; + margin-left: 0px; + white-space: nowrap; + display: inline; + float: left; + padding-left: 4px; + padding-right: 4px; } + ul.horizontal li:first-child, ul.horizontal li.first { + padding-left: 0px; } + ul.horizontal li:last-child, ul.horizontal li.last { + padding-right: 0px; } + +ul.wide-horizontal { + margin: 0; + padding: 0; + border: 0; + outline: 0; + overflow: hidden; + display: inline-block; } + ul.wide-horizontal { + display: block; } + ul.wide-horizontal li { + list-style-image: none; + list-style-type: none; + margin-left: 0px; + white-space: nowrap; + display: inline; + float: left; + padding-left: 10px; + padding-right: 10px; } + ul.wide-horizontal li:first-child, ul.wide-horizontal li.first { + padding-left: 0px; } + ul.wide-horizontal li:last-child, ul.wide-horizontal li.last { + padding-right: 0px; } + +ul.inline { + list-style-type: none; + margin: 0px; + padding: 0px; + display: inline; } + ul.inline li { + margin: 0px; + padding: 0px; + display: inline; } + +ul.comma { + list-style-type: none; + margin: 0px; + padding: 0px; + display: inline; } + ul.comma li { + margin: 0px; + padding: 0px; + display: inline; } + ul.comma li:after { + content: ", "; } + ul.comma li:last-child:after, ul.comma li.last:after { + content: ""; } + +ul.no-bullets { + list-style: none; } + ul.no-bullets li { + list-style-image: none; + list-style-type: none; + margin-left: 0px; } + +ul.pretty { + margin-left: 0; } + ul.pretty li { + padding-left: 14px; + background: url('/images/4x6.png?1278693488') no-repeat 4px 7px; + list-style-type: none; } diff --git a/test/fixtures/stylesheets/compass/images/4x6.png b/test/fixtures/stylesheets/compass/images/4x6.png new file mode 100644 index 0000000000000000000000000000000000000000..1c57ddfe7950f577c6178ddd07949fd155ef8107 GIT binary patch literal 875 zcmV-x1C;!UP)4Tx0C)j~RL^S@K@|QrZmG~B2wH0nvUrdpNm;9CMbtL^5n^i$+aIn^?(HA4aZWV5ov6ELTdbo0FI&wK{O>*+w4vx20?>!`FrQsdJlnHR>OPy zcd~b_n$otK2Za4V;76L-DzNVtaSB-y0*E}{p()372;bw_^6ZZ}PI-92wGS&j#91PI zKs7DSe@(bk%_Y-7gGe}(^>I=@oY#w#*Bu9GZf3^F5WP>3rn}7Ut74&?PWBFvy`A)a zPP5)V!Xd&78LdA?xQ(9mjMYElVd13a#D+Z_7&Y|xU=_C-srWU*6kiZcC!$nw*)9$7 zn6CX+@=AhmkT}X@VSsa5NKe;HZuq)~1$`#h6R+ZTR#D-3j}vF!)ZOnz+5)dI4jl{{ z44Mr{P!L4~VVJN`K!!XTF*LGrKO?IK8z<8w`3e3jI8lUGNUta*C8 zn(P`s>{pjD=7Kek#B;Fw@hxAK%$F&Q6vg9J^Xf~4by_hu-=A!MJ3Znq&n~srbFGPs zH&&aMXZ>nO`|hf|ljc?VPhR!${AbO?W8x_>CU%PFA&Hm8F7cAsOREdwU~R_;ot1_u z(ruCYB-LPGn!NQdT|ZlRy+(fw^-+`=%+gee_kY4FWHg<*4sZI8+sFJD270UUORdLHO0nA4V) z%{fwsET5CQ>B?eK%uw4yQc~9?*JVo2}ze(;aRcp*ceL#HUJSllrgm5wQKR zQu+C;QrUh^8rFfA`ftFz{YAidi-`aL010qNS#tmY3ljhU3ljkVnw%H_001LNL_t&t z9b>SxwEX}7e|ma4kc6-q(D*<(24r~%8>9+NF980|FCFU+_^AK@002ovPDHLkV1iYs Bn~eYf literal 0 HcmV?d00001 diff --git a/test/fixtures/stylesheets/compass/sass/lists.scss b/test/fixtures/stylesheets/compass/sass/lists.scss new file mode 100644 index 00000000..f9acf4b4 --- /dev/null +++ b/test/fixtures/stylesheets/compass/sass/lists.scss @@ -0,0 +1,8 @@ +@import "compass/utilities/lists"; + +ul.horizontal { @include horizontal-list; } +ul.wide-horizontal { @include horizontal-list(10px); } +ul.inline { @include inline-list; } +ul.comma { @include comma-delimited-list; } +ul.no-bullets { @include no-bullets; } +ul.pretty { @include pretty-bullets("4x6.png"); } \ No newline at end of file From c60cf4fda5226973997cd1f117be398e7febbcb4 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 9 Jul 2010 09:46:24 -0700 Subject: [PATCH 06/81] [Compass Core] Emit less css for inline lists with the same result. --- .../compass/utilities/lists/_inline-list.scss | 20 +++++++++---------- .../stylesheets/compass/css/lists.css | 14 ++++--------- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss b/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss index 329b5b30..6a26f1b4 100644 --- a/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss +++ b/frameworks/compass/stylesheets/compass/utilities/lists/_inline-list.scss @@ -2,18 +2,17 @@ @mixin inline-list { list-style-type: none; - margin: 0px; - padding: 0px; - display: inline; - li { + &, & li { margin: 0px; padding: 0px; - display: inline; } } + display: inline; + } +} // makes an inline list that is comma delimited. // Please make note of the browser support issues before using this mixin. // -// use of `:content` and `:after` is not fully supported in all browsers. +// use of `content` and `:after` is not fully supported in all browsers. // See quirksmode for the [support matrix](http://www.quirksmode.org/css/contents.html#t15) // // `:last-child` is not fully supported. @@ -22,8 +21,9 @@ @mixin comma-delimited-list { @include inline-list; li { - &:after { - content: ", "; } + &:after { content: ", "; } &:last-child, &.last { - &:after { - content: ""; } } } } + &:after { content: ""; } + } + } +} diff --git a/test/fixtures/stylesheets/compass/css/lists.css b/test/fixtures/stylesheets/compass/css/lists.css index f14e3bd0..e231f011 100644 --- a/test/fixtures/stylesheets/compass/css/lists.css +++ b/test/fixtures/stylesheets/compass/css/lists.css @@ -45,21 +45,15 @@ ul.wide-horizontal { padding-right: 0px; } ul.inline { - list-style-type: none; - margin: 0px; - padding: 0px; - display: inline; } - ul.inline li { + list-style-type: none; } + ul.inline, ul.inline li { margin: 0px; padding: 0px; display: inline; } ul.comma { - list-style-type: none; - margin: 0px; - padding: 0px; - display: inline; } - ul.comma li { + list-style-type: none; } + ul.comma, ul.comma li { margin: 0px; padding: 0px; display: inline; } From fe056d659787f8a16a0f96b9d681f0c63c963bd1 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 9 Jul 2010 17:53:22 -0700 Subject: [PATCH 07/81] [Core] Rename the grad-opposite-position() helper to opposite-position() and expose it as part of the core library. --- .../reference/compass/helpers/constants.haml | 31 +++++++++++++++++++ .../stylesheets/compass/css3/_gradient.scss | 2 +- lib/compass/sass_extensions/functions.rb | 3 +- .../sass_extensions/functions/constants.rb | 17 ++++++++++ .../functions/gradient_support.rb | 16 ---------- 5 files changed, 51 insertions(+), 18 deletions(-) create mode 100644 doc-src/content/reference/compass/helpers/constants.haml create mode 100644 lib/compass/sass_extensions/functions/constants.rb diff --git a/doc-src/content/reference/compass/helpers/constants.haml b/doc-src/content/reference/compass/helpers/constants.haml new file mode 100644 index 00000000..b619dfe4 --- /dev/null +++ b/doc-src/content/reference/compass/helpers/constants.haml @@ -0,0 +1,31 @@ +--- +title: Compass Constant Helpers +crumb: Constants +framework: compass +meta_description: Helper functions for working with constants. +layout: core +classnames: + - reference + - core + - helpers +--- +%h1 Compass Constant Helpers + +:markdown + These helpers manipulate CSS Constants. + +#opposite-position.helper + %h3 + %a(href="#opposite-position") + opposite-position($position) + .details + :markdown + Returns the opposition position for the position given. Examples: + + Input Output + ------------------------------- ------------ + opposite-position(left) => right + opposite-position(top) => bottom + opposite-position(center) => center + opposite-position(top left) => bottom right + opposite-position(center right) => center left diff --git a/frameworks/compass/stylesheets/compass/css3/_gradient.scss b/frameworks/compass/stylesheets/compass/css3/_gradient.scss index fb78563d..d5f996a2 100644 --- a/frameworks/compass/stylesheets/compass/css3/_gradient.scss +++ b/frameworks/compass/stylesheets/compass/css3/_gradient.scss @@ -37,7 +37,7 @@ $background: unquote(""); @if $image { $background : $image + unquote(", "); } $start: unquote($start); - $end: grad-opposite-position($start); + $end: opposite-position($start); @if $experimental-support-for-webkit { background-image: #{$background}-webkit-gradient(linear, grad-point($start), grad-point($end), grad-color-stops($color-stops)); } diff --git a/lib/compass/sass_extensions/functions.rb b/lib/compass/sass_extensions/functions.rb index cc827748..0641b79c 100644 --- a/lib/compass/sass_extensions/functions.rb +++ b/lib/compass/sass_extensions/functions.rb @@ -1,7 +1,7 @@ module Compass::SassExtensions::Functions end -%w(selectors enumerate urls display inline_image image_size gradient_support font_files).each do |func| +%w(selectors enumerate urls display inline_image image_size gradient_support font_files constants).each do |func| require "compass/sass_extensions/functions/#{func}" end @@ -14,6 +14,7 @@ module Sass::Script::Functions include Compass::SassExtensions::Functions::ImageSize include Compass::SassExtensions::Functions::GradientSupport::Functions include Compass::SassExtensions::Functions::FontFiles + include Compass::SassExtensions::Functions::Constants end # Wierd that this has to be re-included to pick up sub-modules. Ruby bug? diff --git a/lib/compass/sass_extensions/functions/constants.rb b/lib/compass/sass_extensions/functions/constants.rb new file mode 100644 index 00000000..4f3e34f8 --- /dev/null +++ b/lib/compass/sass_extensions/functions/constants.rb @@ -0,0 +1,17 @@ +module Compass::SassExtensions::Functions::Constants + # returns the opposite position of a side or corner. + def opposite_position(position) + opposite = position.value.split(/ +/).map do |pos| + case pos + when "top" then "bottom" + when "bottom" then "top" + when "left" then "right" + when "right" then "left" + when "center" then "center" + else + raise Sass::SyntaxError, "Cannot determine the opposite of #{pos}" + end + end + Sass::Script::String.new(opposite.join(" "), position.type) + end +end diff --git a/lib/compass/sass_extensions/functions/gradient_support.rb b/lib/compass/sass_extensions/functions/gradient_support.rb index 16b3b8b4..90112c04 100644 --- a/lib/compass/sass_extensions/functions/gradient_support.rb +++ b/lib/compass/sass_extensions/functions/gradient_support.rb @@ -36,22 +36,6 @@ module Compass::SassExtensions::Functions::GradientSupport end module Functions - # returns the opposite position of a side or corner. - def grad_opposite_position(position) - opposite = position.value.split(/ +/).map do |pos| - case pos - when "top" then "bottom" - when "bottom" then "top" - when "left" then "right" - when "right" then "left" - when "center" then "center" - else - raise Sass::SyntaxError, "Cannot determine the opposite of #{pos}" - end - end - Sass::Script::String.new(opposite.join(" ")) - end - # returns color-stop() calls for use in webkit. def grad_color_stops(color_list) assert_list(color_list) From a220678a5acf41ae6af6e4e74cf9da1bfda2ef09 Mon Sep 17 00:00:00 2001 From: Milo Date: Fri, 9 Jul 2010 17:54:50 -0700 Subject: [PATCH 08/81] [Compass Core] Allow horizontal lists to be floated to the right. --- .../utilities/lists/_horizontal-list.scss | 18 +++++++-------- .../stylesheets/compass/css/lists.css | 23 +++++++++++++++++++ .../stylesheets/compass/sass/lists.scss | 13 ++++++----- 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss b/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss index fcc5af2f..5e98b718 100644 --- a/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss +++ b/frameworks/compass/stylesheets/compass/utilities/lists/_horizontal-list.scss @@ -32,21 +32,21 @@ // :last-child is not fully supported // see http://www.quirksmode.org/css/contents.html#t29 for the support matrix -@mixin horizontal-list-item($padding: 4px) { +@mixin horizontal-list-item($padding: 4px, $direction: left) { @include no-bullet; white-space: nowrap; - @include float-left; + @include float($direction); padding: { left: $padding; - right: $padding; }; - &:first-child, &.first { - padding-left: 0px; } - &:last-child, &.last { - padding-right: 0px; } } + right: $padding; + }; + &:first-child, &.first { padding-#{$direction}: 0px; } + &:last-child, &.last { padding-#{opposite-position($direction)}: 0px; } +} // A list(ol,ul) that is layed out such that the elements are floated left and won't wrap. // This is not an inline list. -@mixin horizontal-list($padding: 4px) { +@mixin horizontal-list($padding: 4px, $direction: left) { @include horizontal-list-container; li { - @include horizontal-list-item($padding); } } + @include horizontal-list-item($padding, $direction); } } diff --git a/test/fixtures/stylesheets/compass/css/lists.css b/test/fixtures/stylesheets/compass/css/lists.css index e231f011..1373fc93 100644 --- a/test/fixtures/stylesheets/compass/css/lists.css +++ b/test/fixtures/stylesheets/compass/css/lists.css @@ -44,6 +44,29 @@ ul.wide-horizontal { ul.wide-horizontal li:last-child, ul.wide-horizontal li.last { padding-right: 0px; } +ul.right-horizontal { + margin: 0; + padding: 0; + border: 0; + outline: 0; + overflow: hidden; + display: inline-block; } + ul.right-horizontal { + display: block; } + ul.right-horizontal li { + list-style-image: none; + list-style-type: none; + margin-left: 0px; + white-space: nowrap; + display: inline; + float: right; + padding-left: 4px; + padding-right: 4px; } + ul.right-horizontal li:first-child, ul.right-horizontal li.first { + padding-right: 0px; } + ul.right-horizontal li:last-child, ul.right-horizontal li.last { + padding-left: 0px; } + ul.inline { list-style-type: none; } ul.inline, ul.inline li { diff --git a/test/fixtures/stylesheets/compass/sass/lists.scss b/test/fixtures/stylesheets/compass/sass/lists.scss index f9acf4b4..3d9b1de6 100644 --- a/test/fixtures/stylesheets/compass/sass/lists.scss +++ b/test/fixtures/stylesheets/compass/sass/lists.scss @@ -1,8 +1,9 @@ @import "compass/utilities/lists"; -ul.horizontal { @include horizontal-list; } -ul.wide-horizontal { @include horizontal-list(10px); } -ul.inline { @include inline-list; } -ul.comma { @include comma-delimited-list; } -ul.no-bullets { @include no-bullets; } -ul.pretty { @include pretty-bullets("4x6.png"); } \ No newline at end of file +ul.horizontal { @include horizontal-list; } +ul.wide-horizontal { @include horizontal-list(10px); } +ul.right-horizontal { @include horizontal-list(4px, right); } +ul.inline { @include inline-list; } +ul.comma { @include comma-delimited-list; } +ul.no-bullets { @include no-bullets; } +ul.pretty { @include pretty-bullets("4x6.png"); } \ No newline at end of file From 1f1c88382d3a1d4db7520be37f04bc8d39869b10 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 10 Jul 2010 00:08:01 -0700 Subject: [PATCH 09/81] Update CHANGELOG --- doc-src/content/CHANGELOG.markdown | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 5343eadb..2347b950 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -7,6 +7,16 @@ layout: article COMPASS CHANGELOG ================= +0.10.3 (Unreleased) +------------------- +* [Compass Core] Add missing clearfix import to horizontal-list. +* [Compass Core] Emit less css for inline lists with the same result. +* [Compass Core] New helper `opposite-position($position)` returns the opposite value of a position. [Documentation](http://compass-style.org/docs/reference/compass/helpers/constants/) +* [Compass Core] Allow horizontal lists to be floated to the right. + +*Contributors:* +* [Milo Winningham](http://github.com/quadule) + 0.10.2 (May 31, 2010) --------------------- From acffc9fd7379951e67f7fb1bf354d117d261e001 Mon Sep 17 00:00:00 2001 From: Max Baumann Date: Tue, 22 Jun 2010 10:07:59 -0700 Subject: [PATCH 10/81] bugfix for inline-font-files helper path variable isn't an argument to this function - deleted unnecessary line causing error --- lib/compass/sass_extensions/functions/inline_image.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/compass/sass_extensions/functions/inline_image.rb b/lib/compass/sass_extensions/functions/inline_image.rb index 257de327..e005e315 100644 --- a/lib/compass/sass_extensions/functions/inline_image.rb +++ b/lib/compass/sass_extensions/functions/inline_image.rb @@ -10,7 +10,6 @@ module Compass::SassExtensions::Functions::InlineImage def inline_font_files(*args) raise Sass::SyntaxError, "An even number of arguments must be passed to font_files()" unless args.size % 2 == 0 - path = path.value files = [] while args.size > 0 path = args.shift.value From 24a25b5bba71712fa13b9c5d4e06ac4137e94204 Mon Sep 17 00:00:00 2001 From: jonathanpberger Date: Thu, 10 Jun 2010 14:09:53 -0400 Subject: [PATCH 11/81] [Blueprint] Extract two blueprint colors to make them configurable: * $blueprint_background_color * $blueprint_alt_text_color --- frameworks/blueprint/stylesheets/blueprint/_colors.scss | 1 + frameworks/blueprint/stylesheets/blueprint/_typography.scss | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frameworks/blueprint/stylesheets/blueprint/_colors.scss b/frameworks/blueprint/stylesheets/blueprint/_colors.scss index 78834abd..6817a2d4 100644 --- a/frameworks/blueprint/stylesheets/blueprint/_colors.scss +++ b/frameworks/blueprint/stylesheets/blueprint/_colors.scss @@ -3,6 +3,7 @@ $quiet_color: $font_color + #333333 !default; $loud_color: $font_color - #222222 !default; $header_color: $font_color - #111111 !default; $alt_text_color: #666666 !default; +$blueprint_background_color: #eeeeee !default; $link_color: #000099 !default; $link_hover_color: black !default; diff --git a/frameworks/blueprint/stylesheets/blueprint/_typography.scss b/frameworks/blueprint/stylesheets/blueprint/_typography.scss index c4264a97..ec095fc8 100644 --- a/frameworks/blueprint/stylesheets/blueprint/_typography.scss +++ b/frameworks/blueprint/stylesheets/blueprint/_typography.scss @@ -75,14 +75,14 @@ $blueprint-font-size: 12px !default; img.right { @include float-right; margin: 1.5em 0 1.5em 1.5em; padding: 0; } } a { text-decoration: underline; @include link-colors($link-color, $link-hover-color, $link-active-color, $link-visited-color, $link-focus-color); } - blockquote { margin: 1.5em; color: #666666; font-style: italic; } + blockquote { margin: 1.5em; color: $alt_text_color; font-style: italic; } strong { font-weight: bold; } em { font-style: italic; } dfn { font-style: italic; font-weight: bold; } sup, sub { line-height: 0; } abbr, acronym { border-bottom: 1px dotted #666666; } address { margin: 0 0 1.5em; font-style: italic; } - del { color: #666666; } + del { color: $alt_text_color; } pre { margin: 1.5em 0; white-space: pre; } pre, code, tt { @include fixed-width-text; } li ul, li ol { margin: 0; } @@ -98,7 +98,7 @@ $blueprint-font-size: 12px !default; th, td, caption { padding: 4px 10px 4px 5px; } tr.even td { background: $blueprint-table-stripe-color; } tfoot { font-style: italic; } - caption { background: #eeeeee; } + caption { background: $blueprint_background_color; } .quiet { @include quiet; } .loud { @include loud; } } From a6c22c32bed440568f9c5c91ff6e72a636f5acca Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 10 Jul 2010 13:44:17 -0700 Subject: [PATCH 12/81] [Docs] Always dasherize variables in the docs. --- doc-src/lib/stylesheets.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/doc-src/lib/stylesheets.rb b/doc-src/lib/stylesheets.rb index f22e86e6..b92e48d6 100644 --- a/doc-src/lib/stylesheets.rb +++ b/doc-src/lib/stylesheets.rb @@ -126,6 +126,7 @@ def constants(item) if child.is_a?(Sass::Tree::VariableNode) child.comment = comment && Sass::Tree::CommentNode.clean(comment) comment = nil + child.name.tr!("_",'-') constants << child elsif child.is_a?(Sass::Tree::CommentNode) comment ||= "" From 605e58d543c8b6c62b91aad0b4291731cc41215d Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 10 Jul 2010 13:57:13 -0700 Subject: [PATCH 13/81] Update CHANGELOG --- doc-src/content/CHANGELOG.markdown | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 2347b950..ae0ed898 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -13,9 +13,12 @@ COMPASS CHANGELOG * [Compass Core] Emit less css for inline lists with the same result. * [Compass Core] New helper `opposite-position($position)` returns the opposite value of a position. [Documentation](http://compass-style.org/docs/reference/compass/helpers/constants/) * [Compass Core] Allow horizontal lists to be floated to the right. +* [Compass Core] Bugfix for inline-font-files helper. +* [Blueprint] Two colors used in typography can now be customized. *Contributors:* * [Milo Winningham](http://github.com/quadule) +* [jonathanpberger](http://github.com/jonathanpberger) 0.10.2 (May 31, 2010) --------------------- From 389a13d05fdd501b0519308dcbb408804c7c9bca Mon Sep 17 00:00:00 2001 From: Stephan Kaag Date: Wed, 9 Jun 2010 11:39:08 +0200 Subject: [PATCH 14/81] [Blueprint] add support for input[type=email] --- frameworks/blueprint/stylesheets/blueprint/_form.scss | 4 +++- test/fixtures/stylesheets/blueprint/css/screen.css | 8 ++++---- .../stylesheets/blueprint/css/single-imports/form.css | 8 ++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/frameworks/blueprint/stylesheets/blueprint/_form.scss b/frameworks/blueprint/stylesheets/blueprint/_form.scss index f4256446..fe4afe38 100644 --- a/frameworks/blueprint/stylesheets/blueprint/_form.scss +++ b/frameworks/blueprint/stylesheets/blueprint/_form.scss @@ -21,6 +21,7 @@ input { &.text, &.title, + &[type=email], &[type=text], &[type=password] { margin: 0.5em 0; background-color: white; padding: 5px; } &.title { font-size: 1.5em; } @@ -42,6 +43,7 @@ input { &.text, &.title, + &[type=email], &[type=text], &[type=password] { width: $input_width; } } @@ -56,7 +58,7 @@ ) { fieldset { border: 1px solid $fieldset_border_color; } - input.text, input.title, input[type=text], input[type=password], + input.text, input.title, input[type=email], input[type=text], input[type=password], textarea, select { border: 1px solid $unfocused_border_color; &:focus { diff --git a/test/fixtures/stylesheets/blueprint/css/screen.css b/test/fixtures/stylesheets/blueprint/css/screen.css index 365ced83..6d99c1f7 100644 --- a/test/fixtures/stylesheets/blueprint/css/screen.css +++ b/test/fixtures/stylesheets/blueprint/css/screen.css @@ -726,7 +726,7 @@ legend { font-weight: bold; font-size: 1.2em; } -input.text, input.title, input[type=text], input[type=password] { +input.text, input.title, input[type=email], input[type=text], input[type=password] { margin: 0.5em 0; background-color: white; padding: 5px; } @@ -746,14 +746,14 @@ select { fieldset { border: 1px solid #cccccc; } -input.text, input.title, input[type=text], input[type=password], +input.text, input.title, input[type=email], input[type=text], input[type=password], textarea, select { border: 1px solid #bbbbbb; } - input.text:focus, input.title:focus, input[type=text]:focus, input[type=password]:focus, + input.text:focus, input.title:focus, input[type=email]:focus, input[type=text]:focus, input[type=password]:focus, textarea:focus, select:focus { border: 1px solid #666666; } -input.text, input.title, input[type=text], input[type=password] { +input.text, input.title, input[type=email], input[type=text], input[type=password] { width: 300px; } textarea { diff --git a/test/fixtures/stylesheets/blueprint/css/single-imports/form.css b/test/fixtures/stylesheets/blueprint/css/single-imports/form.css index 0f1134bf..53269641 100644 --- a/test/fixtures/stylesheets/blueprint/css/single-imports/form.css +++ b/test/fixtures/stylesheets/blueprint/css/single-imports/form.css @@ -11,7 +11,7 @@ form.bp fieldset { form.bp legend { font-weight: bold; font-size: 1.2em; } -form.bp input.text, form.bp input.title, form.bp input[type=text], form.bp input[type=password] { +form.bp input.text, form.bp input.title, form.bp input[type=email], form.bp input[type=text], form.bp input[type=password] { margin: 0.5em 0; background-color: white; padding: 5px; } @@ -27,13 +27,13 @@ form.bp select { margin: 0.5em 0; } form.bp fieldset { border: 1px solid #cccccc; } -form.bp input.text, form.bp input.title, form.bp input[type=text], form.bp input[type=password], +form.bp input.text, form.bp input.title, form.bp input[type=email], form.bp input[type=text], form.bp input[type=password], form.bp textarea, form.bp select { border: 1px solid #bbbbbb; } - form.bp input.text:focus, form.bp input.title:focus, form.bp input[type=text]:focus, form.bp input[type=password]:focus, + form.bp input.text:focus, form.bp input.title:focus, form.bp input[type=email]:focus, form.bp input[type=text]:focus, form.bp input[type=password]:focus, form.bp textarea:focus, form.bp select:focus { border: 1px solid #666666; } -form.bp input.text, form.bp input.title, form.bp input[type=text], form.bp input[type=password] { +form.bp input.text, form.bp input.title, form.bp input[type=email], form.bp input[type=text], form.bp input[type=password] { width: 300px; } form.bp textarea { width: 390px; From 327f542acf1a45f4b6627882aeb3d3bac3b4cd23 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 11 Jul 2010 15:00:02 -0700 Subject: [PATCH 15/81] Work around test failures due to timestamp changes. --- test/fixtures/stylesheets/compass/config.rb | 4 ++++ test/fixtures/stylesheets/compass/css/lists.css | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/test/fixtures/stylesheets/compass/config.rb b/test/fixtures/stylesheets/compass/config.rb index 4f5ba70d..141d3aed 100644 --- a/test/fixtures/stylesheets/compass/config.rb +++ b/test/fixtures/stylesheets/compass/config.rb @@ -8,3 +8,7 @@ output_style = :nested # http_images_path = :relative http_images_path = "/images" line_comments = false + +asset_cache_buster do |path, file| + "busted=true" +end diff --git a/test/fixtures/stylesheets/compass/css/lists.css b/test/fixtures/stylesheets/compass/css/lists.css index 1373fc93..7909e445 100644 --- a/test/fixtures/stylesheets/compass/css/lists.css +++ b/test/fixtures/stylesheets/compass/css/lists.css @@ -96,5 +96,5 @@ ul.pretty { margin-left: 0; } ul.pretty li { padding-left: 14px; - background: url('/images/4x6.png?1278693488') no-repeat 4px 7px; + background: url('/images/4x6.png?busted=true') no-repeat 4px 7px; list-style-type: none; } From 3c64945b2e575d382333968a15844655464c37ac Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 11 Jul 2010 15:08:51 -0700 Subject: [PATCH 16/81] Update CHANGELOG --- doc-src/content/CHANGELOG.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index ae0ed898..b2b148d2 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -15,10 +15,12 @@ COMPASS CHANGELOG * [Compass Core] Allow horizontal lists to be floated to the right. * [Compass Core] Bugfix for inline-font-files helper. * [Blueprint] Two colors used in typography can now be customized. +* [Blueprint] Support for inputs of type email. *Contributors:* * [Milo Winningham](http://github.com/quadule) * [jonathanpberger](http://github.com/jonathanpberger) +* [Stephan Kaag](http://github.com/stephankaag) 0.10.2 (May 31, 2010) --------------------- From 025a9243b1fd2a743458737a9138abe5d8e1bed5 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 17 Jul 2010 23:43:53 -0700 Subject: [PATCH 17/81] http://nicewebtype.com/notes/2010/05/20/bulletproof-smiley-font-face-syntax/ --- frameworks/compass/stylesheets/compass/css3/_font-face.scss | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frameworks/compass/stylesheets/compass/css3/_font-face.scss b/frameworks/compass/stylesheets/compass/css3/_font-face.scss index 42cb0399..36051e09 100644 --- a/frameworks/compass/stylesheets/compass/css3/_font-face.scss +++ b/frameworks/compass/stylesheets/compass/css3/_font-face.scss @@ -16,9 +16,9 @@ @if $eot { src: font-url($eot); } @if $postscript { - src: local("#{$name}"), local("#{$postscript}"), #{$font-files}; } + src: local("☺"), local("#{$postscript}"), #{$font-files}; } @else { - src: local("#{$name}"), #{$font-files}; } } } + src: local("☺"), #{$font-files}; } } } // EXAMPLE // +font-face("this name", font-files("this.woff", "woff", "this.otf", "opentype"), "this.eot", "thisname") From ea355b8cf020a7c6403a74a5a82126c883cfd032 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 18 Jul 2010 00:11:00 -0700 Subject: [PATCH 18/81] [Command Line] Fixed a display issue when the filenames were shorter than the total label in the compass stats tool --- lib/compass/commands/project_stats.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/compass/commands/project_stats.rb b/lib/compass/commands/project_stats.rb index 81f958c9..7e7987a0 100644 --- a/lib/compass/commands/project_stats.rb +++ b/lib/compass/commands/project_stats.rb @@ -33,13 +33,14 @@ module Compass require 'compass/stats' compiler = new_compiler_instance sass_files = sorted_sass_files(compiler) + total_label = "Total (#{sass_files.size} files):" rows = [[ :-, :-, :-, :-, :-, :-, :- ], [ 'Filename', 'Rules', 'Properties', 'Mixins Defs', 'Mixins Used', 'CSS Rules', 'CSS Properties' ], [ :-, :-, :-, :-, :-, :-, :- ]] - maximums = [ 8, 5, 10, 14, 11, 9, 14 ] + maximums = [ total_label.length, 5, 10, 14, 11, 9, 14 ] alignments = [ :left, :right, :right, :right, :right, :right, :right ] delimiters = [ ['| ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'], [' ', ' |'] ] - totals = [ "Total (#{sass_files.size} files):", 0, 0, 0, 0, 0, 0 ] + totals = [ total_label, 0, 0, 0, 0, 0, 0 ] sass_files.each do |sass_file| css_file = compiler.corresponding_css_file(sass_file) unless sass_file[0..0] == '_' From 63d0acc2ac5452c7605261bb9a98f6a1e4ccf61d Mon Sep 17 00:00:00 2001 From: Eric Meyer Date: Sun, 18 Jul 2010 15:17:40 -0600 Subject: [PATCH 19/81] no prefixes on opacity --- .../compass/stylesheets/compass/css3/_opacity.scss | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/frameworks/compass/stylesheets/compass/css3/_opacity.scss b/frameworks/compass/stylesheets/compass/css3/_opacity.scss index 91bc8359..22c618ed 100644 --- a/frameworks/compass/stylesheets/compass/css3/_opacity.scss +++ b/frameworks/compass/stylesheets/compass/css3/_opacity.scss @@ -6,13 +6,12 @@ // A number between 0 and 1, where 0 is transparent and 1 is opaque. @mixin opacity($opacity) { - // XXX consider only using the official property. I think -moz, -webkit, and -o support it. @include experimental(opacity, $opacity, - -moz, - -webkit, - -o, + not -moz, + not -webkit, + not -o, not -ms, // microsoft uses the filters below instead - -khtml, + not -khtml, official ); @if $experimental-support-for-microsoft { From 732dead236840b40bc553d286481d6db478b43eb Mon Sep 17 00:00:00 2001 From: Eric Meyer Date: Sun, 18 Jul 2010 15:20:24 -0600 Subject: [PATCH 20/81] dont need to call experimental for official-only --- .../compass/stylesheets/compass/css3/_opacity.scss | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/frameworks/compass/stylesheets/compass/css3/_opacity.scss b/frameworks/compass/stylesheets/compass/css3/_opacity.scss index 22c618ed..38093c6a 100644 --- a/frameworks/compass/stylesheets/compass/css3/_opacity.scss +++ b/frameworks/compass/stylesheets/compass/css3/_opacity.scss @@ -6,14 +6,7 @@ // A number between 0 and 1, where 0 is transparent and 1 is opaque. @mixin opacity($opacity) { - @include experimental(opacity, $opacity, - not -moz, - not -webkit, - not -o, - not -ms, // microsoft uses the filters below instead - not -khtml, - official - ); + opacity: $opacity; @if $experimental-support-for-microsoft { $value: unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=#{round($opacity * 100)})"); @include experimental(filter, $value, From b85c6f68f53f870d4555c9f9c4f16af6b646b69b Mon Sep 17 00:00:00 2001 From: Eric Meyer Date: Sun, 18 Jul 2010 15:40:31 -0600 Subject: [PATCH 21/81] smiley font-face --- .../stylesheets/compass/css3/_font-face.scss | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/frameworks/compass/stylesheets/compass/css3/_font-face.scss b/frameworks/compass/stylesheets/compass/css3/_font-face.scss index 36051e09..783b0275 100644 --- a/frameworks/compass/stylesheets/compass/css3/_font-face.scss +++ b/frameworks/compass/stylesheets/compass/css3/_font-face.scss @@ -6,29 +6,25 @@ // * $font-files is required using font-files('relative/location', 'format'). // for best results use this order: woff, opentype/truetype, svg // * $eot is required by IE, and is a relative location of the eot file. -// * postscript name is required by some browsers to look for local fonts. -@mixin font-face($name, $font-files, $eot: false, $postscript: false, $style: false) { +@mixin font-face($name, $font-files, $eot: false) { @font-face { - font-family: "#{$name}"; - @if $style { - font-style: $style; } + font-family: quote($name); @if $eot { src: font-url($eot); } - @if $postscript { - src: local("☺"), local("#{$postscript}"), #{$font-files}; } - @else { - src: local("☺"), #{$font-files}; } } } + src: local("☺"), $font-files; + } +} // EXAMPLE -// +font-face("this name", font-files("this.woff", "woff", "this.otf", "opentype"), "this.eot", "thisname") +// +font-face("this name", font-files("this.woff", "woff", "this.otf", "opentype"), "this.eot") // // will generate: // // @font-face { // font-family: 'this name'; // src: url('fonts/this.eot'); -// src: local('this name'), local('thisname'), -// url('this.otf') format('woff'), -// url('this.woff') format('opentype'); +// src: local("☺"), +// url('fonts/this.otf') format('woff'), +// url('fonts/this.woff') format('opentype'); // } From 6289fa1de1551e116c4d1e49ec6c9f27a61e178f Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Tue, 20 Jul 2010 01:23:34 -0700 Subject: [PATCH 22/81] [Compass Core] Fixed a bug in inlint-font-files(). --- lib/compass/sass_extensions/functions/inline_image.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/compass/sass_extensions/functions/inline_image.rb b/lib/compass/sass_extensions/functions/inline_image.rb index e005e315..515804c3 100644 --- a/lib/compass/sass_extensions/functions/inline_image.rb +++ b/lib/compass/sass_extensions/functions/inline_image.rb @@ -14,14 +14,14 @@ module Compass::SassExtensions::Functions::InlineImage while args.size > 0 path = args.shift.value real_path = File.join(Compass.configuration.fonts_path, path) - url = "url('data:#{compute_mime_type(path,mime_type)};base64,#{data(real_path)}')" + url = "url('data:#{compute_mime_type(path)};base64,#{data(real_path)}')" files << "#{url} format('#{args.shift}')" end Sass::Script::String.new(files.join(", ")) end private - def compute_mime_type(path, mime_type) + def compute_mime_type(path, mime_type = nil) return mime_type if mime_type case path when /\.png$/i From f0d80d789fe6979698ca9dd617493e0fff9fed01 Mon Sep 17 00:00:00 2001 From: Eric Meyer Date: Sun, 18 Jul 2010 15:51:01 -0600 Subject: [PATCH 23/81] official gradient syntax --- frameworks/compass/stylesheets/compass/css3/_gradient.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/frameworks/compass/stylesheets/compass/css3/_gradient.scss b/frameworks/compass/stylesheets/compass/css3/_gradient.scss index d5f996a2..e60209da 100644 --- a/frameworks/compass/stylesheets/compass/css3/_gradient.scss +++ b/frameworks/compass/stylesheets/compass/css3/_gradient.scss @@ -44,6 +44,7 @@ @if $experimental-support-for-mozilla { background-image: #{$background}-moz-linear-gradient($start, $color-stops); } + background-image: linear-gradient($start, $color-stops); } // Due to limitation's of webkit, the radial gradient mixin works best if you use From 150000fb0597939080c4202542f0c72762fa697e Mon Sep 17 00:00:00 2001 From: Eric Meyer Date: Sun, 18 Jul 2010 15:52:19 -0600 Subject: [PATCH 24/81] official radial gradient syntax --- frameworks/compass/stylesheets/compass/css3/_gradient.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/frameworks/compass/stylesheets/compass/css3/_gradient.scss b/frameworks/compass/stylesheets/compass/css3/_gradient.scss index e60209da..dd5e36be 100644 --- a/frameworks/compass/stylesheets/compass/css3/_gradient.scss +++ b/frameworks/compass/stylesheets/compass/css3/_gradient.scss @@ -78,4 +78,5 @@ @if $experimental-support-for-mozilla { background-image: #{$background}-moz-radial-gradient($center-position, circle, $color-stops); } + background-image: radial-gradient($center-position, circle, $color-stops); } \ No newline at end of file From f6d3480685bf5f7c26f050ad709f3e9d6bacb9ce Mon Sep 17 00:00:00 2001 From: Eric Meyer Date: Mon, 19 Jul 2010 11:46:45 -0600 Subject: [PATCH 25/81] font-face arguments deprecated, not removed --- frameworks/compass/stylesheets/compass/css3/_font-face.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frameworks/compass/stylesheets/compass/css3/_font-face.scss b/frameworks/compass/stylesheets/compass/css3/_font-face.scss index 783b0275..7c9030b0 100644 --- a/frameworks/compass/stylesheets/compass/css3/_font-face.scss +++ b/frameworks/compass/stylesheets/compass/css3/_font-face.scss @@ -7,7 +7,10 @@ // for best results use this order: woff, opentype/truetype, svg // * $eot is required by IE, and is a relative location of the eot file. -@mixin font-face($name, $font-files, $eot: false) { +@mixin font-face($name, $font-files, $eot: false, $postscript: false, $style: false) { + @if $postscript or $style { + @warn "The $postscript and $style variables have been deprecated in favor of the Paul Irish smiley bulletproof technique."; + } @font-face { font-family: quote($name); @if $eot { From 6cfba24232d233e86db90214142af3b8e84feea6 Mon Sep 17 00:00:00 2001 From: Eric Meyer Date: Mon, 19 Jul 2010 12:04:54 -0600 Subject: [PATCH 26/81] changelog reflects css3 updates --- doc-src/content/CHANGELOG.markdown | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index b2b148d2..03c687f4 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -16,6 +16,19 @@ COMPASS CHANGELOG * [Compass Core] Bugfix for inline-font-files helper. * [Blueprint] Two colors used in typography can now be customized. * [Blueprint] Support for inputs of type email. +* [Compass Core] `+font-face` mixin no longer uses `$postscript` name or + `$stle` type variables, in favor of the Paul Irish [smiley bulletproof + technique](http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/). + Older declarations will still work, but will not apply the variables and + will display a deprecation warning. +* [Compass Core] `+box-shadow` now supports `$spread` length and `$inset` declarations. +* [Compass Core] The gradient mixins output official w3c declarations along with the + `-webkit` and `-moz` prefixed versions. The official code is based on the + w3c spec and is nearly ideantical to the mozilla version, although it is + currently not supported by any browser. +* [Compass Core] `+opacity` no longer uses any prefixed variations, as IE uses `filter` and + all other modern browsers support the official spec or nothing at all. + *Contributors:* * [Milo Winningham](http://github.com/quadule) From c78e097841fb04f69ec3d131b08ecd6b49c5d689 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 23 Jul 2010 19:36:40 -0700 Subject: [PATCH 27/81] Don't use the Base64 library. It's not found in ruby 1.9. --- lib/compass/sass_extensions/functions/inline_image.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/compass/sass_extensions/functions/inline_image.rb b/lib/compass/sass_extensions/functions/inline_image.rb index 515804c3..77035ebd 100644 --- a/lib/compass/sass_extensions/functions/inline_image.rb +++ b/lib/compass/sass_extensions/functions/inline_image.rb @@ -1,4 +1,3 @@ -require 'base64' module Compass::SassExtensions::Functions::InlineImage def inline_image(path, mime_type = nil) @@ -47,7 +46,7 @@ private def data(real_path) if File.readable?(real_path) - Base64.encode64(File.read(real_path)).gsub("\n","") + [File.read(real_path)].pack('m').gsub("\n","") else raise Compass::Error, "File not found or cannot be read: #{real_path}" end From e95521f04393f0dacbbd89fca476266f63a2b486 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 23 Jul 2010 19:37:08 -0700 Subject: [PATCH 28/81] Update gem for release --- VERSION.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/VERSION.yml b/VERSION.yml index fa758bd7..873ec77d 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -1,4 +1,5 @@ --- :major: 0 :minor: 10 -:patch: 2 +:patch: 3 +:build: pre.1 From ed75525b2aea9d8d967508a3ef39aa96d0e6a327 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 23 Jul 2010 20:09:42 -0700 Subject: [PATCH 29/81] Update tests for gradient changes. --- .../stylesheets/compass/css/gradients.css | 57 ++++++++++++------- 1 file changed, 38 insertions(+), 19 deletions(-) diff --git a/test/fixtures/stylesheets/compass/css/gradients.css b/test/fixtures/stylesheets/compass/css/gradients.css index c45e29c4..2ac003fd 100644 --- a/test/fixtures/stylesheets/compass/css/gradients.css +++ b/test/fixtures/stylesheets/compass/css/gradients.css @@ -1,75 +1,94 @@ .linear-1 { background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); - background-image: -moz-linear-gradient(top, #dddddd 0%, #aaaaaa 100%); } + background-image: -moz-linear-gradient(top, #dddddd 0%, #aaaaaa 100%); + background-image: linear-gradient(top, #dddddd 0%, #aaaaaa 100%); } .linear-2 { background-image: -webkit-gradient(linear, 0% 0%, 100% 0%, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); - background-image: -moz-linear-gradient(left, #dddddd 0%, #aaaaaa 100%); } + background-image: -moz-linear-gradient(left, #dddddd 0%, #aaaaaa 100%); + background-image: linear-gradient(left, #dddddd 0%, #aaaaaa 100%); } .linear-3 { background-image: -webkit-gradient(linear, 0% 0%, 100% 100%, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); - background-image: -moz-linear-gradient(top left, #dddddd 0%, #aaaaaa 100%); } + background-image: -moz-linear-gradient(top left, #dddddd 0%, #aaaaaa 100%); + background-image: linear-gradient(top left, #dddddd 0%, #aaaaaa 100%); } .linear-4 { background-image: -webkit-gradient(linear, 100% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); - background-image: -moz-linear-gradient(top right, #dddddd 0%, #aaaaaa 100%); } + background-image: -moz-linear-gradient(top right, #dddddd 0%, #aaaaaa 100%); + background-image: linear-gradient(top right, #dddddd 0%, #aaaaaa 100%); } .linear-5 { background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(50%, #cccccc), color-stop(100%, #aaaaaa)); - background-image: -moz-linear-gradient(top, #dddddd 0%, #cccccc 50%, #aaaaaa 100%); } + background-image: -moz-linear-gradient(top, #dddddd 0%, #cccccc 50%, #aaaaaa 100%); + background-image: linear-gradient(top, #dddddd 0%, #cccccc 50%, #aaaaaa 100%); } .linear-6 { background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(20%, #cccccc), color-stop(100%, #aaaaaa)); - background-image: -moz-linear-gradient(top, #dddddd 0%, #cccccc 20%, #aaaaaa 100%); } + background-image: -moz-linear-gradient(top, #dddddd 0%, #cccccc 20%, #aaaaaa 100%); + background-image: linear-gradient(top, #dddddd 0%, #cccccc 20%, #aaaaaa 100%); } .linear-7 { background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(20%, #cccccc), color-stop(60%, #eeeeee), color-stop(100%, #aaaaaa)); - background-image: -moz-linear-gradient(top, #dddddd 0%, #cccccc 20%, #eeeeee 60%, #aaaaaa 100%); } + background-image: -moz-linear-gradient(top, #dddddd 0%, #cccccc 20%, #eeeeee 60%, #aaaaaa 100%); + background-image: linear-gradient(top, #dddddd 0%, #cccccc 20%, #eeeeee 60%, #aaaaaa 100%); } .linear-8 { background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(80%, #dddddd), color-stop(100%, #aaaaaa)); - background-image: -moz-linear-gradient(top, #dddddd 80%, #aaaaaa 100%); } + background-image: -moz-linear-gradient(top, #dddddd 80%, #aaaaaa 100%); + background-image: linear-gradient(top, #dddddd 80%, #aaaaaa 100%); } .linear-9 { background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); - background-image: -moz-linear-gradient(top, #dddddd 0%, #aaaaaa 20%); } + background-image: -moz-linear-gradient(top, #dddddd 0%, #aaaaaa 20%); + background-image: linear-gradient(top, #dddddd 0%, #aaaaaa 20%); } .linear-10 { background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(80%, #dddddd), color-stop(100%, #aaaaaa)); - background-image: -moz-linear-gradient(top, #dddddd 40%, #aaaaaa 50%); } + background-image: -moz-linear-gradient(top, #dddddd 40%, #aaaaaa 50%); + background-image: linear-gradient(top, #dddddd 40%, #aaaaaa 50%); } .linear-11 { background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(80%, #dddddd), color-stop(90%, #000000), color-stop(100%, #aaaaaa)); - background-image: -moz-linear-gradient(top, #dddddd 40%, #000000 45%, #aaaaaa 50%); } + background-image: -moz-linear-gradient(top, #dddddd 40%, #000000 45%, #aaaaaa 50%); + background-image: linear-gradient(top, #dddddd 40%, #000000 45%, #aaaaaa 50%); } .radial-1 { background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 100, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); - background-image: -moz-radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%); } + background-image: -moz-radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%); + background-image: radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%); } .radial-2 { background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 100, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); - background-image: -moz-radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%); } + background-image: -moz-radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%); + background-image: radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%); } .radial-3 { background-image: -webkit-gradient(radial, 50% 0%, 0, 50% 0%, 100, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); - background-image: -moz-radial-gradient(top center, circle, #dddddd 0%, #aaaaaa 100%); } + background-image: -moz-radial-gradient(top center, circle, #dddddd 0%, #aaaaaa 100%); + background-image: radial-gradient(top center, circle, #dddddd 0%, #aaaaaa 100%); } .radial-4 { background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 100, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); - background-image: -moz-radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%); } + background-image: -moz-radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%); + background-image: radial-gradient(center center, circle, #dddddd 0%, #aaaaaa 100%); } .radial-5 { background-image: -webkit-gradient(radial, 50% 0%, 0, 50% 0%, 100, color-stop(0%, #dddddd), color-stop(100%, #aaaaaa)); - background-image: -moz-radial-gradient(top center, circle, #dddddd 0%, #aaaaaa 100%); } + background-image: -moz-radial-gradient(top center, circle, #dddddd 0%, #aaaaaa 100%); + background-image: radial-gradient(top center, circle, #dddddd 0%, #aaaaaa 100%); } .radial-6 { background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 50, color-stop(40%, #dddddd), color-stop(100%, #aaaaaa)); - background-image: -moz-radial-gradient(center center, circle, #dddddd 20px, #aaaaaa 50px); } + background-image: -moz-radial-gradient(center center, circle, #dddddd 20px, #aaaaaa 50px); + background-image: radial-gradient(center center, circle, #dddddd 20px, #aaaaaa 50px); } .radial-7 { background-image: -webkit-gradient(radial, 50% 50%, 0, 50% 50%, 50, color-stop(20%, #dddddd), color-stop(100%, #aaaaaa)); - background-image: -moz-radial-gradient(center center, circle, #dddddd 20%, #aaaaaa 50px); } + background-image: -moz-radial-gradient(center center, circle, #dddddd 20%, #aaaaaa 50px); + background-image: radial-gradient(center center, circle, #dddddd 20%, #aaaaaa 50px); } .alpha-linear { background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(80%, rgba(255, 255, 255, 0)), color-stop(90%, rgba(255, 127, 127, 0.5)), color-stop(100%, #ffffff)); - background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0) 40%, rgba(255, 127, 127, 0.5) 45%, #ffffff 50%); } + background-image: -moz-linear-gradient(top, rgba(255, 255, 255, 0) 40%, rgba(255, 127, 127, 0.5) 45%, #ffffff 50%); + background-image: linear-gradient(top, rgba(255, 255, 255, 0) 40%, rgba(255, 127, 127, 0.5) 45%, #ffffff 50%); } From dafbf93999c3f3e2be5f807df1bc5bcea73cb3a4 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 23 Jul 2010 20:11:52 -0700 Subject: [PATCH 30/81] [Compass Core] New content char is the best practice for the pie-clearfix now. Avoids the gap at the bottom in some browsers. Closes GH-179 --- .../stylesheets/compass/utilities/general/_clearfix.scss | 5 +---- test/fixtures/stylesheets/compass/css/utilities.css | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss b/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss index ecc65a96..2c097cc1 100644 --- a/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss +++ b/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss @@ -18,12 +18,9 @@ // [Easy Clearing](http://www.positioniseverything.net/easyclearing.html) // has the advantage of allowing positioned elements to hang // outside the bounds of the container at the expense of more tricky CSS. -// -// This method of clearing might cause a gap at the bottom of the page in -// some browsers when used on the last element of the page. @mixin pie-clearfix { &:after { - content : " "; + content : "\0020"; display : block; height : 0; clear : both; diff --git a/test/fixtures/stylesheets/compass/css/utilities.css b/test/fixtures/stylesheets/compass/css/utilities.css index b8b12855..2a287628 100644 --- a/test/fixtures/stylesheets/compass/css/utilities.css +++ b/test/fixtures/stylesheets/compass/css/utilities.css @@ -7,7 +7,7 @@ .pie-clearfix { display: inline-block; } .pie-clearfix:after { - content: " "; + content: "\0020"; display: block; height: 0; clear: both; From 755b9a3a11baffa773284afcb071e7bfab128c28 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 23 Jul 2010 20:41:52 -0700 Subject: [PATCH 31/81] [Extensions] Make it possible for extensions to create empty directories. Closes GH-173. --- doc-src/content/tutorials/extensions.markdown | 12 +++++++++++- lib/compass/installers/base.rb | 13 +++++++++++++ lib/compass/installers/manifest.rb | 1 + lib/compass/installers/manifest_installer.rb | 8 +++++--- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/doc-src/content/tutorials/extensions.markdown b/doc-src/content/tutorials/extensions.markdown index 969142a0..2e25f05b 100644 --- a/doc-src/content/tutorials/extensions.markdown +++ b/doc-src/content/tutorials/extensions.markdown @@ -165,13 +165,14 @@ You may also see some real manifest files here: ### Manifest Declarations -There are five kinds of manifest declarations: +There are six kinds of manifest declarations: 1. `stylesheet` - Declares a sass file. 2. `image` - Declares an image. 3. `javascript` - Declares a javascript file. 4. `html` - Declares an html file. 5. `file` - Declares a random file. +6. `directory` - Declares a directory should be created. All declarations take the path to the file as their first argument. Note that the normal slash `/` can and should be used in a manifest. Compass will take care of @@ -196,6 +197,15 @@ Stylesheet options: * `:condition` - this is used to hint the user that a conditional comment should be used to import the stylesheet with the given condition. +Directory options: + +* `:within` - where the directory should be created. If omitted, the directory + will be relative to the project directory. Can be one of: the following + * `sass_dir` + * `javascripts_dir` + * `fonts_dir` + * `images_dir` + HTML files: You can provide html as haml or as plain html. If you provide haml, the haml will be diff --git a/lib/compass/installers/base.rb b/lib/compass/installers/base.rb index 36c5f3ab..e5c7a345 100644 --- a/lib/compass/installers/base.rb +++ b/lib/compass/installers/base.rb @@ -116,6 +116,19 @@ module Compass "#{pattern_name_as_dir}#{to}" end + def install_directory(from, to, options) + d = if within = options[:within] + if respond_to?(within) + targetize("#{send(within)}/#{to}") + else + raise Compass::Error, "Unrecognized location: #{within}" + end + else + targetize(to) + end + directory d + end + alias install_html_without_haml install_html def install_html(from, to, options) if to =~ /\.haml$/ diff --git a/lib/compass/installers/manifest.rb b/lib/compass/installers/manifest.rb index 4324be66..4b2ea19e 100644 --- a/lib/compass/installers/manifest.rb +++ b/lib/compass/installers/manifest.rb @@ -40,6 +40,7 @@ module Compass type :font type :file type :html + type :directory def help(value = nil) if value diff --git a/lib/compass/installers/manifest_installer.rb b/lib/compass/installers/manifest_installer.rb index d48ff5ad..04e1d909 100644 --- a/lib/compass/installers/manifest_installer.rb +++ b/lib/compass/installers/manifest_installer.rb @@ -17,9 +17,11 @@ module Compass # Initializes the project to work with compass def init dirs = manifest.map do |entry| - loc = send("install_location_for_#{entry.type}", entry.to, entry.options) - File.dirname(loc) - end + unless entry.type == :directory + loc = send("install_location_for_#{entry.type}", entry.to, entry.options) + File.dirname(loc) + end + end.compact if manifest.has_stylesheet? dirs << sass_dir From 5864f2aeabe1dcba61dad256c56c1521f98eed6f Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 23 Jul 2010 22:54:23 -0700 Subject: [PATCH 32/81] [Rails] Move most of the contents of the compass initializer back to the compass codebase. Discover compass extensions automatically during boot. --- lib/compass/app_integration/rails.rb | 7 +++++++ lib/compass/app_integration/rails/installer.rb | 6 ++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/compass/app_integration/rails.rb b/lib/compass/app_integration/rails.rb index d1f370ae..430e4c2c 100644 --- a/lib/compass/app_integration/rails.rb +++ b/lib/compass/app_integration/rails.rb @@ -34,6 +34,13 @@ module Compass end end + def initialize! + rails_root = (defined?(Rails) ? Rails.root : RAILS_ROOT).to_s + Compass.add_project_configuration(File.join(root, "config", "compass.rb")) + Compass.discover_extensions! + Compass.configure_sass_plugin! + Compass.handle_configuration_change! + end end end end diff --git a/lib/compass/app_integration/rails/installer.rb b/lib/compass/app_integration/rails/installer.rb index 9652c0e3..68e6a021 100644 --- a/lib/compass/app_integration/rails/installer.rb +++ b/lib/compass/app_integration/rails/installer.rb @@ -105,10 +105,8 @@ NEXTSTEPS def initializer_contents %Q{require 'compass' - |rails_root = (defined?(Rails) ? Rails.root : RAILS_ROOT).to_s - |Compass.add_project_configuration(File.join(rails_root, "config", "compass.rb")) - |Compass.configure_sass_plugin! - |Compass.handle_configuration_change! + |require 'compass/app_integration/rails' + |Compass::AppIntegration::Rails.initialize! |}.gsub(/^\s+\|/,'') end From a2a0d58508283149c930a2fdfd1829b6b4eebdde Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 23 Jul 2010 23:31:11 -0700 Subject: [PATCH 33/81] [Rails] Make it possible to only install the configuration files into a rails project. --- .../app_integration/rails/installer.rb | 23 +++++++++---------- lib/compass/commands/create_project.rb | 5 ++++ lib/compass/commands/stamp_pattern.rb | 2 +- lib/compass/installers/base.rb | 6 ++--- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/lib/compass/app_integration/rails/installer.rb b/lib/compass/app_integration/rails/installer.rb index 68e6a021..2c6682a1 100644 --- a/lib/compass/app_integration/rails/installer.rb +++ b/lib/compass/app_integration/rails/installer.rb @@ -19,19 +19,16 @@ module Compass def write_configuration_files(config_file = nil) config_file ||= targetize('config/compass.rb') - directory File.dirname(config_file) - write_file config_file, config_contents + unless File.exists?(config_file) + directory File.dirname(config_file) + write_file config_file, config_contents + end directory File.dirname(targetize('config/initializers/compass.rb')) write_file targetize('config/initializers/compass.rb'), initializer_contents end - def config_files_exist? - File.exists?(targetize('config/compass.rb')) && - File.exists?(targetize('config/initializers/compass.rb')) - end - def prepare - write_configuration_files unless config_files_exist? + write_configuration_files end def finalize(options = {}) @@ -55,10 +52,12 @@ Sass will automatically compile your stylesheets during the next page request and keep them up to date when they change. NEXTSTEPS end - if manifest.has_stylesheet? - puts "\nNext add these lines to the head of your layouts:\n\n" - puts stylesheet_links - puts "\n(You are using haml, aren't you?)" + unless options[:prepare] + if manifest.has_stylesheet? + puts "\nNext add these lines to the head of your layouts:\n\n" + puts stylesheet_links + puts "\n(You are using haml, aren't you?)" + end end end diff --git a/lib/compass/commands/create_project.rb b/lib/compass/commands/create_project.rb index c714b023..ebebd507 100644 --- a/lib/compass/commands/create_project.rb +++ b/lib/compass/commands/create_project.rb @@ -43,7 +43,12 @@ module Compass self.options[:preferred_syntax] = syntax end + opts.on("--prepare", "Prepare the project by only creating configuration files.") do + self.options[:prepare] = true + end + super + end end diff --git a/lib/compass/commands/stamp_pattern.rb b/lib/compass/commands/stamp_pattern.rb index 0af1acf3..fb45bf34 100644 --- a/lib/compass/commands/stamp_pattern.rb +++ b/lib/compass/commands/stamp_pattern.rb @@ -74,7 +74,7 @@ Options: installer.init installer.run(:skip_finalization => true) UpdateProject.new(working_path, options).perform if installer.compilation_required? - installer.finalize(:create => is_project_creation?) + installer.finalize(options.merge(:create => is_project_creation?)) end def is_project_creation? diff --git a/lib/compass/installers/base.rb b/lib/compass/installers/base.rb index e5c7a345..079f36b4 100644 --- a/lib/compass/installers/base.rb +++ b/lib/compass/installers/base.rb @@ -28,10 +28,10 @@ module Compass # Runs the installer. # Every installer must conform to the installation strategy of prepare, install, and then finalize. # A default implementation is provided for each step. - def run(options = {}) + def run(run_options = {}) prepare - install - finalize(options) unless options[:skip_finalization] + install unless options[:prepare] + finalize(options.merge(run_options)) unless options[:prepare] || run_options[:skip_finalization] end # The default prepare method -- it is a no-op. From 0bcbd2b2fd8c6adc6802571d9738282f2ac7e577 Mon Sep 17 00:00:00 2001 From: Eric Meyer Date: Fri, 16 Jul 2010 16:11:26 -0600 Subject: [PATCH 34/81] added support for spread and inset --- .../stylesheets/compass/css3/_box-shadow.scss | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss b/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss index cbf94019..76b78b91 100644 --- a/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss +++ b/frameworks/compass/stylesheets/compass/css3/_box-shadow.scss @@ -17,21 +17,33 @@ $default-box-shadow-v-offset: 1px !default; // The default blur length. $default-box-shadow-blur: 5px !default; +// The default spread length. +$default-box-shadow-spread : 0 !default; + +// The default shadow instet: inset or false (for standard shadow). +$default-box-shadow-inset : false !default; + // Provides cross-browser CSS box shadows for Webkit, Gecko, and CSS3. -// Arguments are color, horizontal offset, vertical offset, and blur length. +// Arguments are color, horizontal offset, vertical offset, blur length, spread length, and inset. @mixin box-shadow( - $color: $default-box-shadow-color, - $hoff: $default-box-shadow-h-offset, - $voff: $default-box-shadow-v-offset, - $blur: $default-box-shadow-blur + $color : $default-box-shadow-color, + $hoff : $default-box-shadow-h-offset, + $voff : $default-box-shadow-v-offset, + $blur : $default-box-shadow-blur, + $spread : $default-box-shadow-spread, + $inset : $default-box-shadow-inset ) { + $full : $color $hoff $voff $blur $spread; + @if $inset { + $full: $full $inset; + } @if $color == none { @include experimental(box-shadow, none, -moz, -webkit, -o, not -ms, not -khtml, official ); - } @else { - @include experimental(box-shadow, $color $hoff $voff $blur, + } @else { + @include experimental(box-shadow, $full, -moz, -webkit, -o, not -ms, not -khtml, official ); } From 1a3277858e29e467e0640b510746d49513e82b1b Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 24 Jul 2010 00:02:04 -0700 Subject: [PATCH 35/81] update changelog --- doc-src/content/CHANGELOG.markdown | 53 ++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 03c687f4..33211cc4 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -9,26 +9,43 @@ COMPASS CHANGELOG 0.10.3 (Unreleased) ------------------- -* [Compass Core] Add missing clearfix import to horizontal-list. -* [Compass Core] Emit less css for inline lists with the same result. -* [Compass Core] New helper `opposite-position($position)` returns the opposite value of a position. [Documentation](http://compass-style.org/docs/reference/compass/helpers/constants/) -* [Compass Core] Allow horizontal lists to be floated to the right. -* [Compass Core] Bugfix for inline-font-files helper. -* [Blueprint] Two colors used in typography can now be customized. -* [Blueprint] Support for inputs of type email. -* [Compass Core] `+font-face` mixin no longer uses `$postscript` name or - `$stle` type variables, in favor of the Paul Irish [smiley bulletproof - technique](http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/). - Older declarations will still work, but will not apply the variables and - will display a deprecation warning. -* [Compass Core] `+box-shadow` now supports `$spread` length and `$inset` declarations. -* [Compass Core] The gradient mixins output official w3c declarations along with the - `-webkit` and `-moz` prefixed versions. The official code is based on the - w3c spec and is nearly ideantical to the mozilla version, although it is - currently not supported by any browser. -* [Compass Core] `+opacity` no longer uses any prefixed variations, as IE uses `filter` and + +### !important + +All rails users should run the following command: + + compass init rails --prepare + +This will update your compass initializer file. + +### Compass Core + +* Add missing clearfix import to horizontal-list. +* Emit less css for inline lists with the same result. +* New helper `opposite-position($position)` returns the opposite value of a position. [Documentation](http://compass-style.org/docs/reference/compass/helpers/constants/) +* Allow horizontal lists to be floated to the right. +* Bugfix for inline-font-files helper. +* `+font-face` mixin no longer uses `$postscript` name or `$style` type variables, in favor of the Paul Irish [smiley bulletproof technique](http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/). Older declarations will still work, but will not apply the variables and will display a deprecation warning. +* `+box-shadow` now supports `$spread` length and `$inset` declarations. +* The gradient mixins output official w3c declarations along with the `-webkit` and `-moz` prefixed versions. The official code is based on the w3c spec and is nearly ideantical to the mozilla version, although it is currently not supported by any browser. +* `+opacity` no longer uses any prefixed variations, as IE uses `filter` and all other modern browsers support the official spec or nothing at all. +### Blueprint +* Two colors used in typography can now be customized. +* Support for inputs of type email. + +### Extensions +* Extensions can now create empty directories with the `directory` directive. [Docs](http://compass-style.org/docs/tutorials/extensions/). + +### Rails + +As stated above, all rails users should run the following command: + + compass init rails . --prepare + +This will fix a bug in the rails initializer that caused compass extensions to not be recognized when placed into the `vendor/plugins/compass_extensions` directory. It will also make sure that future bugs in the boot process won't require an end-user action to fix. + *Contributors:* * [Milo Winningham](http://github.com/quadule) From c02cab30bb27a7466b389a04320a863824dad690 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 24 Jul 2010 00:55:09 -0700 Subject: [PATCH 36/81] [CSS3] Support for specifying horizontal and vertical radii for the shorthand border-radius property. --- .../compass/css3/_border-radius.scss | 64 ++++++++++++++++++- lib/compass/sass_extensions/functions.rb | 7 +- 2 files changed, 68 insertions(+), 3 deletions(-) diff --git a/frameworks/compass/stylesheets/compass/css3/_border-radius.scss b/frameworks/compass/stylesheets/compass/css3/_border-radius.scss index f3232318..4870b1e9 100644 --- a/frameworks/compass/stylesheets/compass/css3/_border-radius.scss +++ b/frameworks/compass/stylesheets/compass/css3/_border-radius.scss @@ -3,9 +3,69 @@ $default-border-radius: 5px !default; // Round all corners by a specific amount, defaults to value of `$default-border-radius`. +// +// When two values are passed, the first is the horizontal radius +// and the second is the vertical radius. +// +// Note: webkit does not support shorthand syntax for several corners at once. +// So in the case where you pass several values only the first will be passed to webkit. +// +// Examples: +// +// .simple { @include border-radius(4px, 4px); } +// .compound { @include border-radius(2px 5px, 3px 6px); } +// .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; +// -o-border-radius: 4px / 4px; +// -ms-border-radius: 4px / 4px; +// -khtml-border-radius: 4px / 4px; +// border-radius: 4px / 4px; } +// +// .compound { +// -webkit-border-radius: 2px 3px; +// -moz-border-radius: 2px 5px / 3px 6px; +// -o-border-radius: 2px 5px / 3px 6px; +// -ms-border-radius: 2px 5px / 3px 6px; +// -khtml-border-radius: 2px 5px / 3px 6px; +// border-radius: 2px 5px / 3px 6px; } +// +// .crazy { +// -webkit-border-radius: 1px 2px; +// -moz-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px; +// -o-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px; +// -ms-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px; +// -khtml-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px; +// border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px; } -@mixin border-radius($radius: $default-border-radius) { - @include experimental(border-radius, $radius); +@mixin border-radius($radius: $default-border-radius, $vertical-radius: false) { + + @if $vertical-radius { + // Webkit doesn't understand the official shorthand syntax for specifying + // a vertical radius unless so in case there's several we only take the first. + @include experimental(border-radius, first-value-of($radius) first-value-of($vertical-radius), + not -moz, + -webkit, + not -o, + not -ms, + not -khtml, + not official + ); + @include experimental("border-radius", $radius unquote("/") $vertical-radius, + -moz, + not -webkit, + -o, + -ms, + -khtml, + official + ); + } + @else { + @include experimental(border-radius, $radius); + } } // Round radius at position by amount. diff --git a/lib/compass/sass_extensions/functions.rb b/lib/compass/sass_extensions/functions.rb index 0641b79c..007cfc92 100644 --- a/lib/compass/sass_extensions/functions.rb +++ b/lib/compass/sass_extensions/functions.rb @@ -1,7 +1,11 @@ module Compass::SassExtensions::Functions end -%w(selectors enumerate urls display inline_image image_size gradient_support font_files constants).each do |func| +%w( + selectors enumerate urls display + inline_image image_size gradient_support + font_files constants lists +).each do |func| require "compass/sass_extensions/functions/#{func}" end @@ -15,6 +19,7 @@ module Sass::Script::Functions include Compass::SassExtensions::Functions::GradientSupport::Functions include Compass::SassExtensions::Functions::FontFiles include Compass::SassExtensions::Functions::Constants + include Compass::SassExtensions::Functions::Lists end # Wierd that this has to be re-included to pick up sub-modules. Ruby bug? From e6c418062b16a84268a2205382019a5c6410cd2f Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 24 Jul 2010 01:04:25 -0700 Subject: [PATCH 37/81] Update the changelog --- doc-src/content/CHANGELOG.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 33211cc4..de0fa608 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -30,6 +30,7 @@ This will update your compass initializer file. * The gradient mixins output official w3c declarations along with the `-webkit` and `-moz` prefixed versions. The official code is based on the w3c spec and is nearly ideantical to the mozilla version, although it is currently not supported by any browser. * `+opacity` no longer uses any prefixed variations, as IE uses `filter` and all other modern browsers support the official spec or nothing at all. +* Support for specifying horizontal and vertical radii for the shorthand border-radius property. ### Blueprint * Two colors used in typography can now be customized. From 06ab3d4b410da9d97ce4b7b3e7850cc7d09c32db Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 24 Jul 2010 01:34:14 -0700 Subject: [PATCH 38/81] [CSS3] if a root relative url is passed to image-url, still find the file and do the normal processing. --- lib/compass/sass_extensions/functions/urls.rb | 8 +++++-- .../stylesheets/compass/css/border_radius.css | 23 +++++++++++++++++++ .../stylesheets/compass/css/images.css | 8 +++++++ .../compass/sass/border_radius.scss | 5 ++++ .../stylesheets/compass/sass/images.scss | 9 ++++++++ 5 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 test/fixtures/stylesheets/compass/css/border_radius.css create mode 100644 test/fixtures/stylesheets/compass/css/images.css create mode 100644 test/fixtures/stylesheets/compass/sass/border_radius.scss create mode 100644 test/fixtures/stylesheets/compass/sass/images.scss diff --git a/lib/compass/sass_extensions/functions/urls.rb b/lib/compass/sass_extensions/functions/urls.rb index e6bb217d..624cb9f0 100644 --- a/lib/compass/sass_extensions/functions/urls.rb +++ b/lib/compass/sass_extensions/functions/urls.rb @@ -36,8 +36,12 @@ module Compass::SassExtensions::Functions::Urls def image_url(path) path = path.value # get to the string value of the literal. - # Short curcuit if they have provided an absolute url. - if absolute_path?(path) + if path =~ %r{^#{Regexp.escape(Compass.configuration.http_images_path)}/(.*)} + # Treat root relative urls (without a protocol) like normal if they start with + # the images path. + path = $1 + elsif absolute_path?(path) + # Short curcuit if they have provided an absolute url. return Sass::Script::String.new("url(#{path})") end diff --git a/test/fixtures/stylesheets/compass/css/border_radius.css b/test/fixtures/stylesheets/compass/css/border_radius.css new file mode 100644 index 00000000..5eef9e03 --- /dev/null +++ b/test/fixtures/stylesheets/compass/css/border_radius.css @@ -0,0 +1,23 @@ +.simple { + -webkit-border-radius: 4px 4px; + -moz-border-radius: 4px / 4px; + -o-border-radius: 4px / 4px; + -ms-border-radius: 4px / 4px; + -khtml-border-radius: 4px / 4px; + border-radius: 4px / 4px; } + +.compound { + -webkit-border-radius: 2px 3px; + -moz-border-radius: 2px 5px / 3px 6px; + -o-border-radius: 2px 5px / 3px 6px; + -ms-border-radius: 2px 5px / 3px 6px; + -khtml-border-radius: 2px 5px / 3px 6px; + border-radius: 2px 5px / 3px 6px; } + +.crazy { + -webkit-border-radius: 1px 2px; + -moz-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px; + -o-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px; + -ms-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px; + -khtml-border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px; + border-radius: 1px 3px 5px 7px / 2px 4px 6px 8px; } diff --git a/test/fixtures/stylesheets/compass/css/images.css b/test/fixtures/stylesheets/compass/css/images.css new file mode 100644 index 00000000..c4e97ca5 --- /dev/null +++ b/test/fixtures/stylesheets/compass/css/images.css @@ -0,0 +1,8 @@ +.relative { + background-image: url('/images/4x6.png?busted=true'); } + +.root-relative { + background-image: url('/images/4x6.png?busted=true'); } + +.absolute { + background-image: url(http://example.com/images/4x6.png); } \ No newline at end of file diff --git a/test/fixtures/stylesheets/compass/sass/border_radius.scss b/test/fixtures/stylesheets/compass/sass/border_radius.scss new file mode 100644 index 00000000..685ad4cc --- /dev/null +++ b/test/fixtures/stylesheets/compass/sass/border_radius.scss @@ -0,0 +1,5 @@ +@import "compass/css3/border-radius"; + +.simple { @include border-radius(4px, 4px); } +.compound { @include border-radius(2px 5px, 3px 6px); } +.crazy { @include border-radius(1px 3px 5px 7px, 2px 4px 6px 8px)} diff --git a/test/fixtures/stylesheets/compass/sass/images.scss b/test/fixtures/stylesheets/compass/sass/images.scss new file mode 100644 index 00000000..65d583f3 --- /dev/null +++ b/test/fixtures/stylesheets/compass/sass/images.scss @@ -0,0 +1,9 @@ +.relative { + background-image: image-url("4x6.png"); +} +.root-relative { + background-image: image-url("/images/4x6.png"); +} +.absolute { + background-image: image-url("http://example.com/images/4x6.png"); +} \ No newline at end of file From b7c6a7e50f7fadb790add3ec73121f9ef8f9bdd0 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 24 Jul 2010 02:00:40 -0700 Subject: [PATCH 39/81] fix a bug in syntax highlighting now that we have a couple unicode chars --- doc-src/lib/data_sources/syntax_highter.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc-src/lib/data_sources/syntax_highter.rb b/doc-src/lib/data_sources/syntax_highter.rb index 36eb8ff7..a2faacba 100644 --- a/doc-src/lib/data_sources/syntax_highter.rb +++ b/doc-src/lib/data_sources/syntax_highter.rb @@ -11,7 +11,7 @@ class SyntaxHighlighterFilter < Nanoc3::Filter def pygmentize(code, type) # -O linenos=table - IO.popen("pygmentize -l #{type} -f html", "r+") do |io| + IO.popen("pygmentize -l #{type} -f html -O encoding=utf-8", "r+") do |io| io.write(code) io.close_write return io.read From 165e3b43fb505ac02f2ffcbd14aba36783e53800 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 24 Jul 2010 02:01:43 -0700 Subject: [PATCH 40/81] Add missing file. --- lib/compass/sass_extensions/functions/lists.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 lib/compass/sass_extensions/functions/lists.rb diff --git a/lib/compass/sass_extensions/functions/lists.rb b/lib/compass/sass_extensions/functions/lists.rb new file mode 100644 index 00000000..663890b8 --- /dev/null +++ b/lib/compass/sass_extensions/functions/lists.rb @@ -0,0 +1,9 @@ +module Compass::SassExtensions::Functions::Lists + def first_value_of(list) + if list.is_a?(Sass::Script::String) + Sass::Script::String.new(list.value.split(/\s+/).first) + else + list + end + end +end From 174f91360c35ce7540bf338ea95148b3b54ab409 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 24 Jul 2010 02:07:55 -0700 Subject: [PATCH 41/81] cleanup the changelog for release. --- doc-src/content/CHANGELOG.markdown | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index de0fa608..0b491453 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -7,9 +7,11 @@ layout: article COMPASS CHANGELOG ================= -0.10.3 (Unreleased) +0.10.3.pre.1 (7/24/2010) ------------------- +This release is mostly addressing issues and requests in the compass bug tracker. + ### !important All rails users should run the following command: @@ -48,7 +50,8 @@ As stated above, all rails users should run the following command: This will fix a bug in the rails initializer that caused compass extensions to not be recognized when placed into the `vendor/plugins/compass_extensions` directory. It will also make sure that future bugs in the boot process won't require an end-user action to fix. -*Contributors:* +### Contributors: + * [Milo Winningham](http://github.com/quadule) * [jonathanpberger](http://github.com/jonathanpberger) * [Stephan Kaag](http://github.com/stephankaag) From fb51f5ca7eb9cab53f57ceaa2dda4b23500cc9c5 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 25 Jul 2010 11:18:28 -0700 Subject: [PATCH 42/81] [Docs] Fix some outdated documentation. --- doc-src/content/tutorials/best_practices.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc-src/content/tutorials/best_practices.markdown b/doc-src/content/tutorials/best_practices.markdown index b05708ce..3b3cbb0e 100644 --- a/doc-src/content/tutorials/best_practices.markdown +++ b/doc-src/content/tutorials/best_practices.markdown @@ -17,7 +17,7 @@ variables and ([often][2]) the framework utilities you plan to use: @import "compass/reset"; @import "compass/utilities"; - @import "blueprint/screen"; + @import "blueprint"; // etc. From 0aedf013755130276d79398510d47559f5eac553 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 25 Jul 2010 11:19:17 -0700 Subject: [PATCH 43/81] Reformatting some code. --- .../blueprint/stylesheets/blueprint/_buttons.scss | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/frameworks/blueprint/stylesheets/blueprint/_buttons.scss b/frameworks/blueprint/stylesheets/blueprint/_buttons.scss index 202dba0c..14af8224 100644 --- a/frameworks/blueprint/stylesheets/blueprint/_buttons.scss +++ b/frameworks/blueprint/stylesheets/blueprint/_buttons.scss @@ -23,8 +23,7 @@ $blueprint_button_active_font_color: white !default; // Sets the colors for a button // @param border_highlight_color // The highlight color defaults to whatever is the value of the border_color but it's one shade lighter. -@mixin button-colors -( +@mixin button-colors( $font_color: $blueprint_button_font_color, $bg_color: $blueprint_button_background_color, $border_color: $blueprint_button_border_color, @@ -39,8 +38,7 @@ $blueprint_button_active_font_color: white !default; // Sets the colors for a button in the active state // @param border_highlight_color // The highlight color defaults to whatever is the value of the border_color but it's one shade lighter. -@mixin button-active-colors -( +@mixin button-active-colors( $font_color: $blueprint_button_active_font_color, $bg_color: $blueprint_button_active_background_color, $border_color: $blueprint_button_active_border_color, @@ -55,8 +53,7 @@ $blueprint_button_active_font_color: white !default; // Sets the colors for a button in the hover state. // @param border_highlight_color // The highlight color defaults to whatever is the value of the border_color but it's one shade lighter. -@mixin button-hover-colors -( +@mixin button-hover-colors( $font_color: $blueprint_button_hover_font_color, $bg_color: $blueprint_button_hover_background_color, $border_color: $blueprint_button_hover_border_color, @@ -101,4 +98,4 @@ $blueprint_button_active_font_color: white !default; *:first-child+html &[type] { padding: 4px 10px 3px 7px; } -} +} \ No newline at end of file From 922fc8c1a2dc21686b5a76a0dac96ce2d3913dc6 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 25 Jul 2010 11:39:11 -0700 Subject: [PATCH 44/81] [Compass Core] The has-layout mixin has been updated to emit less css. It now uses a hacked zoom property to target ie6 and 7 only so that they gain layout. If you prefer an approach that validates, set: $default-has-layout-approach: block; and the has-layout mixin behavior will remain unchanged. --- .../compass/utilities/general/_hacks.scss | 26 ++++++++++++++++--- .../stylesheets/compass/css/images.css | 2 +- .../compass/css/legacy_clearfix.css | 17 ++++++++++++ .../stylesheets/compass/css/lists.css | 12 +++------ .../stylesheets/compass/css/utilities.css | 8 ++---- .../compass/sass/legacy_clearfix.scss | 11 ++++++++ 6 files changed, 57 insertions(+), 19 deletions(-) create mode 100644 test/fixtures/stylesheets/compass/css/legacy_clearfix.css create mode 100644 test/fixtures/stylesheets/compass/sass/legacy_clearfix.scss diff --git a/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss b/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss index d30dd722..4f6ec87d 100644 --- a/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss +++ b/frameworks/compass/stylesheets/compass/utilities/general/_hacks.scss @@ -1,12 +1,32 @@ +// The `zoom` approach generates less CSS but does not validate. +// Set this to `block` to use the display-property to hack the +// element to gain layout. +$default-has-layout-approach: zoom !default; + // This mixin causes an element matching the selector // to gain the "hasLayout" property in internet explorer. // More information on [hasLayout](http://reference.sitepoint.com/css/haslayout). -@mixin has-layout { +@mixin has-layout($using: $default-has-layout-approach) { + @if $using == zoom { + @include has-layout-zoom; + } @else if $using == block { + @include has-layout-block; + } @else { + @warn "Unknown has-layout approach: #{$using}"; + @include has-layout-zoom; + } +} + +@mixin has-layout-zoom { + *zoom: 1; +} + +@mixin has-layout-block { // This makes ie6 get layout display: inline-block; // and this puts it back to block - & { - display: block; } } + & { display: block; } +} // A hack to supply IE6 (and below) with a different property value. // [Read more](http://www.cssportal.com/css-hacks/#in_css-important). diff --git a/test/fixtures/stylesheets/compass/css/images.css b/test/fixtures/stylesheets/compass/css/images.css index c4e97ca5..e0c4fdae 100644 --- a/test/fixtures/stylesheets/compass/css/images.css +++ b/test/fixtures/stylesheets/compass/css/images.css @@ -5,4 +5,4 @@ background-image: url('/images/4x6.png?busted=true'); } .absolute { - background-image: url(http://example.com/images/4x6.png); } \ No newline at end of file + background-image: url(http://example.com/images/4x6.png); } diff --git a/test/fixtures/stylesheets/compass/css/legacy_clearfix.css b/test/fixtures/stylesheets/compass/css/legacy_clearfix.css new file mode 100644 index 00000000..2a287628 --- /dev/null +++ b/test/fixtures/stylesheets/compass/css/legacy_clearfix.css @@ -0,0 +1,17 @@ +.clearfix { + overflow: hidden; + display: inline-block; } + .clearfix { + display: block; } + +.pie-clearfix { + display: inline-block; } + .pie-clearfix:after { + content: "\0020"; + display: block; + height: 0; + clear: both; + overflow: hidden; + visibility: hidden; } + .pie-clearfix { + display: block; } diff --git a/test/fixtures/stylesheets/compass/css/lists.css b/test/fixtures/stylesheets/compass/css/lists.css index 7909e445..96195f04 100644 --- a/test/fixtures/stylesheets/compass/css/lists.css +++ b/test/fixtures/stylesheets/compass/css/lists.css @@ -4,9 +4,7 @@ ul.horizontal { border: 0; outline: 0; overflow: hidden; - display: inline-block; } - ul.horizontal { - display: block; } + *zoom: 1; } ul.horizontal li { list-style-image: none; list-style-type: none; @@ -27,9 +25,7 @@ ul.wide-horizontal { border: 0; outline: 0; overflow: hidden; - display: inline-block; } - ul.wide-horizontal { - display: block; } + *zoom: 1; } ul.wide-horizontal li { list-style-image: none; list-style-type: none; @@ -50,9 +46,7 @@ ul.right-horizontal { border: 0; outline: 0; overflow: hidden; - display: inline-block; } - ul.right-horizontal { - display: block; } + *zoom: 1; } ul.right-horizontal li { list-style-image: none; list-style-type: none; diff --git a/test/fixtures/stylesheets/compass/css/utilities.css b/test/fixtures/stylesheets/compass/css/utilities.css index 2a287628..38544f92 100644 --- a/test/fixtures/stylesheets/compass/css/utilities.css +++ b/test/fixtures/stylesheets/compass/css/utilities.css @@ -1,11 +1,9 @@ .clearfix { overflow: hidden; - display: inline-block; } - .clearfix { - display: block; } + *zoom: 1; } .pie-clearfix { - display: inline-block; } + *zoom: 1; } .pie-clearfix:after { content: "\0020"; display: block; @@ -13,5 +11,3 @@ clear: both; overflow: hidden; visibility: hidden; } - .pie-clearfix { - display: block; } diff --git a/test/fixtures/stylesheets/compass/sass/legacy_clearfix.scss b/test/fixtures/stylesheets/compass/sass/legacy_clearfix.scss new file mode 100644 index 00000000..5a9f6396 --- /dev/null +++ b/test/fixtures/stylesheets/compass/sass/legacy_clearfix.scss @@ -0,0 +1,11 @@ +$default-has-layout-approach: block; + +@import "compass/utilities"; + +.clearfix { + @include clearfix; +} + +.pie-clearfix { + @include pie-clearfix; +} From 704eaea0b2d689f25802a24c9267e40aba3f833c Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 1 Aug 2010 09:52:17 -0700 Subject: [PATCH 45/81] [Docs] Make index pages that show all the available mixins and variables. --- doc-src/content/index/mixins.haml | 14 ++++++++++++++ doc-src/content/index/variables.haml | 15 +++++++++++++++ doc-src/lib/stylesheets.rb | 26 ++++++++++++++++++++++++++ 3 files changed, 55 insertions(+) create mode 100644 doc-src/content/index/mixins.haml create mode 100644 doc-src/content/index/variables.haml diff --git a/doc-src/content/index/mixins.haml b/doc-src/content/index/mixins.haml new file mode 100644 index 00000000..3980026e --- /dev/null +++ b/doc-src/content/index/mixins.haml @@ -0,0 +1,14 @@ +--- +title: Compass Documentation | All Mixins +crumb: Docs +body_id: home +--- +%article + %h1#logo Compass Mixins + + - all_mixins.sort_by{|i| i.first.identifier}.each do |item, mixins| + %h3= link_to item[:title], item + %ul + - mixins.sort_by{|m| m.name}.each do |m| + %li= mixin_signature(m) + diff --git a/doc-src/content/index/variables.haml b/doc-src/content/index/variables.haml new file mode 100644 index 00000000..dcb78594 --- /dev/null +++ b/doc-src/content/index/variables.haml @@ -0,0 +1,15 @@ +--- +title: Compass Documentation | All Variables +crumb: Docs +body_id: home +--- +%article + %h1#logo Compass Variables + + - all_constants.sort_by{|i| i.first.identifier}.each do |item, constants| + %h3= link_to item[:title], item + %ul + - constants.sort_by{|c| c.name}.each do |c| + %li $#{c.name} + + \ No newline at end of file diff --git a/doc-src/lib/stylesheets.rb b/doc-src/lib/stylesheets.rb index b92e48d6..69348aa6 100644 --- a/doc-src/lib/stylesheets.rb +++ b/doc-src/lib/stylesheets.rb @@ -139,6 +139,32 @@ def constants(item) constants end +def all_constants + variables = [] + @items.each do |item| + next unless item.identifier =~ %r{/reference} + next unless item[:stylesheet] + vars = constants(item) + if vars.any? + variables << [item, vars] + end + end + variables +end + +def all_mixins + all_mixins = [] + @items.each do |item| + next unless item.identifier =~ %r{/reference} + next unless item[:stylesheet] + ms = mixins(item) + if ms.any? + all_mixins << [item, ms] + end + end + all_mixins +end + def mixin_signature(mixin, format = :html) mixin.sass_signature(:none, format) end From 81bbea8f1b367982237d973c3f5c94881a4ea45a Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 1 Aug 2010 09:52:46 -0700 Subject: [PATCH 46/81] Formatting change. --- frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss b/frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss index 27fa0ed1..b6bf33c8 100644 --- a/frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss +++ b/frameworks/blueprint/stylesheets/blueprint/_fancy-type.scss @@ -56,8 +56,7 @@ $alternate-text-font : "Warnock Pro", "Goudy Old Style", "Palatino", "Book Antiq // `$base-font-size` - The base font size in pixels. Defaults to 12px // `$old-line-height` - The old line height. Defaults to 1.5 times the base-font-size -@mixin incr -( +@mixin incr( $font-size: 10px, $base-font-size: $blueprint-font-size, $old-line-height: $base-font-size * 1.5 From a5e39eb709a89d293448067984125324024823bb Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 1 Aug 2010 09:55:16 -0700 Subject: [PATCH 47/81] [Compass Core] Make the hide-text mixin work in opera too. Credit: Denise Jacobs. --- .../stylesheets/compass/utilities/text/_replacement.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss b/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss index f265ebb8..d88c75ea 100644 --- a/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss +++ b/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss @@ -26,7 +26,7 @@ // Hides text in an element so you can see the background. @mixin hide-text { - text-indent: -9999em; + text-indent: -119988px; overflow: hidden; text-align: left; } From dd0f3a816ba8c8d262c8c4894838edb75dd6b844 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 1 Aug 2010 09:58:03 -0700 Subject: [PATCH 48/81] [Command Line] Make it easier to load non-gem frameworks from the command line and project configuration files. --- lib/compass/configuration/data.rb | 12 +++++++++++- lib/compass/configuration/serialization.rb | 6 ++++++ lib/compass/exec/global_options_parser.rb | 21 ++++++++++++++++++--- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/lib/compass/configuration/data.rb b/lib/compass/configuration/data.rb index 5c9354c1..8ae6afa2 100644 --- a/lib/compass/configuration/data.rb +++ b/lib/compass/configuration/data.rb @@ -25,7 +25,7 @@ module Compass extend Compass::Configuration::Paths inherited_accessor *ATTRIBUTES - inherited_accessor :required_libraries #XXX we should make this array add up cumulatively. + inherited_accessor :required_libraries, :loaded_frameworks, :framework_path #XXX we should make these arrays add up cumulatively. strip_trailing_separator *ATTRIBUTES.select{|a| a.to_s =~ /dir|path/} @@ -95,6 +95,16 @@ module Compass super end + def load(framework_dir) + (self.loaded_frameworks ||= []) << framework_dir + Compass::Frameworks.register_directory framework_dir + end + + def discover(frameworks_dir) + (self.framework_path ||= []) << frameworks_dir + Compass::Frameworks.discover frameworks_dir + end + def relative_assets? # the http_images_path is deprecated, but here for backwards compatibility. relative_assets || http_images_path == :relative diff --git a/lib/compass/configuration/serialization.rb b/lib/compass/configuration/serialization.rb index 902e7556..1301c379 100644 --- a/lib/compass/configuration/serialization.rb +++ b/lib/compass/configuration/serialization.rb @@ -56,6 +56,12 @@ module Compass (required_libraries || []).each do |lib| contents << %Q{require '#{lib}'\n} end + (loaded_frameworks || []).each do |lib| + contents << %Q{load '#{lib}'\n} + end + (framework_path || []).each do |lib| + contents << %Q{discover '#{lib}'\n} + end contents << "# Require any additional compass plugins here.\n" contents << "\n" if (required_libraries || []).any? ATTRIBUTES.each do |prop| diff --git a/lib/compass/exec/global_options_parser.rb b/lib/compass/exec/global_options_parser.rb index c3ad7f1a..0f52225b 100644 --- a/lib/compass/exec/global_options_parser.rb +++ b/lib/compass/exec/global_options_parser.rb @@ -7,9 +7,24 @@ module Compass::Exec::GlobalOptionsParser opts.on('-r LIBRARY', '--require LIBRARY', "Require the given ruby LIBRARY before running commands.", " This is used to access compass plugins without having a", - " project configuration file.") do |library| - ::Compass.configuration.require library - end + " project configuration file." + ) do |library| + ::Compass.configuration.require library + end + + opts.on('-l FRAMEWORK_DIR', '--load FRAMEWORK_DIR', + "Load the framework or extensions found in the FRAMEWORK directory." + ) do |framework_dir| + require 'pathname' + ::Compass.configuration.load Pathname.new(framework_dir).realpath + end + + opts.on('-L FRAMEWORKS_DIR', '--load-all FRAMEWORKS_DIR', + "Load all the frameworks or extensions found in the FRAMEWORKS_DIR directory." + ) do |frameworks_dir| + require 'pathname' + ::Compass.configuration.discover Pathname.new(frameworks_dir).realpath + end opts.on('-q', '--quiet', :NONE, 'Quiet mode.') do self.options[:quiet] = true From 7d7720ae53b116b6259c968d172f934d022ec9b2 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 1 Aug 2010 10:20:19 -0700 Subject: [PATCH 49/81] fix test failures due to has-layout change. --- test/fixtures/stylesheets/blueprint/css/screen.css | 8 ++------ .../stylesheets/blueprint/css/single-imports/grid.css | 4 +--- .../stylesheets/blueprint/css/single-imports/liquid.css | 4 +--- .../stylesheets/blueprint/css/single-imports/rtl.css | 4 +--- .../blueprint/css/single-imports/scaffolding.css | 2 +- .../blueprint/css/single-imports/utilities.css | 4 +--- 6 files changed, 7 insertions(+), 19 deletions(-) diff --git a/test/fixtures/stylesheets/blueprint/css/screen.css b/test/fixtures/stylesheets/blueprint/css/screen.css index 6d99c1f7..e6722f0f 100644 --- a/test/fixtures/stylesheets/blueprint/css/screen.css +++ b/test/fixtures/stylesheets/blueprint/css/screen.css @@ -200,9 +200,7 @@ caption { .clearfix { overflow: hidden; - display: inline-block; } - .clearfix { - display: block; } + *zoom: 1; } .small { font-size: 0.8em; @@ -234,9 +232,7 @@ caption { width: 950px; margin: 0 auto; overflow: hidden; - display: inline-block; } - .container { - display: block; } + *zoom: 1; } .column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 { display: inline; diff --git a/test/fixtures/stylesheets/blueprint/css/single-imports/grid.css b/test/fixtures/stylesheets/blueprint/css/single-imports/grid.css index 4e8405ca..e1fe71e7 100644 --- a/test/fixtures/stylesheets/blueprint/css/single-imports/grid.css +++ b/test/fixtures/stylesheets/blueprint/css/single-imports/grid.css @@ -2,9 +2,7 @@ width: 950px; margin: 0 auto; overflow: hidden; - display: inline-block; } - .container { - display: block; } + *zoom: 1; } .column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 { display: inline; diff --git a/test/fixtures/stylesheets/blueprint/css/single-imports/liquid.css b/test/fixtures/stylesheets/blueprint/css/single-imports/liquid.css index 7ab93d66..a7f9eb9e 100644 --- a/test/fixtures/stylesheets/blueprint/css/single-imports/liquid.css +++ b/test/fixtures/stylesheets/blueprint/css/single-imports/liquid.css @@ -3,9 +3,7 @@ width: 80%; margin: 0 auto; overflow: hidden; - display: inline-block; } - .container { - display: block; } + *zoom: 1; } .span-1 { width: 3.167%; } diff --git a/test/fixtures/stylesheets/blueprint/css/single-imports/rtl.css b/test/fixtures/stylesheets/blueprint/css/single-imports/rtl.css index 95fc5963..74c9af24 100644 --- a/test/fixtures/stylesheets/blueprint/css/single-imports/rtl.css +++ b/test/fixtures/stylesheets/blueprint/css/single-imports/rtl.css @@ -3,9 +3,7 @@ margin: 0 auto; direction: rtl; overflow: hidden; - display: inline-block; } - .container { - display: block; } + *zoom: 1; } .column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 { display: inline; diff --git a/test/fixtures/stylesheets/blueprint/css/single-imports/scaffolding.css b/test/fixtures/stylesheets/blueprint/css/single-imports/scaffolding.css index 5f947943..5a86c02f 100644 --- a/test/fixtures/stylesheets/blueprint/css/single-imports/scaffolding.css +++ b/test/fixtures/stylesheets/blueprint/css/single-imports/scaffolding.css @@ -42,4 +42,4 @@ form.inline { margin-bottom: 0; } body { - margin: 1.5em 0; } \ No newline at end of file + margin: 1.5em 0; } diff --git a/test/fixtures/stylesheets/blueprint/css/single-imports/utilities.css b/test/fixtures/stylesheets/blueprint/css/single-imports/utilities.css index 7fc1cd5d..88d3ba30 100644 --- a/test/fixtures/stylesheets/blueprint/css/single-imports/utilities.css +++ b/test/fixtures/stylesheets/blueprint/css/single-imports/utilities.css @@ -6,9 +6,7 @@ .clearfix { overflow: hidden; - display: inline-block; } - .clearfix { - display: block; } + *zoom: 1; } .small { font-size: 0.8em; From 051bee703036e46da3a8a0e06057de9f0524bb8d Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 1 Aug 2010 11:15:53 -0700 Subject: [PATCH 50/81] Prepare for release. --- VERSION.yml | 2 +- doc-src/content/CHANGELOG.markdown | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/VERSION.yml b/VERSION.yml index 873ec77d..10ea9494 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -2,4 +2,4 @@ :major: 0 :minor: 10 :patch: 3 -:build: pre.1 +:build: 0 diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 0b491453..8dff4e5a 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -7,11 +7,9 @@ layout: article COMPASS CHANGELOG ================= -0.10.3.pre.1 (7/24/2010) +0.10.3.0 (8/1/2010) ------------------- -This release is mostly addressing issues and requests in the compass bug tracker. - ### !important All rails users should run the following command: @@ -40,6 +38,7 @@ This will update your compass initializer file. ### Extensions * Extensions can now create empty directories with the `directory` directive. [Docs](http://compass-style.org/docs/tutorials/extensions/). +* It's now easier to load extensions from a configuration file using the `load` and `discover` directives. ### Rails From c9a2eb2154e8d8359ad0ae8287abd27b3312cc38 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 5 Aug 2010 20:25:00 -0700 Subject: [PATCH 51/81] update changelog that I already put up on the website. --- doc-src/content/CHANGELOG.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 8dff4e5a..b7f9d41d 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -31,6 +31,7 @@ This will update your compass initializer file. * `+opacity` no longer uses any prefixed variations, as IE uses `filter` and all other modern browsers support the official spec or nothing at all. * Support for specifying horizontal and vertical radii for the shorthand border-radius property. +* The `has-layout` mixin now uses pixels instead of ems to work around an opera bug. ### Blueprint * Two colors used in typography can now be customized. From d99698f67ab64d47cb72394bc00212a5492e6f83 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 5 Aug 2010 20:38:54 -0700 Subject: [PATCH 52/81] [Compass Core] Make the logic behind the hide-text measurement more clear. no functional change. --- .../stylesheets/compass/utilities/text/_replacement.scss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss b/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss index d88c75ea..041f1053 100644 --- a/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss +++ b/frameworks/compass/stylesheets/compass/utilities/text/_replacement.scss @@ -26,7 +26,9 @@ // Hides text in an element so you can see the background. @mixin hide-text { - text-indent: -119988px; + $approximate_em_value: 12px / 1em; + $wider_than_any_screen: -9999em; + text-indent: $wider_than_any_screen * $approximate_em_value; overflow: hidden; text-align: left; } From ad967f5e6d69378b5d9394a38bd03c74640ad558 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 5 Aug 2010 20:55:48 -0700 Subject: [PATCH 53/81] [Compass Core] All url helpers now accept a second argument that when true will cause only the path to be emited. --- .../reference/compass/helpers/urls.haml | 15 ++++++-- lib/compass/sass_extensions/functions/urls.rb | 37 ++++++++++++++----- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/doc-src/content/reference/compass/helpers/urls.haml b/doc-src/content/reference/compass/helpers/urls.haml index 69fb818e..d0ffed70 100644 --- a/doc-src/content/reference/compass/helpers/urls.haml +++ b/doc-src/content/reference/compass/helpers/urls.haml @@ -21,24 +21,33 @@ classnames: #stylesheet-url.helper %h3 %a(href="#stylesheet-url") - stylesheet-url($path) + stylesheet-url($path, $only-path: false) .details %p Generates a path to an asset found relative to the project's css directory. + %br + Passing a true value as the second argument will cause the only the path to be returned + instead of a `url()` function #font-url.helper %h3 %a(href="#font-url") - font-url($path) + font-url($path, $only-path: false) .details %p Generates a path to an asset found relative to the project's font directory. + %br + Passing a true value as the second argument will cause the only the path to be returned + instead of a `url()` function #image-url.helper %h3 %a(href="#image-url") - image-url($path) + image-url($path, $only-path: false) .details %p Generates a path to an asset found relative to the project's images directory. + %br + Passing a true value as the second argument will cause the only the path to be returned + instead of a `url()` function diff --git a/lib/compass/sass_extensions/functions/urls.rb b/lib/compass/sass_extensions/functions/urls.rb index 624cb9f0..85754d37 100644 --- a/lib/compass/sass_extensions/functions/urls.rb +++ b/lib/compass/sass_extensions/functions/urls.rb @@ -1,6 +1,6 @@ module Compass::SassExtensions::Functions::Urls - def stylesheet_url(path) + def stylesheet_url(path, only_path = Sass::Script::Bool.new(false)) # Compute the path to the stylesheet, either root relative or stylesheet relative # or nil if the http_images_path is not set in the configuration. http_stylesheets_path = if relative? @@ -11,10 +11,15 @@ module Compass::SassExtensions::Functions::Urls Compass.configuration.http_root_relative(Compass.configuration.css_dir) end - clean_url("#{http_stylesheets_path}/#{path}") + path = "#{http_stylesheets_path}/#{path}" + if only_path.to_bool + Sass::Script::String.new(clean_path(path)) + else + clean_url(path) + end end - def font_url(path) + def font_url(path, only_path = Sass::Script::Bool.new(false)) path = path.value # get to the string value of the literal. # Short curcuit if they have provided an absolute url. @@ -30,10 +35,16 @@ module Compass::SassExtensions::Functions::Urls Compass.configuration.http_fonts_path end - clean_url("#{http_fonts_path}/#{path}") + path = "#{http_fonts_path}/#{path}" + + if only_path.to_bool + Sass::Script::String.new(clean_path(path)) + else + clean_url(path) + end end - def image_url(path) + def image_url(path, only_path = Sass::Script::Bool.new(false)) path = path.value # get to the string value of the literal. if path =~ %r{^#{Regexp.escape(Compass.configuration.http_images_path)}/(.*)} @@ -79,16 +90,24 @@ module Compass::SassExtensions::Functions::Urls # prepend the asset host if there is one. path = "#{asset_host}#{'/' unless path[0..0] == "/"}#{path}" if asset_host - clean_url(path) + if only_path.to_bool + Sass::Script::String.new(clean_path(path)) + else + clean_url(path) + end end private - # Emits a url, taking off any leading "./" - def clean_url(url) + # Emits a path, taking off any leading "./" + def clean_path(url) url = url.to_s url = url[0..1] == "./" ? url[2..-1] : url - Sass::Script::String.new("url('#{url}')") + end + + # Emits a url, taking off any leading "./" + def clean_url(url) + Sass::Script::String.new("url('#{clean_path(url)}')") end def relative? From 776b772c085e8fba5ace9cb24e5502a81b47fd8b Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 5 Aug 2010 21:16:51 -0700 Subject: [PATCH 54/81] [Rails] Don't emit configuration files when installing extensions into an existing project. --- lib/compass/commands/stamp_pattern.rb | 2 +- lib/compass/installers/base.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/compass/commands/stamp_pattern.rb b/lib/compass/commands/stamp_pattern.rb index fb45bf34..eedacc70 100644 --- a/lib/compass/commands/stamp_pattern.rb +++ b/lib/compass/commands/stamp_pattern.rb @@ -72,7 +72,7 @@ Options: # all commands must implement perform def perform installer.init - installer.run(:skip_finalization => true) + installer.run(:skip_finalization => true, :skip_preparation => true) UpdateProject.new(working_path, options).perform if installer.compilation_required? installer.finalize(options.merge(:create => is_project_creation?)) end diff --git a/lib/compass/installers/base.rb b/lib/compass/installers/base.rb index 079f36b4..36c23d6d 100644 --- a/lib/compass/installers/base.rb +++ b/lib/compass/installers/base.rb @@ -29,7 +29,7 @@ module Compass # Every installer must conform to the installation strategy of prepare, install, and then finalize. # A default implementation is provided for each step. def run(run_options = {}) - prepare + prepare unless run_options[:skip_preparation] install unless options[:prepare] finalize(options.merge(run_options)) unless options[:prepare] || run_options[:skip_finalization] end From 03221b9e7c9e96dd3384529177ceb741c30ff4f8 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 5 Aug 2010 21:18:11 -0700 Subject: [PATCH 55/81] [Extensions] Manifests don't have to be hard. Allow discovery of basic assets and follow conventions for templates. --- doc-src/content/tutorials/extensions.markdown | 20 ++++-- lib/compass/installers/manifest.rb | 64 ++++++++++++++++--- 2 files changed, 70 insertions(+), 14 deletions(-) diff --git a/doc-src/content/tutorials/extensions.markdown b/doc-src/content/tutorials/extensions.markdown index 2e25f05b..a928abfe 100644 --- a/doc-src/content/tutorials/extensions.markdown +++ b/doc-src/content/tutorials/extensions.markdown @@ -165,14 +165,26 @@ You may also see some real manifest files here: ### Manifest Declarations -There are six kinds of manifest declarations: +**Easy Mode:** If you just have some basic files and nothing fancy going on, simply place this line in your manifest: + + discover :all + +This will cause compass to find all the files in your template and use the files' extension to determine where they should go. Alternatively, you can request that compass only discover files of a certain type. For example, the following will only discover javascript and image assets, you could then declare other file types on your own. + + discover :javascripts + discover :images + +The following types may be discovered: `:stylesheets`, `:images`, `:javascripts`, `:fonts`, `:html`, `:files`, and `:directories` + +**Normal Mode:** There are seven kinds of manifest declarations: 1. `stylesheet` - Declares a sass file. 2. `image` - Declares an image. 3. `javascript` - Declares a javascript file. -4. `html` - Declares an html file. -5. `file` - Declares a random file. -6. `directory` - Declares a directory should be created. +4. `font` - Declares a font file. +5. `html` - Declares an html file. +6. `file` - Declares a random file. +7. `directory` - Declares a directory should be created. All declarations take the path to the file as their first argument. Note that the normal slash `/` can and should be used in a manifest. Compass will take care of diff --git a/lib/compass/installers/manifest.rb b/lib/compass/installers/manifest.rb index 4b2ea19e..34fd588e 100644 --- a/lib/compass/installers/manifest.rb +++ b/lib/compass/installers/manifest.rb @@ -20,7 +20,19 @@ module Compass parse(manifest_file) if manifest_file end - def self.type(t) + def self.known_extensions + @known_extensions ||= {} + end + + def self.plural_types + @plural_types ||= {} + end + + def self.type(t, options = {}) + Array(options[:extensions]).each do |ext| + self.known_extensions[ext] = t + end + self.plural_types[options[:plural]] = t if options[:plural] eval <<-END def #{t}(from, options = {}) @entries << Entry.new(:#{t}, from, options) @@ -34,13 +46,35 @@ module Compass END end - type :stylesheet - type :image - type :javascript - type :font - type :file - type :html - type :directory + type :stylesheet, :plural => :stylesheets, :extensions => %w(scss sass) + type :image, :plural => :images, :extensions => %w(png gif jpg jpeg tiff gif) + type :javascript, :plural => :javascripts, :extensions => %w(js) + type :font, :plural => :fonts, :extensions => %w(otf woff ttf) + type :html, :plural => :html, :extensions => %w(html haml) + type :file :plural => :files + type :directory, :plural => :directories + + def discover(type) + type = self.class.plural_types[type] || type + dir = File.dirname(@manifest_file) + Dir.glob("#{dir}/**/*").each do |file| + next if /manifest\.rb/ =~ file + short_name = file[(dir.length+1)..-1] + options = {} + ext = if File.extname(short_name) == ".erb" + options[:erb] = true + File.extname(short_name[0..-5]) + else + File.extname(short_name) + end[1..-1] + file_type = self.class.known_extensions[ext] + file_type = :file if file_type.nil? + file_type = :directory if File.directory?(file) + if type == :all || type == file_type + send(file_type, short_name, options) + end + end + end def help(value = nil) if value @@ -96,13 +130,23 @@ module Compass @compile_after_generation = false end + def with_manifest(manifest_file) + @manifest_file = manifest_file + yield + ensure + @manifest_file = nil + end + # parses a manifest file which is a ruby script # evaluated in a Manifest instance context def parse(manifest_file) - open(manifest_file) do |f| - eval(f.read, instance_binding, manifest_file) + with_manifest(manifest_file) do + open(manifest_file) do |f| + eval(f.read, instance_binding, manifest_file) + end end end + def instance_binding binding end From 87b1d728853a9ebcd1d588d0a986c68cd3fd53de Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 5 Aug 2010 21:18:34 -0700 Subject: [PATCH 56/81] Test case for fonts --- test/fixtures/stylesheets/compass/css/fonts.css | 3 +++ test/fixtures/stylesheets/compass/sass/fonts.sass | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 test/fixtures/stylesheets/compass/css/fonts.css create mode 100644 test/fixtures/stylesheets/compass/sass/fonts.sass diff --git a/test/fixtures/stylesheets/compass/css/fonts.css b/test/fixtures/stylesheets/compass/css/fonts.css new file mode 100644 index 00000000..596b9a06 --- /dev/null +++ b/test/fixtures/stylesheets/compass/css/fonts.css @@ -0,0 +1,3 @@ +@font-face { + font-family: "font1"; + src: local("☺"), url('/tmp/fonts/font1.woff') format('woff'); } diff --git a/test/fixtures/stylesheets/compass/sass/fonts.sass b/test/fixtures/stylesheets/compass/sass/fonts.sass new file mode 100644 index 00000000..fdbef5b5 --- /dev/null +++ b/test/fixtures/stylesheets/compass/sass/fonts.sass @@ -0,0 +1,3 @@ +@import compass/css3/font-face + ++font-face("font1", font-files("font1.woff", woff)) \ No newline at end of file From 20b5f88b644cb20c76fe6204287805b4e07cb4f0 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 5 Aug 2010 21:22:07 -0700 Subject: [PATCH 57/81] Prepare for release --- VERSION.yml | 4 ++-- doc-src/content/CHANGELOG.markdown | 11 +++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/VERSION.yml b/VERSION.yml index 10ea9494..f4977bd3 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -1,5 +1,5 @@ --- :major: 0 :minor: 10 -:patch: 3 -:build: 0 +:patch: 4 +:build: pre.1 diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index b7f9d41d..51d26d7d 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -7,8 +7,15 @@ layout: article COMPASS CHANGELOG ================= -0.10.3.0 (8/1/2010) -------------------- +0.10.4.pre.1 (8/5/2010) +----------------------- + +* [Extensions] Make it easier to create manifest files. +* [Rails] Don't install configuration files when installing extensions. +* [Compass Core] All url helpers now accept a second argument that when true will cause only the path to be emitted. This allows the url helpers to be used with IE filters. + +0.10.3 (8/1/2010) +----------------- ### !important From 973a568c1d33d59d7d878ddd508eabcc2902de83 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 5 Aug 2010 22:11:39 -0700 Subject: [PATCH 58/81] Tests are more useful if you actually run them. --- VERSION.yml | 2 +- doc-src/content/CHANGELOG.markdown | 4 +++- lib/compass/commands/stamp_pattern.rb | 2 +- lib/compass/installers/manifest.rb | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/VERSION.yml b/VERSION.yml index f4977bd3..86c8e45b 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -2,4 +2,4 @@ :major: 0 :minor: 10 :patch: 4 -:build: pre.1 +:build: pre.2 diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 51d26d7d..8ec601fb 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -7,8 +7,10 @@ layout: article COMPASS CHANGELOG ================= -0.10.4.pre.1 (8/5/2010) + +0.10.4.pre.2 (8/5/2010) ----------------------- +*Note:* 0.10.4.pre.1 had a bug and was yanked. * [Extensions] Make it easier to create manifest files. * [Rails] Don't install configuration files when installing extensions. diff --git a/lib/compass/commands/stamp_pattern.rb b/lib/compass/commands/stamp_pattern.rb index eedacc70..d2a164a5 100644 --- a/lib/compass/commands/stamp_pattern.rb +++ b/lib/compass/commands/stamp_pattern.rb @@ -72,7 +72,7 @@ Options: # all commands must implement perform def perform installer.init - installer.run(:skip_finalization => true, :skip_preparation => true) + installer.run(:skip_finalization => true, :skip_preparation => !is_project_creation?) UpdateProject.new(working_path, options).perform if installer.compilation_required? installer.finalize(options.merge(:create => is_project_creation?)) end diff --git a/lib/compass/installers/manifest.rb b/lib/compass/installers/manifest.rb index 34fd588e..b5faf022 100644 --- a/lib/compass/installers/manifest.rb +++ b/lib/compass/installers/manifest.rb @@ -51,7 +51,7 @@ module Compass type :javascript, :plural => :javascripts, :extensions => %w(js) type :font, :plural => :fonts, :extensions => %w(otf woff ttf) type :html, :plural => :html, :extensions => %w(html haml) - type :file :plural => :files + type :file, :plural => :files type :directory, :plural => :directories def discover(type) From 46b4ce1679cc964a6b8d7ad33eaa419a25761d64 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 6 Aug 2010 11:36:00 -0700 Subject: [PATCH 59/81] [Rails] bug fix: the new rails initializer did not find old configuration files (config/compass.config) --- lib/compass/app_integration/rails.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/compass/app_integration/rails.rb b/lib/compass/app_integration/rails.rb index 430e4c2c..87ba573f 100644 --- a/lib/compass/app_integration/rails.rb +++ b/lib/compass/app_integration/rails.rb @@ -35,8 +35,8 @@ module Compass end def initialize! - rails_root = (defined?(Rails) ? Rails.root : RAILS_ROOT).to_s - Compass.add_project_configuration(File.join(root, "config", "compass.rb")) + config_file = Compass.detect_configuration_file(root) + Compass.add_project_configuration(config_file) Compass.discover_extensions! Compass.configure_sass_plugin! Compass.handle_configuration_change! From 813c817eb2ec11e089912725f746472c7201224a Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 6 Aug 2010 11:52:01 -0700 Subject: [PATCH 60/81] Prepare for release. --- VERSION.yml | 2 +- doc-src/content/CHANGELOG.markdown | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/VERSION.yml b/VERSION.yml index 86c8e45b..5a846718 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -2,4 +2,4 @@ :major: 0 :minor: 10 :patch: 4 -:build: pre.2 +:build: pre.3 diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 8ec601fb..6335b7a4 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -7,6 +7,10 @@ layout: article COMPASS CHANGELOG ================= +0.10.4.pre.3 (8/5/2010) +----------------------- + +* [Rails] Fixed a bug introduced in 0.10.3 that caused rails applications using the old configuration file (config/compass.config) to break. 0.10.4.pre.2 (8/5/2010) ----------------------- From 30c28a76bfc12449be93a861fc7b1ae13f398f5c Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 6 Aug 2010 12:59:54 -0700 Subject: [PATCH 61/81] Update the rails version of image_url to match the new signature. --- lib/compass/app_integration/rails/actionpack2/urls.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/compass/app_integration/rails/actionpack2/urls.rb b/lib/compass/app_integration/rails/actionpack2/urls.rb index f7eb3432..1847a722 100644 --- a/lib/compass/app_integration/rails/actionpack2/urls.rb +++ b/lib/compass/app_integration/rails/actionpack2/urls.rb @@ -1,8 +1,12 @@ module Compass::SassExtensions::Functions::Urls - def image_url_with_rails_integration(path) + def image_url_with_rails_integration(path, only_path = Sass::Script::Bool.new(false)) if (@controller = Sass::Plugin.rails_controller) && @controller.respond_to?(:request) && @controller.request begin - Sass::Script::String.new "url(#{image_path(path.value)})" + if only_path.to_bool + Sass::Script::String.new image_path(path.value) + else + Sass::Script::String.new "url(#{image_path(path.value)})" + end ensure @controller = nil end From de651db9ad053dcdfd239fddee9738de75791041 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 6 Aug 2010 13:05:13 -0700 Subject: [PATCH 62/81] Prepare for release --- VERSION.yml | 2 +- doc-src/content/CHANGELOG.markdown | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/VERSION.yml b/VERSION.yml index 5a846718..ce348cf9 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -2,4 +2,4 @@ :major: 0 :minor: 10 :patch: 4 -:build: pre.3 +:build: pre.4 diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 6335b7a4..99306616 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -7,7 +7,12 @@ layout: article COMPASS CHANGELOG ================= -0.10.4.pre.3 (8/5/2010) +0.10.4.pre.4 (8/6/2010) +----------------------- + +* [Rails] Fixed a bug introduced in 0.10.4.pre.2 that caused rails projects to fail when passing the second argument to image_url. + +0.10.4.pre.3 (8/6/2010) ----------------------- * [Rails] Fixed a bug introduced in 0.10.3 that caused rails applications using the old configuration file (config/compass.config) to break. From 63cbc21d53edd711a3cc95ba567df756cba83640 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 8 Aug 2010 10:32:56 -0700 Subject: [PATCH 63/81] Prepare for release. --- VERSION.yml | 2 +- doc-src/content/CHANGELOG.markdown | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/VERSION.yml b/VERSION.yml index ce348cf9..216a351b 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -2,4 +2,4 @@ :major: 0 :minor: 10 :patch: 4 -:build: pre.4 +#:build: pre.4 diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 99306616..88bef6fa 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -7,21 +7,11 @@ layout: article COMPASS CHANGELOG ================= -0.10.4.pre.4 (8/6/2010) ------------------------ - -* [Rails] Fixed a bug introduced in 0.10.4.pre.2 that caused rails projects to fail when passing the second argument to image_url. - -0.10.4.pre.3 (8/6/2010) +0.10.4 (8/08/2010) ----------------------- * [Rails] Fixed a bug introduced in 0.10.3 that caused rails applications using the old configuration file (config/compass.config) to break. - -0.10.4.pre.2 (8/5/2010) ------------------------ -*Note:* 0.10.4.pre.1 had a bug and was yanked. - -* [Extensions] Make it easier to create manifest files. +* [Extensions] Make it easier to create manifest files by allowing template files to be discovered. See the Manifest Declarations section of [extensions tutorial](http://compass-style.org/docs/tutorials/extensions/) for details. * [Rails] Don't install configuration files when installing extensions. * [Compass Core] All url helpers now accept a second argument that when true will cause only the path to be emitted. This allows the url helpers to be used with IE filters. From c899b78aed3810437b7c7ef2d273b5f2b5bc7b8b Mon Sep 17 00:00:00 2001 From: ericdfields Date: Wed, 11 Aug 2010 00:24:46 +0800 Subject: [PATCH 64/81] added additional html5 block-level elements per recommended reset stylesheet: http://html5doctor.com/html-5-reset-stylesheet/ --- frameworks/compass/stylesheets/compass/reset/_utilities.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/compass/stylesheets/compass/reset/_utilities.scss b/frameworks/compass/stylesheets/compass/reset/_utilities.scss index e68eba2f..d9ba6d9c 100644 --- a/frameworks/compass/stylesheets/compass/reset/_utilities.scss +++ b/frameworks/compass/stylesheets/compass/reset/_utilities.scss @@ -104,7 +104,7 @@ // This reset provides a basic reset for html5 elements // so they are rendered correctly in browsers that don't recognize them. @mixin reset-html5 { - section, article, aside, header, footer, nav, dialog, figure { + article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary { display: block; } } // Resets the display of inline and block elements to their default display From d20603296c579c225142bc8344671c098ada0a5c Mon Sep 17 00:00:00 2001 From: Eric Meyer Date: Wed, 11 Aug 2010 16:35:08 -0600 Subject: [PATCH 65/81] inline-block-list mixin --- .../utilities/lists/_inline-block-list.scss | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 frameworks/compass/stylesheets/compass/utilities/lists/_inline-block-list.scss diff --git a/frameworks/compass/stylesheets/compass/utilities/lists/_inline-block-list.scss b/frameworks/compass/stylesheets/compass/utilities/lists/_inline-block-list.scss new file mode 100644 index 00000000..dfc7c1b5 --- /dev/null +++ b/frameworks/compass/stylesheets/compass/utilities/lists/_inline-block-list.scss @@ -0,0 +1,46 @@ +// Inline-Block list layout module. +// +// Easy mode using simple descendant li selectors: +// +// ul.nav +// +inline-block-list +// +// Advanced mode: +// If you need to target the list items using a different selector then use +// +inline-block-list-container on your ul/ol and +inline-block-list-item on your li. +// This may help when working on layouts involving nested lists. For example: +// +// ul.nav +// +inline-block-list-container +// > li +// +inline-block-list-item + +@import "bullets"; +@import "horizontal-list"; +@import "compass/utilities/general/float"; + +// Can be mixed into any selector that target a ul or ol that is meant +// to have an inline-block layout. Used to implement +inline-block-list. +@mixin inline-block-list-container { + @include horizontal-list-container; } + +// Can be mixed into any li selector that is meant to participate in a horizontal layout. +// Used to implement +inline-block-list. + +@mixin inline-block-list-item($padding: false) { + @include no-bullet; + @include inline-block; + white-space: nowrap; + @if $padding { + padding: { + left: $padding; + right: $padding; + }; + } +} + +// A list(ol,ul) that is layed out such that the elements are inline-block and won't wrap. +@mixin inline-block-list($padding: false) { + @include inline-block-list-container; + li { + @include inline-block-list-item($padding); } } From bc12d26f1752d1f46d4d786fac5167a2bbaf3757 Mon Sep 17 00:00:00 2001 From: Eric Meyer Date: Wed, 11 Aug 2010 17:15:58 -0600 Subject: [PATCH 66/81] inline-block-list documentation --- .../utilities/lists/inline-block-list.haml | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 doc-src/content/reference/compass/utilities/lists/inline-block-list.haml diff --git a/doc-src/content/reference/compass/utilities/lists/inline-block-list.haml b/doc-src/content/reference/compass/utilities/lists/inline-block-list.haml new file mode 100644 index 00000000..c315e30b --- /dev/null +++ b/doc-src/content/reference/compass/utilities/lists/inline-block-list.haml @@ -0,0 +1,30 @@ +--- +title: Compass Inline-Block List +crumb: Inline-Block List +framework: compass +stylesheet: compass/utilities/lists/_inline-block-list.scss +layout: core +meta_description: set list-elements to inline-block so they appear horizontally while retaining their structure. +nav_stylesheet: compass/_utilities.scss +classnames: + - reference + - core + - utilities +--- +- render 'reference' do + :markdown + Easy mode using simple descendant li selectors: + + ul.nav + +inline-block-list + + Advanced mode: + If you need to target the list items using a different selector then use + +inline-block-list-container on your ul/ol and +inline-block-list-item on + your li. This may help when working on layouts involving nested lists. For + example: + + ul.nav + +inline-block-list-container + > li + +inline-block-list-item From 64a5527ecf6ef2c9359d595b0075f87147feca46 Mon Sep 17 00:00:00 2001 From: Eric Meyer Date: Wed, 11 Aug 2010 17:18:45 -0600 Subject: [PATCH 67/81] inline-block-list tests --- .../stylesheets/compass/css/lists.css | 40 +++++++++++++++++++ .../stylesheets/compass/sass/lists.scss | 16 ++++---- 2 files changed, 49 insertions(+), 7 deletions(-) diff --git a/test/fixtures/stylesheets/compass/css/lists.css b/test/fixtures/stylesheets/compass/css/lists.css index 96195f04..d4d6a68c 100644 --- a/test/fixtures/stylesheets/compass/css/lists.css +++ b/test/fixtures/stylesheets/compass/css/lists.css @@ -61,6 +61,46 @@ ul.right-horizontal { ul.right-horizontal li:last-child, ul.right-horizontal li.last { padding-left: 0px; } +ul.inline-block { + margin: 0; + padding: 0; + border: 0; + outline: 0; + overflow: hidden; + *zoom: 1; } + ul.inline-block li { + list-style-image: none; + list-style-type: none; + margin-left: 0px; + display: -moz-inline-box; + -moz-box-orient: vertical; + display: inline-block; + vertical-align: middle; + *display: inline; + *vertical-align: auto; + white-space: nowrap; } + +ul.wide-inline-block { + margin: 0; + padding: 0; + border: 0; + outline: 0; + overflow: hidden; + *zoom: 1; } + ul.wide-inline-block li { + list-style-image: none; + list-style-type: none; + margin-left: 0px; + display: -moz-inline-box; + -moz-box-orient: vertical; + display: inline-block; + vertical-align: middle; + *display: inline; + *vertical-align: auto; + white-space: nowrap; + padding-left: 10px; + padding-right: 10px; } + ul.inline { list-style-type: none; } ul.inline, ul.inline li { diff --git a/test/fixtures/stylesheets/compass/sass/lists.scss b/test/fixtures/stylesheets/compass/sass/lists.scss index 3d9b1de6..bdbc3788 100644 --- a/test/fixtures/stylesheets/compass/sass/lists.scss +++ b/test/fixtures/stylesheets/compass/sass/lists.scss @@ -1,9 +1,11 @@ @import "compass/utilities/lists"; -ul.horizontal { @include horizontal-list; } -ul.wide-horizontal { @include horizontal-list(10px); } -ul.right-horizontal { @include horizontal-list(4px, right); } -ul.inline { @include inline-list; } -ul.comma { @include comma-delimited-list; } -ul.no-bullets { @include no-bullets; } -ul.pretty { @include pretty-bullets("4x6.png"); } \ No newline at end of file +ul.horizontal { @include horizontal-list; } +ul.wide-horizontal { @include horizontal-list(10px); } +ul.right-horizontal { @include horizontal-list(4px, right); } +ul.inline-block { @include inline-block-list; } +ul.wide-inline-block { @include inline-block-list(10px); } +ul.inline { @include inline-list; } +ul.comma { @include comma-delimited-list; } +ul.no-bullets { @include no-bullets; } +ul.pretty { @include pretty-bullets("4x6.png"); } \ No newline at end of file From ec648f17b072c711b77be869f07a529c635dabfe Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Wed, 25 Aug 2010 08:39:59 -0700 Subject: [PATCH 68/81] Bug fix: make the path-based configuration really work right. --- .../configuration-reference.markdown | 66 +++++++++++++------ lib/compass/commands/update_project.rb | 4 +- lib/compass/configuration/defaults.rb | 14 ++-- lib/compass/exec.rb | 1 + lib/compass/exec/project_options_parser.rb | 16 +++-- lib/compass/sass_extensions/functions/urls.rb | 9 ++- 6 files changed, 73 insertions(+), 37 deletions(-) diff --git a/doc-src/content/tutorials/configuration-reference.markdown b/doc-src/content/tutorials/configuration-reference.markdown index d3a2d1f2..d62b89b7 100644 --- a/doc-src/content/tutorials/configuration-reference.markdown +++ b/doc-src/content/tutorials/configuration-reference.markdown @@ -108,6 +108,18 @@ command line will override the corresponding settings in your configuration file Defaults to "stylesheets". + + css_path + String + The full path to where css stylesheets are kept. + Defaults to <project_path>/<css_dir>. + + + + http_stylesheets_path + String + The full http path to stylesheets on the web server. Defaults to http_path + "/" + css_dir. + sass_dir String @@ -115,6 +127,13 @@ command line will override the corresponding settings in your configuration file It is relative to the project_path. Defaults to "src". + + sass_path + String + The full path to where sass stylesheets are kept. + Defaults to <project_path>/<sass_dir>. + + images_dir String @@ -123,6 +142,20 @@ command line will override the corresponding settings in your configuration file Defaults to "images". + + images_path + String + The full path to where images are kept. + Defaults to <project_path>/<images_dir>. + + + + http_images_path + String + The full http path to images on the web server. + Defaults to http_path + "/" + images_dir. + + javascripts_dir String @@ -131,6 +164,20 @@ command line will override the corresponding settings in your configuration file "javascripts". + + javascripts_path + String + The full path to where javascripts are kept. + Defaults to <project_path>/<javascripts_dir>. + + + + http_javascripts_path + String + The full http path to javascripts on the web server. + Defaults to http_path + "/" + javascripts_dir. + + output_style Symbol @@ -147,25 +194,6 @@ command line will override the corresponding settings in your configuration file using the http path for that asset type. - - http_images_path - String - The full http path to images on the web server. - Defaults to http_path + "/" + images_dir. - - - - http_stylesheets_path - String - The full http path to stylesheets on the web server. Defaults to http_path + "/" + css_dir. - - - http_javascripts_path - String - The full http path to javascripts on the web server. - Defaults to http_path + "/" + javascripts_dir. - - additional_import_paths Array of Strings diff --git a/lib/compass/commands/update_project.rb b/lib/compass/commands/update_project.rb index 24ebb190..1d84185e 100644 --- a/lib/compass/commands/update_project.rb +++ b/lib/compass/commands/update_project.rb @@ -53,8 +53,8 @@ module Compass :dry_run => options[:dry_run]) compiler_opts.merge!(additional_options) Compass::Compiler.new(working_path, - projectize(Compass.configuration.sass_dir), - projectize(Compass.configuration.css_dir), + Compass.configuration.sass_path, + Compass.configuration.css_path, compiler_opts) end diff --git a/lib/compass/configuration/defaults.rb b/lib/compass/configuration/defaults.rb index 73e54da7..db63bd3e 100644 --- a/lib/compass/configuration/defaults.rb +++ b/lib/compass/configuration/defaults.rb @@ -44,43 +44,43 @@ module Compass def default_sass_path if (pp = top_level.project_path) && (dir = top_level.sass_dir) - File.join(pp, dir) + Compass.projectize(dir, pp) end end def default_css_path if (pp = top_level.project_path) && (dir = top_level.css_dir) - File.join(pp, dir) + Compass.projectize(dir, pp) end end def default_images_path if (pp = top_level.project_path) && (dir = top_level.images_dir) - File.join(pp, dir) + Compass.projectize(dir, pp) end end def default_javascripts_path if (pp = top_level.project_path) && (dir = top_level.javascripts_dir) - File.join(pp, dir) + Compass.projectize(dir, pp) end end def default_extensions_path if (pp = top_level.project_path) && (dir = top_level.extensions_dir) - File.join(pp, dir) + Compass.projectize(dir, pp) end end def default_fonts_path if (pp = top_level.project_path) && (dir = top_level.fonts_dir) - File.join(pp, dir) + Compass.projectize(dir, pp) end end def default_cache_path if (pp = top_level.project_path) && (dir = top_level.cache_dir) - File.join(pp, dir) + Compass.projectize(dir, pp) end end diff --git a/lib/compass/exec.rb b/lib/compass/exec.rb index 08b15e8e..0d49b8e7 100644 --- a/lib/compass/exec.rb +++ b/lib/compass/exec.rb @@ -6,6 +6,7 @@ require 'compass/actions' require 'compass/installers' require 'compass/commands' require 'rbconfig' +require 'pathname' begin require 'win32console' if RbConfig::CONFIG['host_os'] =~ /mswin|mingw/ rescue LoadError diff --git a/lib/compass/exec/project_options_parser.rb b/lib/compass/exec/project_options_parser.rb index 2209353b..571e200e 100644 --- a/lib/compass/exec/project_options_parser.rb +++ b/lib/compass/exec/project_options_parser.rb @@ -3,6 +3,14 @@ module Compass::Exec::ProjectOptionsParser super set_project_options(opts) end + def set_dir_or_path(type, dir) + if Pathname.new(dir).absolute? + self.options[:"#{type}_path"] = dir.tr('\\','/') + else + self.options[:"#{type}_dir"] = dir.tr('\\','/') + end + end + def set_project_options(opts) opts.on('-c', '--config CONFIG_FILE', 'Specify the location of the configuration file explicitly.') do |configuration_file| self.options[:configuration_file] = configuration_file @@ -13,19 +21,19 @@ module Compass::Exec::ProjectOptionsParser end opts.on('--sass-dir SRC_DIR', "The source directory where you keep your sass stylesheets.") do |sass_dir| - self.options[:sass_dir] = sass_dir.tr('\\','/') + set_dir_or_path(:sass, sass_dir) end opts.on('--css-dir CSS_DIR', "The target directory where you keep your css stylesheets.") do |css_dir| - self.options[:css_dir] = css_dir.tr('\\','/') + set_dir_or_path(:css, css_dir) end opts.on('--images-dir IMAGES_DIR', "The directory where you keep your images.") do |images_dir| - self.options[:images_dir] = images_dir.tr('\\','/') + set_dir_or_path(:images, images_dir) end opts.on('--javascripts-dir JS_DIR', "The directory where you keep your javascripts.") do |javascripts_dir| - self.options[:javascripts_dir] = javascripts_dir.tr('\\','/') + set_dir_or_path(:javascripts, javascripts_dir) end opts.on('-e ENV', '--environment ENV', [:development, :production], 'Use sensible defaults for your current environment.', diff --git a/lib/compass/sass_extensions/functions/urls.rb b/lib/compass/sass_extensions/functions/urls.rb index 85754d37..615c4a91 100644 --- a/lib/compass/sass_extensions/functions/urls.rb +++ b/lib/compass/sass_extensions/functions/urls.rb @@ -4,7 +4,7 @@ module Compass::SassExtensions::Functions::Urls # Compute the path to the stylesheet, either root relative or stylesheet relative # or nil if the http_images_path is not set in the configuration. http_stylesheets_path = if relative? - compute_relative_path(Compass.configuration.css_dir) + compute_relative_path(Compass.configuration.css_path) elsif Compass.configuration.http_stylesheets_path Compass.configuration.http_stylesheets_path else @@ -30,7 +30,7 @@ module Compass::SassExtensions::Functions::Urls # Compute the path to the font file, either root relative or stylesheet relative # or nil if the http_fonts_path cannot be determined from the configuration. http_fonts_path = if relative? - compute_relative_path(Compass.configuration.fonts_dir) + compute_relative_path(Compass.configuration.fonts_path) else Compass.configuration.http_fonts_path end @@ -59,7 +59,7 @@ module Compass::SassExtensions::Functions::Urls # Compute the path to the image, either root relative or stylesheet relative # or nil if the http_images_path is not set in the configuration. http_images_path = if relative? - compute_relative_path(Compass.configuration.images_dir) + compute_relative_path(Compass.configuration.images_path) elsif Compass.configuration.http_images_path Compass.configuration.http_images_path else @@ -118,9 +118,8 @@ module Compass::SassExtensions::Functions::Urls path[0..0] == "/" || path[0..3] == "http" end - def compute_relative_path(dir) + def compute_relative_path(path) if (target_css_file = options[:css_filename]) - path = File.join(Compass.configuration.project_path, dir) Pathname.new(path).relative_path_from(Pathname.new(File.dirname(target_css_file))).to_s end end From a8da95d4f1b7f27697248cceb3864c01a5254de2 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Wed, 25 Aug 2010 08:54:33 -0700 Subject: [PATCH 69/81] Get the imports straightend out for the new mixins. --- frameworks/compass/stylesheets/compass/utilities/_lists.scss | 1 + .../stylesheets/compass/utilities/lists/_inline-block-list.scss | 1 + 2 files changed, 2 insertions(+) diff --git a/frameworks/compass/stylesheets/compass/utilities/_lists.scss b/frameworks/compass/stylesheets/compass/utilities/_lists.scss index 66dcfefe..3365f30a 100644 --- a/frameworks/compass/stylesheets/compass/utilities/_lists.scss +++ b/frameworks/compass/stylesheets/compass/utilities/_lists.scss @@ -1,3 +1,4 @@ @import "lists/horizontal-list"; @import "lists/inline-list"; +@import "lists/inline-block-list"; @import "lists/bullets"; diff --git a/frameworks/compass/stylesheets/compass/utilities/lists/_inline-block-list.scss b/frameworks/compass/stylesheets/compass/utilities/lists/_inline-block-list.scss index dfc7c1b5..907d443a 100644 --- a/frameworks/compass/stylesheets/compass/utilities/lists/_inline-block-list.scss +++ b/frameworks/compass/stylesheets/compass/utilities/lists/_inline-block-list.scss @@ -18,6 +18,7 @@ @import "bullets"; @import "horizontal-list"; @import "compass/utilities/general/float"; +@import "compass/css3/inline-block"; // Can be mixed into any selector that target a ul or ol that is meant // to have an inline-block layout. Used to implement +inline-block-list. From 9a81fa560e6f997d9d4451b15b679f1ba74455e3 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Wed, 25 Aug 2010 11:53:16 -0700 Subject: [PATCH 70/81] bump version. --- VERSION.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION.yml b/VERSION.yml index 216a351b..71532970 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -1,5 +1,5 @@ --- :major: 0 :minor: 10 -:patch: 4 -#:build: pre.4 +:patch: 5 +:build: pre.0 From b6b072378872d458136b0c11a681afdccfab8972 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 26 Aug 2010 22:22:13 -0700 Subject: [PATCH 71/81] Read assets in binary mode for the windows users. --- lib/compass/sass_extensions/functions/inline_image.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compass/sass_extensions/functions/inline_image.rb b/lib/compass/sass_extensions/functions/inline_image.rb index 77035ebd..59dd60a7 100644 --- a/lib/compass/sass_extensions/functions/inline_image.rb +++ b/lib/compass/sass_extensions/functions/inline_image.rb @@ -46,7 +46,7 @@ private def data(real_path) if File.readable?(real_path) - [File.read(real_path)].pack('m').gsub("\n","") + [File.open(real_path, "rb") {|io| io.read}].pack('m').gsub("\n","") else raise Compass::Error, "File not found or cannot be read: #{real_path}" end From b13f5ac7136e10ca59b7cd8a98765151a01876bf Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 26 Aug 2010 23:02:14 -0700 Subject: [PATCH 72/81] Update the CHANGELOG for the 0.10.5 release --- doc-src/content/CHANGELOG.markdown | 19 ++- examples/compass/src/bp_layout.scss | 18 +++ .../stylesheets/compass/layout/_floated.scss | 111 ++++++++++++++++++ 3 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 examples/compass/src/bp_layout.scss create mode 100644 frameworks/compass/stylesheets/compass/layout/_floated.scss diff --git a/doc-src/content/CHANGELOG.markdown b/doc-src/content/CHANGELOG.markdown index 88bef6fa..d457a3fa 100644 --- a/doc-src/content/CHANGELOG.markdown +++ b/doc-src/content/CHANGELOG.markdown @@ -7,8 +7,23 @@ layout: article COMPASS CHANGELOG ================= +0.10.5 (UNRELEASED) +------------------- + +* The [HTML5 Reset mixin][html5-reset] now resets the following new elements: + `canvas`, `details`, `figcaption`, `hgroup`, `menu`, `summary` +* A new Utility mixin has been added: [inline-block-list][inline-block-list]. +* Compass projects can now (as was always intended) use paths outside of the project directory + for css, images, fonts, etc by configuring those locations using `xxx_path` instead of + `xxx_dir`. For instance: `css_path = "/var/www/docroot/css"`. It is recommended + to set the corresponding `http_xxx_path` when you do this, for instance: + `http_stylesheets_path = "/css"`. On the command line, all absolute urls are + treated as paths instead of relative directories so + `--css-dir /var/www/docroot/css` will set `css_path`. Should both a directory + and a path be specified, the path will override the corresponding directory. + 0.10.4 (8/08/2010) ------------------------ +------------------ * [Rails] Fixed a bug introduced in 0.10.3 that caused rails applications using the old configuration file (config/compass.config) to break. * [Extensions] Make it easier to create manifest files by allowing template files to be discovered. See the Manifest Declarations section of [extensions tutorial](http://compass-style.org/docs/tutorials/extensions/) for details. @@ -817,3 +832,5 @@ Almost definitely. Please let me know if you encounter any problems and I'll get [der-rich]: http://github.com/der-rich [adamstac]: http://github.com/adamstac [ttilley]: http://github.com/ttilley +[inline-block-list]: http://compass-style.org/docs/reference/compass/utilities/lists/inline-block-list/ +[html5-reset]: http://compass-style.org/docs/reference/compass/reset/utilities/#mixin-reset-html5 \ No newline at end of file diff --git a/examples/compass/src/bp_layout.scss b/examples/compass/src/bp_layout.scss new file mode 100644 index 00000000..0f8775a4 --- /dev/null +++ b/examples/compass/src/bp_layout.scss @@ -0,0 +1,18 @@ +@import "compass/layout/floated"; + +// It's easy to build a grid with a floated layout +$gutter: $compass-gutter-width; +$col-width: 30px; +$number-of-columns: 24; +$total-width: $number-of-columns * ($col-width + $gutter) - $gutter ; + +@mixin span($n) { + width: $n * ($col-width + $gutter) - $gutter; +} + +// Provides a number of base classes. +@include act-like-blueprint; + +#page { @extend .container; @include span($number-of-columns); } +#sidebar { @extend .column; @include span(8); } +#content { @extend .column; @include span(16); @extend .last; } diff --git a/frameworks/compass/stylesheets/compass/layout/_floated.scss b/frameworks/compass/stylesheets/compass/layout/_floated.scss new file mode 100644 index 00000000..00ee634c --- /dev/null +++ b/frameworks/compass/stylesheets/compass/layout/_floated.scss @@ -0,0 +1,111 @@ +@import "compass/utilities/general/float"; +@import "compass/utilities/general/clearfix"; + +// Direction of the float +$compass-float-direction: left !default; +// Set to 0 to disable gutters +$compass-gutter-width: 10px !default; +$compass-left-gutter-width: ceil($compass-gutter-width / 2); +$compass-right-gutter-width: floor($compass-gutter-width / 2); + +// A floated element is generally assigned a width to achieve table-less alignment +@mixin floated($side : $compass-float-direction, + $left-gutter : $compass-left-gutter-width, + $right-gutter : $compass-right-gutter-width) { + @include float($side); + @if $left-gutter > 0 { + margin-left: $left-gutter; + } + @if $right-gutter > 0 { + margin-right: $right-gutter; + } +} + +// Remove the gutter for a particular side of a floated element +// pass `both` to disable the gutter on both sides. +@mixin gutterless($side) { + margin-#{$side}: 0; + @if $side == both { + margin-#{opposite-position($side)}: 0; + } +} + +// provides the base structure required to make an element pushable in +// the specified direction (which defaults to `right`). +@mixin pushable($side: opposite-position($compass-float-direction)) { + @include float($side); + position: relative; +} + +// provides the base structure required to make an element pullable in +// the specified direction (which defaults to `left`). +@mixin pullable($side : $compass-float-direction) { + @include float($side); + position: relative; +} + +// push an element in the specified direction by the specified amount. +@mixin pushed($side, $amount) { + margin-#{$side}: -$amount; + margin-#{opposite-position($side)}: $amount; +} + +// pull an element in the specified directionn by the specified amount. +@mixin pulled($side, $amount) { + margin-#{$side}: $amount; +} + +// Take an element out of the float if it had been made floated already. +// This might be applied to an element to allow it to fill the remainder +// of a row, in which case you'll probably want to make that element also +// a float container. +@mixin sunken { + float: none; + width: auto; + margin-left: auto; + margin-right: auto; +} + +// make an element centered within its fixed-width parent. +// Can be applied to a top level float container to create +// a centered layout within the window. +@mixin centered { + margin-left: auto; + margin-right: auto; +} + +@mixin act-like-blueprint { + .clearfixed { @include pie-clearfix; } + .column { @include floated(left, 0, $compass-gutter-width); } + .last { @include gutterless(right); } + .float-container { @extend .clearfixed; } + .container { @extend .float-container; @include centered; } + .push { @include pushable; } + .pull { @include pullable; } +} + +@mixin act-like-960 { + .clearfixed { @include pie-clearfix; } + .grid { @include floated(left, $compass-gutter-left-width, $compass-gutter-right-width); } + .alpha { @include gutterless(left); } + .omega { @include gutterless(right); } + .container { @extend .clearfixed; } + .grid-container { @extend .container; @include centered; } + .push { @include pushable; } + .pull { @include pullable; } +} + +@mixin act-like-oocss { + .clearfixed { @include pie-clearfix; } + .line { @extend .clearfixed; } + .unit { @include floated(left, 0, 0); } + .lastUnit { @extend .clearfixed; @include sunken; } + .size1of1 { @include sunken; } + + @for $divisions from 2 through 5 { + @for $segment from 1 to $divisions { + .size#{$segment}of#{$divisions} { width: percentage($segment / $divisions); } + } + } +} + From 759bf32cee0bb5c1a34a5970d9806ed50abbab94 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 26 Aug 2010 23:02:37 -0700 Subject: [PATCH 73/81] link the docs to the stable branch. --- doc-src/layouts/reference.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc-src/layouts/reference.haml b/doc-src/layouts/reference.haml index e375a893..f577c504 100644 --- a/doc-src/layouts/reference.haml +++ b/doc-src/layouts/reference.haml @@ -7,7 +7,7 @@ %code @import "#{departialize(item[:stylesheet][0..-6])}" %p - - gh_url = "http://github.com/chriseppstein/compass/blob/master/frameworks/" + - gh_url = "http://github.com/chriseppstein/compass/blob/stable/frameworks/" - gh_url << "#{item[:framework]}/stylesheets/#{item[:stylesheet]}" View the %a{:href => gh_url} Source for this module on Github. From c79fd5448ccfbc49c43c05037d5faade915456cf Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Thu, 26 Aug 2010 23:03:08 -0700 Subject: [PATCH 74/81] upgrade to bundler 1.0 --- doc-src/Gemfile.lock | 169 ++++++++++++++----------------------------- doc-src/Rules | 2 - 2 files changed, 54 insertions(+), 117 deletions(-) diff --git a/doc-src/Gemfile.lock b/doc-src/Gemfile.lock index b97f7e76..4e510363 100644 --- a/doc-src/Gemfile.lock +++ b/doc-src/Gemfile.lock @@ -1,116 +1,55 @@ ---- -dependencies: - fssm: - group: - - :default - version: ">= 0" - compass: - group: - - :default - version: ">= 0" - rake: - group: - - :default - version: ">= 0" - haml: - group: - - :default - version: ">= 3.0.6" - require: - - sass - thor: - group: - - :default - version: ">= 0" - serve: - group: - - :default - version: = 0.10.2 - mime-types: - group: - - :default - version: ">= 0" - rack: - group: - - :default - version: ">= 0" - json: - group: - - :default - version: ">= 0" - nanoc3: - group: - - :default - version: ">= 0" - require: [] +GIT + remote: git://github.com/chriseppstein/nanoc.git + revision: 3982942 + branch: 3.1.x + specs: + nanoc3 (3.1.2) + cri (>= 1.0.0) - css-slideshow: - group: - - :default - version: = 0.2.0 - compass-susy-plugin: - group: - - :default - version: ">= 0.7.0.pre8" - rdiscount: - group: - - :default - version: ">= 0" - coderay: - group: - - :default - version: ">= 0" - nokogiri: - group: - - :default - version: ">= 0" -specs: -- rake: - version: 0.8.7 -- activesupport: - version: 2.3.8 -- coderay: - version: 0.9.3 -- haml: - version: 3.0.6 -- compass: - version: 0.10.2 - source: 0 -- compass-susy-plugin: - version: 0.7.0.rc2 -- cri: - version: 1.0.1 -- css-slideshow: - version: 0.2.0 -- fssm: - version: 0.1.4 -- json: - version: 1.4.3 -- mime-types: - version: "1.16" -- nanoc3: - version: 3.1.2 - source: 1 -- nokogiri: - version: 1.4.2 -- rack: - version: 1.1.0 -- rdiscount: - version: 1.6.3.2 -- serve: - version: 0.10.2 -- thor: - version: 0.13.6 -hash: 178d5e4f426c2d1a39af604e5edcd8bae16a395e -sources: -- Path: - path: !ruby/object:Pathname - path: .. -- Git: - uri: git://github.com/chriseppstein/nanoc.git - branch: 3.1.x - require: false - git: git://github.com/chriseppstein/nanoc.git - ref: 398294262623dac9bb15dcbbfc0ba33c04f8125e -- Rubygems: - uri: http://gemcutter.org +PATH + remote: /Users/chris/Projects/compass + specs: + compass (0.10.5.pre.0) + haml (>= 3.0.4) + +GEM + remote: http://rubygems.org/ + specs: + activesupport (2.3.8) + coderay (0.9.3) + compass-susy-plugin (0.7.0) + compass (>= 0.10.0) + cri (1.0.1) + css-slideshow (0.2.0) + compass (>= 0.10.0.rc3) + fssm (0.1.4) + haml (3.0.16) + json (1.4.5) + mime-types (1.16) + nokogiri (1.4.3.1) + rack (1.2.1) + rake (0.8.7) + rdiscount (1.6.5) + serve (0.10.2) + activesupport (>= 2.0.2) + thor (0.14.0) + +PLATFORMS + ruby + +DEPENDENCIES + coderay + compass! + compass-susy-plugin (>= 0.7.0.pre8) + css-slideshow (= 0.2.0) + fssm + haml (>= 3.0.6) + json + mime-types + nanoc3! + nokogiri + rack + rake + rdiscount + serve (= 0.10.2) + thor diff --git a/doc-src/Rules b/doc-src/Rules index 25875512..0e3d13c4 100644 --- a/doc-src/Rules +++ b/doc-src/Rules @@ -2,8 +2,6 @@ require 'compass' -puts "Compass running from: #{Compass.lib_directory}" - Compass.add_configuration "#{File.dirname(__FILE__)}/.compass/config.rb" SITE_ROOT = "/docs" From 576bf9d4094016516af2844a6382f6085c97bf6b Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 27 Aug 2010 07:33:47 -0700 Subject: [PATCH 75/81] bump version for release --- VERSION.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION.yml b/VERSION.yml index 71532970..25733a8b 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -2,4 +2,4 @@ :major: 0 :minor: 10 :patch: 5 -:build: pre.0 +:build: pre.1 From 8083760ef21ad51a0d220a866751e980e257254a Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 27 Aug 2010 09:30:01 -0700 Subject: [PATCH 76/81] Fix a bug in the statistics analyzer for rules with interpolation. --- lib/compass/stats.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compass/stats.rb b/lib/compass/stats.rb index 5bf7bddc..243b42af 100644 --- a/lib/compass/stats.rb +++ b/lib/compass/stats.rb @@ -11,7 +11,7 @@ module Compass def visit(node) self.prop_count += 1 if node.is_a?(Sass::Tree::PropNode) && !node.children.any? if node.is_a?(Sass::Tree::RuleNode) - self.rule_count += node.rule.map{|r| r.split(/,/)}.flatten.compact.size + self.rule_count += node.rule.reject{|r| r.is_a?(Sass::Script::Node)}.map{|r| r.split(/,/)}.flatten.compact.size end self.mixin_def_count += 1 if node.is_a?(Sass::Tree::MixinDefNode) self.mixin_count += 1 if node.is_a?(Sass::Tree::MixinNode) From 3db4760782d93eba1925291d4a5ff755ef4dee02 Mon Sep 17 00:00:00 2001 From: Andrew Vit Date: Fri, 27 Aug 2010 23:57:45 -0700 Subject: [PATCH 77/81] Fixed error: there is no opposite-position(both) --- frameworks/compass/stylesheets/compass/layout/_floated.scss | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frameworks/compass/stylesheets/compass/layout/_floated.scss b/frameworks/compass/stylesheets/compass/layout/_floated.scss index 00ee634c..65cbd126 100644 --- a/frameworks/compass/stylesheets/compass/layout/_floated.scss +++ b/frameworks/compass/stylesheets/compass/layout/_floated.scss @@ -24,9 +24,11 @@ $compass-right-gutter-width: floor($compass-gutter-width / 2); // Remove the gutter for a particular side of a floated element // pass `both` to disable the gutter on both sides. @mixin gutterless($side) { - margin-#{$side}: 0; @if $side == both { - margin-#{opposite-position($side)}: 0; + margin-left: 0; + margin-right: 0; + } @else { + margin-#{$side}: 0; } } From 7467463d13d983bbc7011ccb4e5328710748c429 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 28 Aug 2010 10:55:28 -0700 Subject: [PATCH 78/81] That wasn't supposed to be released yet. --- .../stylesheets/compass/layout/_floated.scss | 113 ------------------ 1 file changed, 113 deletions(-) delete mode 100644 frameworks/compass/stylesheets/compass/layout/_floated.scss diff --git a/frameworks/compass/stylesheets/compass/layout/_floated.scss b/frameworks/compass/stylesheets/compass/layout/_floated.scss deleted file mode 100644 index 65cbd126..00000000 --- a/frameworks/compass/stylesheets/compass/layout/_floated.scss +++ /dev/null @@ -1,113 +0,0 @@ -@import "compass/utilities/general/float"; -@import "compass/utilities/general/clearfix"; - -// Direction of the float -$compass-float-direction: left !default; -// Set to 0 to disable gutters -$compass-gutter-width: 10px !default; -$compass-left-gutter-width: ceil($compass-gutter-width / 2); -$compass-right-gutter-width: floor($compass-gutter-width / 2); - -// A floated element is generally assigned a width to achieve table-less alignment -@mixin floated($side : $compass-float-direction, - $left-gutter : $compass-left-gutter-width, - $right-gutter : $compass-right-gutter-width) { - @include float($side); - @if $left-gutter > 0 { - margin-left: $left-gutter; - } - @if $right-gutter > 0 { - margin-right: $right-gutter; - } -} - -// Remove the gutter for a particular side of a floated element -// pass `both` to disable the gutter on both sides. -@mixin gutterless($side) { - @if $side == both { - margin-left: 0; - margin-right: 0; - } @else { - margin-#{$side}: 0; - } -} - -// provides the base structure required to make an element pushable in -// the specified direction (which defaults to `right`). -@mixin pushable($side: opposite-position($compass-float-direction)) { - @include float($side); - position: relative; -} - -// provides the base structure required to make an element pullable in -// the specified direction (which defaults to `left`). -@mixin pullable($side : $compass-float-direction) { - @include float($side); - position: relative; -} - -// push an element in the specified direction by the specified amount. -@mixin pushed($side, $amount) { - margin-#{$side}: -$amount; - margin-#{opposite-position($side)}: $amount; -} - -// pull an element in the specified directionn by the specified amount. -@mixin pulled($side, $amount) { - margin-#{$side}: $amount; -} - -// Take an element out of the float if it had been made floated already. -// This might be applied to an element to allow it to fill the remainder -// of a row, in which case you'll probably want to make that element also -// a float container. -@mixin sunken { - float: none; - width: auto; - margin-left: auto; - margin-right: auto; -} - -// make an element centered within its fixed-width parent. -// Can be applied to a top level float container to create -// a centered layout within the window. -@mixin centered { - margin-left: auto; - margin-right: auto; -} - -@mixin act-like-blueprint { - .clearfixed { @include pie-clearfix; } - .column { @include floated(left, 0, $compass-gutter-width); } - .last { @include gutterless(right); } - .float-container { @extend .clearfixed; } - .container { @extend .float-container; @include centered; } - .push { @include pushable; } - .pull { @include pullable; } -} - -@mixin act-like-960 { - .clearfixed { @include pie-clearfix; } - .grid { @include floated(left, $compass-gutter-left-width, $compass-gutter-right-width); } - .alpha { @include gutterless(left); } - .omega { @include gutterless(right); } - .container { @extend .clearfixed; } - .grid-container { @extend .container; @include centered; } - .push { @include pushable; } - .pull { @include pullable; } -} - -@mixin act-like-oocss { - .clearfixed { @include pie-clearfix; } - .line { @extend .clearfixed; } - .unit { @include floated(left, 0, 0); } - .lastUnit { @extend .clearfixed; @include sunken; } - .size1of1 { @include sunken; } - - @for $divisions from 2 through 5 { - @for $segment from 1 to $divisions { - .size#{$segment}of#{$divisions} { width: percentage($segment / $divisions); } - } - } -} - From 84f95019ce5d04e6a8733a7fddc62ecfb593e881 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 28 Aug 2010 12:50:48 -0700 Subject: [PATCH 79/81] Fix a broken test case. --- features/command_line.feature | 26 ++++++++++++------- .../step_definitions/command_line_steps.rb | 2 +- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/features/command_line.feature b/features/command_line.feature index 95a957ed..5ce32ad7 100644 --- a/features/command_line.feature +++ b/features/command_line.feature @@ -258,16 +258,22 @@ Feature: Command Line Given I am using the existing project in test/fixtures/stylesheets/compass When I run: compass stats Then I am told statistics for each file: - | Filename | Rules | Properties | Mixins Defs | Mixins Used | CSS Rules | CSS Properties | - | sass/box.sass | 15 | 0 | 0 | 19 | 15 | 59 | - | sass/gradients.sass | 19 | 0 | 0 | 19 | 19 | 19 | - | sass/image_size.sass | 4 | 8 | 0 | 0 | 4 | 8 | - | sass/layout.sass | 0 | 0 | 0 | 1 | 5 | 10 | - | sass/print.sass | 0 | 0 | 0 | 2 | 61 | 61 | - | sass/reset.sass | 4 | 1 | 0 | 2 | 190 | 664 | - | sass/utilities.scss | 2 | 0 | 0 | 2 | 5 | 11 | - | Total.* | 44 | 9 | 0 | 45 | 299 | 832 | - + | Filename | Rules | Properties | Mixins Defs | Mixins Used | CSS Rules | CSS Properties | + | sass/border_radius.scss | 3 | 0 | 0 | 3 | 3 | 18 | + | sass/box.sass | 15 | 0 | 0 | 19 | 15 | 59 | + | sass/fonts.sass | 0 | 0 | 0 | 1 | 1 | 2 | + | sass/gradients.sass | 19 | 0 | 0 | 19 | 19 | 19 | + | sass/image_size.sass | 4 | 8 | 0 | 0 | 4 | 8 | + | sass/images.scss | 3 | 3 | 0 | 0 | 3 | 3 | + | sass/layout.sass | 0 | 0 | 0 | 1 | 5 | 10 | + | sass/legacy_clearfix.scss | 2 | 0 | 0 | 2 | 5 | 11 | + | sass/lists.scss | 9 | 0 | 0 | 9 | 35 | 111 | + | sass/print.sass | 0 | 0 | 0 | 2 | 61 | 61 | + | sass/reset.sass | 4 | 1 | 0 | 2 | 190 | 664 | + | sass/utilities.scss | 2 | 0 | 0 | 2 | 3 | 9 | + | ------------------------- | ----- | ---------- | -------------- | ----------- | --------- | -------------- | + | Total.* | 61 | 12 | 0 | 60 | 344 | 975 | + @listframeworks Scenario: List frameworks registered with compass When I run: compass frameworks diff --git a/features/step_definitions/command_line_steps.rb b/features/step_definitions/command_line_steps.rb index 284fb48b..e9209f1f 100644 --- a/features/step_definitions/command_line_steps.rb +++ b/features/step_definitions/command_line_steps.rb @@ -34,7 +34,7 @@ Given %r{^I am in the parent directory$} do Dir.chdir ".." end -Given /^I'm in a newly created rails project: (.+)$/ do |project_name| +Given %r{^I'm in a newly created rails project: (.+)$} do |project_name| @cleanup_directories << project_name begin generate_rails_app project_name From a2a98356880e6f1931721d2ee25d23833c4232b7 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 28 Aug 2010 12:52:54 -0700 Subject: [PATCH 80/81] provide correct installation steps when the compass validator is not found. --- lib/compass/validator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compass/validator.rb b/lib/compass/validator.rb index 606f3420..adb9b9d8 100644 --- a/lib/compass/validator.rb +++ b/lib/compass/validator.rb @@ -4,6 +4,6 @@ begin rescue LoadError raise Compass::MissingDependency, %Q{The Compass CSS Validator could not be loaded. Please install it: -sudo gem install chriseppstein-compass-validator --source http://gems.github.com/ +sudo gem install compass-validator } end From 13055f473108d2eb40786d52e80439637b0ab3e2 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sat, 28 Aug 2010 13:58:08 -0700 Subject: [PATCH 81/81] Gemfiles for testing and a rails test helper that works for both rails 2 and rails 3. --- .gitignore | 1 + Gemfile | 8 ++++++++ Gemfile_rails2 | 8 ++++++++ test/rails_helper.rb | 19 ++++++++++++------- 4 files changed, 29 insertions(+), 7 deletions(-) create mode 100644 Gemfile create mode 100644 Gemfile_rails2 diff --git a/.gitignore b/.gitignore index f04555fd..efbcad5a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ *.DS_Store *.tmproj +*.lock sync tmp/* examples/*/stylesheets/* diff --git a/Gemfile b/Gemfile new file mode 100644 index 00000000..c78185e8 --- /dev/null +++ b/Gemfile @@ -0,0 +1,8 @@ +source :rubygems + +gem "compass", :path => "." +gem "cucumber" +gem "rspec" +gem "rails", "~>3.0.0.rc" +gem "compass-validator" +gem "css_parser" diff --git a/Gemfile_rails2 b/Gemfile_rails2 new file mode 100644 index 00000000..2af96342 --- /dev/null +++ b/Gemfile_rails2 @@ -0,0 +1,8 @@ +source :rubygems + +gem "compass", :path => "." +gem "cucumber" +gem "rspec" +gem "rails", "~>2.3" +gem "compass-validator" +gem "css_parser" diff --git a/test/rails_helper.rb b/test/rails_helper.rb index d8b47a17..11a743d9 100644 --- a/test/rails_helper.rb +++ b/test/rails_helper.rb @@ -19,13 +19,18 @@ module Compass end else begin - require 'rails/version' - require 'rails_generator' - require 'rails_generator/scripts/generate' - Rails::Generator::Base.use_application_sources! - capture_output do - Rails::Generator::Base.logger = Rails::Generator::SimpleLogger.new $stdout - Rails::Generator::Scripts::Generate.new.run([name], :generator => 'app') + require 'action_pack/version' + if ActionPack::VERSION::MAJOR >= 3 + `rails new #{name}` + else + require 'rails/version' + require 'rails_generator' + require 'rails_generator/scripts/generate' + Rails::Generator::Base.use_application_sources! + capture_output do + Rails::Generator::Base.logger = Rails::Generator::SimpleLogger.new $stdout + Rails::Generator::Scripts::Generate.new.run([name], :generator => 'app') + end end rescue LoadError Kernel.exit!(2)