From 48723276e838291bb4082e809c86249921c98509 Mon Sep 17 00:00:00 2001 From: JohnAlbin Date: Sat, 10 Mar 2012 18:34:01 +0800 Subject: [PATCH 01/15] Update docs for running tests. fixes #731 --- .../help/tutorials/contributing.markdown | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/doc-src/content/help/tutorials/contributing.markdown b/doc-src/content/help/tutorials/contributing.markdown index 5894bea5..1ca15cc1 100644 --- a/doc-src/content/help/tutorials/contributing.markdown +++ b/doc-src/content/help/tutorials/contributing.markdown @@ -278,15 +278,28 @@ Getting recent changes from the main repo:

Running Tests

-1. Install development dependencies: +1. You must have Ruby installed on your system. After [setting up git](#setting-up-git), + change to the root directory of your git checkout of Compass. + + cd compass + +2. Install the bundler Ruby gem. + + gem install bundler + + If installing to your system gems, you'll probably need to add `sudo` to the + front of that command. If you don't know what that means, you probably need + to add `sudo` to the front. + +3. Install development dependencies: bundle install --binstubs devbin -2. Running core library and stylesheet tests: +4. Running core library and stylesheet tests: - rake run_tests + bundle exec rake test features -3. Running behavior tests +5. Running behavior tests ./devbin/cucumber From 0815f2216552c024913277f7d95e3cc3bb59b8d6 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 11 Mar 2012 22:13:51 -0700 Subject: [PATCH 02/15] Anthony Short --- ...short-joins-the-compass-core-team.markdown | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 doc-src/content/posts/2012-03-11-anthony-short-joins-the-compass-core-team.markdown diff --git a/doc-src/content/posts/2012-03-11-anthony-short-joins-the-compass-core-team.markdown b/doc-src/content/posts/2012-03-11-anthony-short-joins-the-compass-core-team.markdown new file mode 100644 index 00000000..5577aee1 --- /dev/null +++ b/doc-src/content/posts/2012-03-11-anthony-short-joins-the-compass-core-team.markdown @@ -0,0 +1,25 @@ +--- +title: "Anthony Short joins the Compass core team" +description: "We're excited to announce a new team member: Anthony Short" +author: chris +--- + +Please join us in welcoming Anthony Short to the Compass core team. +Anthony has been an active member in the "CSS Compiler" community for +a very long time now. A couple years ago he shut down his own CSS +compiler project called [Scaffold](https://github.com/anthonyshort/Scaffold) +and gave his backing to the Sass/Compass community. Since then, he +has been an active member of our community. + +Anthony is a Designer and Developer at [Newism](http://newism.com.au/) a +web design and marketing firm in Newcastle, Australia. His depth and +breadth of knowledge about CSS and cutting-edge design is evident in +his work and his excellent pattern library for Compass: +[Stitch](https://github.com/anthonyshort/stitch-css). + +You can find Anthony on the web at these fine locations: + +* [Github](https://github.com/anthonyshort) +* [Twitter](https://twitter.com/#!/anthonyshort) +* [Blog](http://anthonyshort.me/) + From 6754be1dc22dd84c0d610e1ca20f36222ef3b07b Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 12 Mar 2012 00:31:51 -0700 Subject: [PATCH 03/15] Version bump --- VERSION.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/VERSION.yml b/VERSION.yml index a56ccbb4..a5964142 100644 --- a/VERSION.yml +++ b/VERSION.yml @@ -1,6 +1,5 @@ --- :major: 0 :minor: 12 -:state: rc -:build: 1 +:build: 0 :name: Alnilam From a16f163e51401f0d7ee62c153b2b5ff7e3516a42 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 12 Mar 2012 00:39:54 -0700 Subject: [PATCH 04/15] Update the blog post for official release. --- doc-src/Gemfile.lock | 12 +++++----- ...12-02-01-compass-0-12-is-released.markdown | 22 ++++++++++--------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/doc-src/Gemfile.lock b/doc-src/Gemfile.lock index a761d11c..eee41f06 100644 --- a/doc-src/Gemfile.lock +++ b/doc-src/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: .. specs: - compass (0.12.rc.0.c403ac9) + compass (0.12.0.6754be1) chunky_png (~> 1.2) fssm (>= 0.2.7) sass (~> 3.1) @@ -9,9 +9,9 @@ PATH PATH remote: ../../compass-theme specs: - compass-theme (0.0.2) + compass-theme (0.0.1) compass (~> 0.11) - compass-susy-plugin (~> 0.7.0) + compass-susy-plugin (>= 0.7.0.pre8) css-slideshow (= 0.2.0) GEM @@ -23,8 +23,8 @@ GEM builder (3.0.0) chunky_png (1.2.5) coderay (0.9.7) - compass-susy-plugin (0.7.0) - compass (>= 0.10.0) + compass-susy-plugin (0.9) + compass (>= 0.11.1) cri (2.0.2) css-slideshow (0.2.0) compass (>= 0.10.0.rc3) @@ -42,7 +42,7 @@ GEM rb-fsevent (0.4.0) rdiscount (1.6.8) ruby-prof (0.10.8) - sass (3.1.12) + sass (3.1.15) serve (1.0.0) activesupport (~> 3.0.1) i18n (~> 0.4.1) diff --git a/doc-src/content/posts/2012-02-01-compass-0-12-is-released.markdown b/doc-src/content/posts/2012-02-01-compass-0-12-is-released.markdown index b16fd828..dbc59614 100644 --- a/doc-src/content/posts/2012-02-01-compass-0-12-is-released.markdown +++ b/doc-src/content/posts/2012-02-01-compass-0-12-is-released.markdown @@ -1,12 +1,12 @@ --- -title: "Compass v0.12 (Release Candidate) is Released" +title: "Compass v0.12 is Released" description: "Compass 0.12: Flexible Sprites, Rails Integration" author: chris --- -Compass 0.12 release candidate is out! Install it now: +Compass 0.12 is out! Install it now: - $ (sudo) gem install compass --pre + $ (sudo) gem install compass This release is primarily to support the Rails Asset Pipeline which required major changes to the Compass internals. If you use rails @@ -36,12 +36,14 @@ Additionally there are many new CSS3 improvements, bug fixes, and other small enhancements that you can read about in the [CHANGELOG](/CHANGELOG/). -What's next for Compass? The Sass 3.2 release is coming soon and I'd -very much like the 0.13 release of compass to take advantage of the -great features that it offers. Additionally, we're working on an -extension registry where you can post your compass extensions and -discover new ones. Lastly, we'll be extracting blueprint to a -compass extension as that project seems to have stagnated. I'd say -we're getting pretty close to a 1.0 release! +What's next for Compass? First, we've added [Anthony +Short](/blog/2012/03/11/anthony-short-joins-the-compass-core-team/) to +the team and we're really excited to see him come make our stylesheets +even more awesome. The Sass 3.2 release is coming soon and the 0.13 +release of compass will take advantage of the great features that it +offers. Additionally, we're working on an extension registry where you +can post your compass extensions and discover new ones. Lastly, we'll +be extracting blueprint to a compass extension as that project seems to +have stagnated. I'd say we're getting pretty close to a 1.0 release! [compass-rails]: /blog/2012/01/29/compass-and-rails-integration/ From eac243def0cce3636fa9adca03ab719bdfa4e173 Mon Sep 17 00:00:00 2001 From: JohnAlbin Date: Mon, 12 Mar 2012 16:36:29 +0800 Subject: [PATCH 05/15] Improve documentation of veritcal_rhythm partial. --- .../compass/typography/_vertical_rhythm.scss | 69 ++++++++++--------- 1 file changed, 37 insertions(+), 32 deletions(-) diff --git a/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss b/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss index 7fce4e37..f8295a77 100644 --- a/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss +++ b/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss @@ -1,18 +1,18 @@ @import "compass/layout/grid-background"; -// The base font size +// The base font size. $base-font-size: 16px !default; -// The base line height is the basic unit of line hightness. +// The base line height determines the basic unit of vertical rhythm. $base-line-height: 24px !default; -// set the default border style for rhythm borders +// Set the default border style for rhythm borders. $default-rhythm-border-style: solid !default; // The IE font ratio is a fact of life. Deal with it. $ie-font-ratio: 16px / 100%; -// Set to false if you want to use absolute pixes in sizing your typography. +// Set to false if you want to use absolute pixels in sizing your typography. $relative-font-sizing: true !default; // Ensure there is at least this many pixels @@ -20,26 +20,26 @@ $relative-font-sizing: true !default; $min-line-padding: 2px; // $base-font-size but in your output unit of choice. -// Defaults to 1em when `$relative-font-sizing` +// Defaults to 1em when `$relative-font-sizing` is true. $font-unit: if($relative-font-sizing, 1em, $base-font-size) !default; -// The basic unit of font rhythm +// The basic unit of font rhythm. $base-rhythm-unit: $base-line-height / $base-font-size * $font-unit; // The leader is the amount of whitespace in a line. -// It might be useful in your calculations +// It might be useful in your calculations. $base-leader: ($base-line-height - $base-font-size) * $font-unit / $base-font-size; // The half-leader is the amount of whitespace above and below a line. -// It might be useful in your calculations +// It might be useful in your calculations. $base-half-leader: $base-leader / 2; -// True if a number has a relative unit +// True if a number has a relative unit. @function relative-unit($number) { @return unit($number) == "%" or unit($number) == "em" or unit($number) == "rem" } -// True if a number has an absolute unit +// True if a number has an absolute unit. @function absolute-unit($number) { @return not (relative-unit($number) or unitless($number)); } @@ -48,7 +48,7 @@ $base-half-leader: $base-leader / 2; @warn "$relative-font-sizing is true but $font-unit is set to #{$font-unit} which is not a relative unit."; } -// Establishes a font baseline for the given font-size in pixels +// Establishes a font baseline for the given font-size. @mixin establish-baseline($font-size: $base-font-size) { body { font-size: $font-size / $ie-font-ratio; @@ -60,7 +60,7 @@ $base-half-leader: $base-leader / 2; } // Show a background image that can be used to debug your alignments. -// include the $img argument if you would rather use your own image than the +// Include the $img argument if you would rather use your own image than the // Compass default gradient image. @mixin debug-vertical-alignment($img: false) { @if $img { @@ -70,11 +70,11 @@ $base-half-leader: $base-leader / 2; } } -// Adjust a block to have a different font size and leading to maintain the rhythm. -// $lines is a number that is how many times the baseline rhythm this -// font size should use up. Does not have to be an integer, but it defaults -// to the smallest integer that is large enough to fit the font. -// Use $from_size to adjust from a non-base font-size. +// Adjust a block to have a different font size and line height to maintain the +// rhythm. $lines specifies how many multiples of the baseline rhythm each line +// of this font should use up. It does not have to be an integer, but it +// defaults to the smallest integer that is large enough to fit the font. +// Use $from-size to adjust from a font-size other than the base font-size. @mixin adjust-font-size-to($to-size, $lines: lines-for-font-size($to-size), $from-size: $base-font-size) { @if not $relative-font-sizing and $from-size != $base-font-size { @warn "$relative-font-sizing is false but a relative font size was passed to adjust-font-size-to"; @@ -83,6 +83,10 @@ $base-half-leader: $base-leader / 2; @include adjust-leading-to($lines, if($relative-font-sizing, $to-size, $base-font-size)); } +// Adjust a block to have different line height to maintain the rhythm. +// $lines specifies how many multiples of the baseline rhythm each line of this +// font should use up. It does not have to be an integer, but it defaults to the +// smallest integer that is large enough to fit the font. @mixin adjust-leading-to($lines, $font-size: $base-font-size) { @if not $relative-font-sizing and $font-size != $base-font-size { @warn "$relative-font-sizing is false but a relative font size was passed to adjust-leading-to"; @@ -90,7 +94,7 @@ $base-half-leader: $base-leader / 2; line-height: $font-unit * $lines * $base-line-height / $font-size; } -// Calculate rhythm units +// Calculate rhythm units. @function rhythm( $lines: 1, $font-size: $base-font-size @@ -102,6 +106,7 @@ $base-half-leader: $base-leader / 2; @return $rhythm; } +// Calculate the minimum multiple of rhythm units needed to contain the font-size. @function lines-for-font-size($font-size) { $lines: ceil($font-size / $base-line-height); @if $lines * $base-line-height - $font-size < $min-line-padding * 2 { @@ -110,7 +115,7 @@ $base-half-leader: $base-leader / 2; @return $lines; } -// Apply leading whitespace +// Apply leading whitespace. The $property can be margin or padding. @mixin leader($lines: 1, $font-size: $base-font-size, $property: margin) { $leader: rhythm($lines, $font-size); @if unit($leader) == px { @@ -119,17 +124,17 @@ $base-half-leader: $base-leader / 2; #{$property}-top: $leader; } -// Apply leading whitespace as padding +// Apply leading whitespace as padding. @mixin padding-leader($lines: 1, $font-size: $base-font-size) { @include leader($lines, $font-size, padding); } -// Apply leading whitespace as margin +// Apply leading whitespace as margin. @mixin margin-leader($lines: 1, $font-size: $base-font-size) { @include leader($lines, $font-size, margin); } -// Apply trailing whitespace +// Apply trailing whitespace. The $property can be margin or padding. @mixin trailer($lines: 1, $font-size: $base-font-size, $property: margin) { $leader: rhythm($lines, $font-size); @if unit($leader) == px { @@ -138,18 +143,17 @@ $base-half-leader: $base-leader / 2; #{$property}-bottom: $leader; } -// Apply trailing whitespace as padding +// Apply trailing whitespace as padding. @mixin padding-trailer($lines: 1, $font-size: $base-font-size) { @include trailer($lines, $font-size, padding); } -// Apply trailing whitespace as margin +// Apply trailing whitespace as margin. @mixin margin-trailer($lines: 1, $font-size: $base-font-size) { @include trailer($lines, $font-size, margin); } -// Whitespace application shortcut -// Apply top margin/padding + bottom padding/margin +// Shorthand mixin to apply whitespace for top and bottom margins and padding. @mixin rhythm($leader: 0, $padding-leader: 0, $padding-trailer: 0, $trailer: 0, $font-size: $base-font-size) { @include leader($leader, $font-size); @include padding-leader($padding-leader, $font-size); @@ -157,8 +161,8 @@ $base-half-leader: $base-leader / 2; @include trailer($trailer, $font-size); } -// Apply a border width to any side without destroying the vertical rhythm. -// The available space ($lines) must be greater than the width of your border. +// Apply a border and whitespace to any side without destroying the vertical +// rhythm. The whitespace must be greater than the width of the border. @mixin apply-side-rhythm-border($side, $width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) { @if not $relative-font-sizing and $font-size != $base-font-size { @warn "$relative-font-sizing is false but a relative font size was passed to apply-side-rhythm-border"; @@ -170,7 +174,7 @@ $base-half-leader: $base-leader / 2; padding-#{$side}: $font-unit / $font-size * ($lines * $base-line-height - $width); } -// Aplly rhythm borders equally to all sides +// Apply borders and whitespace equally to all sides. @mixin rhythm-borders($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) { @if not $relative-font-sizing and $font-size != $base-font-size { @warn "$relative-font-sizing is false but a relative font size was passed to rhythm-borders"; @@ -181,22 +185,23 @@ $base-half-leader: $base-leader / 2; padding: $font-unit / $font-size * ($lines * $base-line-height - $width); } -// Apply a leading rhythm border +// Apply a leading border. @mixin leading-border($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) { @include apply-side-rhythm-border(top, $width, $lines, $font-size, $border-style); } -// Apply a trailing rhythm border +// Apply a trailing border. @mixin trailing-border($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) { @include apply-side-rhythm-border(bottom, $width, $lines, $font-size, $border-style); } -// Apply both leading and trailing rhythm borders +// Apply both leading and trailing borders. @mixin horizontal-borders($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) { @include leading-border($width, $lines, $font-size, $border-style); @include trailing-border($width, $lines, $font-size, $border-style); } +// Alias for `horizontal-borders` mixin. @mixin h-borders($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) { @include horizontal-borders($width, $lines, $font-size, $border-style); } From c1584f9212df44ff838e3997f0ce354070d1c480 Mon Sep 17 00:00:00 2001 From: JohnAlbin Date: Mon, 12 Mar 2012 17:23:56 +0800 Subject: [PATCH 06/15] Fix code style in vertical_rhythm's apply-side-rhythm-border(). --- .../stylesheets/compass/typography/_vertical_rhythm.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss b/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss index f041ebc0..7e0db195 100644 --- a/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss +++ b/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss @@ -193,7 +193,8 @@ $base-half-leader: $base-leader / 2; } border: { style: $border-style; - width: $font-unit * $width / $font-size; }; + width: $font-unit * $width / $font-size; + }; padding: $font-unit / $font-size * ($lines * $base-line-height - $width); } From a1ff692e58650d32d3cea8f6aa8d7df0fe8b8f43 Mon Sep 17 00:00:00 2001 From: JohnAlbin Date: Mon, 12 Mar 2012 17:27:08 +0800 Subject: [PATCH 07/15] Simplify code in vertical_rhythm's adjust-leading-to() using rhythm() function. --- .../stylesheets/compass/typography/_vertical_rhythm.scss | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss b/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss index f041ebc0..f26ac866 100644 --- a/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss +++ b/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss @@ -98,10 +98,7 @@ $base-half-leader: $base-leader / 2; // font should use up. It does not have to be an integer, but it defaults to the // smallest integer that is large enough to fit the font. @mixin adjust-leading-to($lines, $font-size: $base-font-size) { - @if not $relative-font-sizing and $font-size != $base-font-size { - @warn "$relative-font-sizing is false but a relative font size was passed to adjust-leading-to"; - } - line-height: $font-unit * $lines * $base-line-height / $font-size; + line-height: rhythm($lines, $font-size); } // Calculate rhythm units. From 8fa1e8b97bce885e00191ac7f6983f93895a9caa Mon Sep 17 00:00:00 2001 From: Maxime Thirouin Date: Tue, 13 Mar 2012 12:46:46 +0100 Subject: [PATCH 08/15] Add "css" keywords on the Compass Sprite helpers doc. Following this "Will someone please do some SEO so that compass is on the first page for this query: css sprites" https://twitter.com/#!/chriseppstein/status/141632327565578240 --- .../reference/compass/helpers/sprites.haml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/doc-src/content/reference/compass/helpers/sprites.haml b/doc-src/content/reference/compass/helpers/sprites.haml index 3a2eb5d3..ad64408d 100644 --- a/doc-src/content/reference/compass/helpers/sprites.haml +++ b/doc-src/content/reference/compass/helpers/sprites.haml @@ -1,8 +1,8 @@ --- -title: Compass Sprite Helpers +title: CSS Sprite Helpers for Compass crumb: Sprites framework: compass -meta_description: Helper functions for working with Sprite images. +meta_description: Helper functions for working with CSS Sprite images. layout: core classnames: - reference @@ -16,13 +16,13 @@ documented_functions: - "sprite-url" - "sprite-position" --- -%h1 Compass Sprite Helpers +%h1 CSS Sprite Helpers for Compass :markdown - These helpers make it easier to build and to work with sprites. + These helpers make it easier to build and to work with css sprites. While it is allowed to use these directly, to do so is considered "advanced usage". - It is recommended that you instead use the sprite mixins that are designed to work + It is recommended that you instead use the css sprite mixins that are designed to work with these functions. See the [Spriting Tutorial](/help/tutorials/spriting/) for more information. @@ -33,31 +33,31 @@ documented_functions: sprite-map($glob, ...) .details :markdown - Generates a sprite map from the files matching the glob pattern. Uses the + Generates a css sprite map from the files matching the glob pattern. Uses the keyword-style arguments passed in to control the placement. - Only PNG files can be made into sprites at this time. + Only PNG files can be made into css sprites at this time. The `$glob` should be glob pattern relative to the images directory that specifies - what files will be in the sprite. For example: + what files will be in the css sprite. For example: $icons: sprite-map("icons/*.png"); background: $icons; - This will generate a sprite map and return a reference to it. It's important to + This will generate a css sprite map and return a reference to it. It's important to capture this to a variable, because you will need to use it later when creating - sprites. In the above example you might end up with a new file named + css sprites. In the above example you might end up with a new file named `images/sprites/icons-a2ef041.png` and your css stylesheet will have: background: url('/images/sprites/icons-a2ef041.png?1234678') no-repeat; The exact image name is not something you should depend on as it may change based on the arguments you pass in. Instead, you can use the `sprite-url()` function to create a - reference to the sprite map without generating the image again. Alternatively, simply + reference to the css sprite map without generating the image again. Alternatively, simply using the sprite map variable in an property will have the same effect as calling `sprite-url()`. - For each sprite in the sprite map you can control the position, spacing, and whether or + For each sprite in the css sprite map you can control the position, spacing, and whether or not it repeats. You do this by passing arguments to this function that tell each sprite how to behave. For instance if there is a icons/new.png then you can control it like so: @@ -91,8 +91,8 @@ documented_functions: sprite-map-name($map) .details :markdown - Returns the name of a sprite map - The name is derived from the folder than contains the sprites. + Returns the name of a css sprite map + The name is derived from the folder than contains the css sprites. #sprite-file.helper %h3 From e92d63fd2142bec9838a9b03c801c8d03df84862 Mon Sep 17 00:00:00 2001 From: JohnAlbin Date: Mon, 12 Mar 2012 17:36:55 +0800 Subject: [PATCH 09/15] Round px values in rhythm() function of vertical_rhythm partial. Also simplify code for vertical_rhythm's leader and trailer mixins. Alternate to the pull-request in #778 --- .../compass/typography/_vertical_rhythm.scss | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss b/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss index f041ebc0..44c11534 100644 --- a/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss +++ b/frameworks/compass/stylesheets/compass/typography/_vertical_rhythm.scss @@ -113,6 +113,10 @@ $base-half-leader: $base-leader / 2; @warn "$relative-font-sizing is false but a relative font size was passed to the rhythm function"; } $rhythm: $font-unit * $lines * $base-line-height / $font-size; + // Round the pixels down to nearest integer. + @if unit($rhythm) == px { + $rhythm: floor($rhythm); + } @return $rhythm; } @@ -129,40 +133,32 @@ $base-half-leader: $base-leader / 2; // Apply leading whitespace. The $property can be margin or padding. @mixin leader($lines: 1, $font-size: $base-font-size, $property: margin) { - $leader: rhythm($lines, $font-size); - @if unit($leader) == px { - $leader: floor($leader) - } - #{$property}-top: $leader; + #{$property}-top: rhythm($lines, $font-size); } // Apply leading whitespace as padding. @mixin padding-leader($lines: 1, $font-size: $base-font-size) { - @include leader($lines, $font-size, padding); + padding-top: rhythm($lines, $font-size); } // Apply leading whitespace as margin. @mixin margin-leader($lines: 1, $font-size: $base-font-size) { - @include leader($lines, $font-size, margin); + margin-top: rhythm($lines, $font-size); } // Apply trailing whitespace. The $property can be margin or padding. @mixin trailer($lines: 1, $font-size: $base-font-size, $property: margin) { - $leader: rhythm($lines, $font-size); - @if unit($leader) == px { - $leader: ceil($leader) - } - #{$property}-bottom: $leader; + #{$property}-bottom: rhythm($lines, $font-size); } // Apply trailing whitespace as padding. @mixin padding-trailer($lines: 1, $font-size: $base-font-size) { - @include trailer($lines, $font-size, padding); + padding-bottom: rhythm($lines, $font-size); } // Apply trailing whitespace as margin. @mixin margin-trailer($lines: 1, $font-size: $base-font-size) { - @include trailer($lines, $font-size, margin); + margin-bottom: rhythm($lines, $font-size); } // Shorthand mixin to apply whitespace for top and bottom margins and padding. From b8321a4db05ee5d7c0d7ff3b372619e90ffcfd8f Mon Sep 17 00:00:00 2001 From: Maxime Thirouin Date: Tue, 13 Mar 2012 21:53:03 +0100 Subject: [PATCH 10/15] Add ability to append stuffs after font urls --- lib/compass/sass_extensions/functions/font_files.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/compass/sass_extensions/functions/font_files.rb b/lib/compass/sass_extensions/functions/font_files.rb index f7f72d27..9dd4f48c 100644 --- a/lib/compass/sass_extensions/functions/font_files.rb +++ b/lib/compass/sass_extensions/functions/font_files.rb @@ -5,7 +5,8 @@ module Compass::SassExtensions::Functions::FontFiles :opentype => 'opentype', :ttf => 'truetype', :truetype => 'truetype', - :svg => 'svg' + :svg => 'svg', + :eot => 'embedded-opentype' } def font_files(*args) @@ -24,7 +25,8 @@ module Compass::SassExtensions::Functions::FontFiles if FONT_TYPES.key? type skip_next = true else - type = arg.to_s.split('.').last.gsub('"', '').to_sym + # let pass url like font.type?thing#stuff + type = arg.to_s.split('.').last.gsub(/(\?(.*))?(#(.*))?"/, '').to_sym end if FONT_TYPES.key? type From 788a34427842e11aabaf5adbadd6969192522a93 Mon Sep 17 00:00:00 2001 From: Maxime Thirouin Date: Tue, 13 Mar 2012 21:53:19 +0100 Subject: [PATCH 11/15] Update outdated doc --- .../examples/compass/css3/font-face/stylesheet.sass | 2 +- doc-src/content/reference/compass/helpers/font-files.haml | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/doc-src/content/examples/compass/css3/font-face/stylesheet.sass b/doc-src/content/examples/compass/css3/font-face/stylesheet.sass index 4256a548..3f737dfd 100644 --- a/doc-src/content/examples/compass/css3/font-face/stylesheet.sass +++ b/doc-src/content/examples/compass/css3/font-face/stylesheet.sass @@ -1,6 +1,6 @@ @import compass/css3 -+font-face("Blooming Grove", font-files("examples/bgrove.ttf", truetype, "examples/bgrove.otf", opentype)) ++font-face("Blooming Grove", font-files("examples/bgrove.ttf", "examples/bgrove.otf")) .example font-family: "Blooming Grove" diff --git a/doc-src/content/reference/compass/helpers/font-files.haml b/doc-src/content/reference/compass/helpers/font-files.haml index d055c900..be951708 100644 --- a/doc-src/content/reference/compass/helpers/font-files.haml +++ b/doc-src/content/reference/compass/helpers/font-files.haml @@ -16,13 +16,10 @@ documented_functions: #font-files.helper %h3 %a(href="#font-files") - font-files([$font, $format]*) + font-files([$font]*) .details %p - The font-files function takes any even number of arguments. - For each pair of arguments, the first is the path to the font file - relative to your project's font directory and the second is the format of - that font. + The font-files function takes a list of arguments containing the path to each font files relative to your project's font directory. %p This helper is used with the font-face mixin and is what makes it possible to pass any number of font files. From 11b3526b8548c3be5ee2c5ff00b315a5bd7c4422 Mon Sep 17 00:00:00 2001 From: Maxime Thirouin Date: Tue, 13 Mar 2012 21:54:07 +0100 Subject: [PATCH 12/15] Add tests about the new ability to append stuffs on font urls --- test/units/sass_extensions_test.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/units/sass_extensions_test.rb b/test/units/sass_extensions_test.rb index ba2d524d..99194ddd 100644 --- a/test/units/sass_extensions_test.rb +++ b/test/units/sass_extensions_test.rb @@ -126,6 +126,14 @@ class SassExtensionsTest < Test::Unit::TestCase evaluate("font-files('/font/name.woff')") end + assert_nothing_raised Sass::SyntaxError do + evaluate("font-files('/font/name.svg#fontId')") + end + + assert_nothing_raised Sass::SyntaxError do + evaluate("font-files('/font/name.eot?#iefix')") + end + assert_raises Sass::SyntaxError do evaluate("font-files('/font/name.ext')") end From 1fb9e7adba26a9c25dd1a425e7dd325aeedd4d6b Mon Sep 17 00:00:00 2001 From: Maxime Thirouin Date: Tue, 13 Mar 2012 22:20:19 +0100 Subject: [PATCH 13/15] Add one more test to make sure a more complex query param is handled --- test/units/sass_extensions_test.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/units/sass_extensions_test.rb b/test/units/sass_extensions_test.rb index 99194ddd..67ffb895 100644 --- a/test/units/sass_extensions_test.rb +++ b/test/units/sass_extensions_test.rb @@ -134,6 +134,10 @@ class SassExtensionsTest < Test::Unit::TestCase evaluate("font-files('/font/name.eot?#iefix')") end + assert_nothing_raised Sass::SyntaxError do + evaluate("font-files('/font/name.svg?mightbedynamic=something%20+escaped#fontId')") + end + assert_raises Sass::SyntaxError do evaluate("font-files('/font/name.ext')") end From 95844e1b518de5a95be415467d100ffcb2a52eb9 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 12 Mar 2012 20:28:30 -0700 Subject: [PATCH 14/15] Add anthony to the gem authors list. --- compass.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compass.gemspec b/compass.gemspec index 0265175c..782b2d38 100644 --- a/compass.gemspec +++ b/compass.gemspec @@ -7,7 +7,7 @@ Gem::Specification.new do |gemspec| gemspec.version = Compass::VERSION # Update VERSION.yml file to set this. gemspec.description = "Compass is a Sass-based Stylesheet Framework that streamlines the creation and maintainance of CSS." gemspec.homepage = "http://compass-style.org" - gemspec.authors = ["Chris Eppstein", "Eric A. Meyer", "Brandon Mathis", "Nico Hagenburger", "Scott Davis"] + gemspec.authors = ["Chris Eppstein", "Scott Davis", "Eric A. Meyer", "Brandon Mathis", "Anthony Short", "Nico Hagenburger"] gemspec.email = "chris@eppsteins.net" #gemspec.default_executable = "compass" #deprecated gemspec.executables = %w(compass) From b90f9c5be003ffad3109ec9177d5c1d8d6910403 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Wed, 14 Mar 2012 00:19:54 -0700 Subject: [PATCH 15/15] Add support for packager to build one-click installers --- .gitignore | 1 + Gemfile | 3 +++ Rakefile | 37 ++++++++++++++++++++++++++++++++++--- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index fbe701a3..b43992ee 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ devbin vendor/ruby vendor Gemfile.lock +Compass.pkg diff --git a/Gemfile b/Gemfile index 15601958..36360446 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,7 @@ source :rubygems gemspec +unless ENV['PKG'] gem "cucumber", "~> 1.1.4" gem "rspec", "~>2.0.0" gem "rails", "~> 3.1" @@ -25,4 +26,6 @@ unless ENV["CI"] gem 'guard' gem 'guard-test' gem 'guard-cucumber' + gem 'packager' +end end diff --git a/Rakefile b/Rakefile index 7fcfe035..369b3c6c 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,16 @@ require 'rubygems' -require 'bundler' -Bundler.setup -require 'rake/dsl_definition' rescue nil +if ENV["PKG"] + $: << File.expand_path(File.dirname(__FILE__))+"/lib" +else + require 'bundler' + Bundler.setup +end + +begin + require 'rake/dsl_definition' +rescue LoadError + #pass +end require 'compass' # ----- Default: Testing ------ @@ -10,12 +19,17 @@ task :default => [:test, :features] require 'rake/testtask' require 'fileutils' + +begin require 'cucumber' require 'cucumber/rake/task' Cucumber::Rake::Task.new(:features) do |t| t.cucumber_opts = "features --format progress" end +rescue LoadError + $stderr.puts "cannot load cucumber" +end Rake::TestTask.new :test do |t| t.libs << 'lib' @@ -124,3 +138,20 @@ rescue LoadError => e puts "WARNING: #{e}" end +begin + require 'packager/rake_task' + require 'compass/version' + # Building a package: + # 1. Get packager installed and make sure your system is setup correctly according to their docs. + # 2. Make sure you are actually using a universal binary that has been nametooled. + # 3. PKG=1 OFFICIAL=1 rake packager:pkg + Packager::RakeTask.new(:pkg) do |t| + t.package_name = "Compass" + t.version = Compass::VERSION + t.domain = "compass-style.org" + t.bin_files = ["compass"] + t.resource_files = FileList["frameworks/**/*"] + ["VERSION.yml", "LICENSE.markdown"] + end +rescue LoadError => e + puts "WARNING: #{e}" +end