Merge branch 'stable'

* stable:
  Update CHANGELOG
  When the unit is in pixels, round down in the leader and up in the trailer.
  Ensure there is a minimum of padding in each line when calculating how many lines are needed.
  Support absolute font sizing in the vertical rhythm module
  Update homepage
  Adding the generated css files from the msfilter change
  Removing -ms-filter as it drives IE9+ crazy. plus existing filter works anyway for IE9-
  In case you want to buy stuff.
  Update Gemfile to use rake 0.8.7
  Handle pathnames being assigned to the working path of a command. Closes GH-434.
  Fix docs
  Fix compass version in the docs.

Conflicts:
	Gemfile.lock
This commit is contained in:
Chris Eppstein 2011-07-01 22:23:05 -07:00
commit f18b5bcbc1
15 changed files with 132 additions and 30 deletions

View File

@ -21,6 +21,8 @@ gem 'mocha'
gem 'timecop' gem 'timecop'
gem 'diff-lcs', '~> 1.1.2' gem 'diff-lcs', '~> 1.1.2'
gem 'rake', '0.8.7'
group :mac do group :mac do
gem "rb-fsevent" gem "rb-fsevent"
end end

View File

@ -147,6 +147,7 @@ DEPENDENCIES
livereload livereload
mocha mocha
rails (~> 3.0.0.rc) rails (~> 3.0.0.rc)
rake (= 0.8.7)
rb-fsevent rb-fsevent
rcov rcov
rspec (~> 2.0.0) rspec (~> 2.0.0)

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View File

@ -14,6 +14,14 @@ The Documentation for the [latest stable release](http://compass-style.org/docs/
The Documentation for the [latest preview release](http://beta.compass-style.org/) The Documentation for the [latest preview release](http://beta.compass-style.org/)
0.11.4 (UNRELEASED)
-------------------
* Vertical rhythm now supports absolute units like pixels.
Set `$relative-font-sizing` to `false` to enable.
* Vertical rhythm now has a minimum padding that defaults to 2px.
This makes some edge cases look better.
0.11.3 (06/11/2011) 0.11.3 (06/11/2011)
------------------- -------------------

View File

@ -22,7 +22,7 @@ what changed to your stylesheets:
1. $ cd my_compass_project 1. $ cd my_compass_project
2. $ compass compile --force 2. $ compass compile --force
3. $ cp -r stylesheets stylesheets.backup 3. $ cp -r stylesheets stylesheets.backup
4. $ gem install compass --pre # you might need to type sudo first if you're on mac or linux. 4. $ gem install compass # you might need to type sudo first if you're on mac or linux.
5. $ compass compile --force 5. $ compass compile --force
6. Take note of any deprecation warnings printed in red during the compile. 6. Take note of any deprecation warnings printed in red during the compile.
7. If you have textmate and installed the `mate` command line tool:<br> 7. If you have textmate and installed the `mate` command line tool:<br>

View File

@ -69,3 +69,27 @@ layout: homepage
%img(src="/images/sites/busyconf.jpg") %img(src="/images/sites/busyconf.jpg")
%span.title BusyConf %span.title BusyConf
%span.url http://busyconf.com %span.url http://busyconf.com
%section.book
%h3 Save <em>37%</em> on the Book: (Currently In Beta)
%p
%a(href="http://www.manning.com/netherland/")
%img(src="http://www.manning.com/netherland/netherland_cover150.jpg" alt="Sass & Compass in Action")
Compliments of Manning.com is a standing 37% discount on
<a href="http://www.manning.com/netherland/">Sass and Compass in Action</a>.
Use promo code <code>sasscomp37</code> at manning.com on the MEAP, eBook and pBook of Sass and
Compass in Action. All pBook purchases include free eFormats (PDF, ePub, and Kindle)
as soon as available.
%section.gui
%h3 <em>Hate</em> the Command Line?
%a(href="http://compass.handlino.com/")
%img(src="/images/compass.app.png")
%p
Buy <a href="http://compass.handlino.com/">Compass.app</a>
for Windows and Mac for just $7.
%p.note
Note: Compass.app is a product of Handlino, Inc but
30% of all proceeds go to Compass's charity of choice: <a href="http://umdf.org/compass">UMDF.org</a>.

View File

@ -79,4 +79,21 @@ ul#featured_sites {
.title { bottom: 1.7em; left: 0; z-index: 103; text-decoration: none; padding: 0 11px; color: #fff; } .title { bottom: 1.7em; left: 0; z-index: 103; text-decoration: none; padding: 0 11px; color: #fff; }
} }
} }
section.book, section.gui {
width: 48%;
float: left;
@extend .group;
h3 { margin-bottom: 1em; height: 2em; text-align: left; }
}
section.book {
margin-right: 2%;
img { float: left; margin-right: 1em; margin-bottom: 1em; }
}
section.gui {
text-align: center;
.note {
font-size: smaller;
}
}
html.light body#home { h1#logo { background-position: bottom;} } html.light body#home { h1#logo { background-position: bottom;} }

View File

@ -130,7 +130,7 @@ end
def compass_version def compass_version
v = Compass.version v = Compass.version
"#{v[:major]}.#{v[:minor]}#{"."+v[:state] if v[:state]}.#{v[:build]}" "#{v[:major]}.#{v[:minor]}#{"."+v[:state] if v[:state]}.#{v[:build] || v[:patch]}"
end end
def long_compass_version def long_compass_version

View File

@ -83,10 +83,7 @@
@mixin filter-gradient($start-color, $end-color, $orientation: vertical) { @mixin filter-gradient($start-color, $end-color, $orientation: vertical) {
@include has-layout; @include has-layout;
$gradient-type: if($orientation == vertical, 0, 1); $gradient-type: if($orientation == vertical, 0, 1);
@if $legacy-support-for-ie8 { @if $legacy-support-for-ie6 or $legacy-support-for-ie7 or $legacy-support-for-ie8 {
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(gradientType=#{$gradient-type}, startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}')";
}
@if $legacy-support-for-ie6 or $legacy-support-for-ie7 {
filter: progid:DXImageTransform.Microsoft.gradient(gradientType=#{$gradient-type}, startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}'); filter: progid:DXImageTransform.Microsoft.gradient(gradientType=#{$gradient-type}, startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}');
} }
} }

View File

@ -6,10 +6,7 @@
// A number between 0 and 1, where 0 is transparent and 1 is opaque. // A number between 0 and 1, where 0 is transparent and 1 is opaque.
@mixin opacity($opacity) { @mixin opacity($opacity) {
@if $legacy-support-for-ie8 { @if $legacy-support-for-ie6 or $legacy-support-for-ie7 or $legacy-support-for-ie8 {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=#{round($opacity * 100)})";
}
@if $legacy-support-for-ie6 or $legacy-support-for-ie7 {
filter: unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=#{round($opacity * 100)})"); filter: unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=#{round($opacity * 100)})");
} }
opacity: $opacity; opacity: $opacity;

View File

@ -10,22 +10,47 @@ $default-rhythm-border-style: solid !default;
// The IE font ratio is a fact of life. Deal with it. // The IE font ratio is a fact of life. Deal with it.
$ie-font-ratio: 16px / 100%; $ie-font-ratio: 16px / 100%;
// Set to false if you want to use absolute pixes in sizing your typography.
$relative-font-sizing: true !default;
// Ensure there is at least this many pixels
// of vertical padding above and below the text.
$min-line-padding: 2px;
// $base-font-size but in your output unit of choice.
// Defaults to 1em when `$relative-font-sizing`
$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 * 1em; $base-rhythm-unit: $base-line-height / $base-font-size * $font-unit;
// The leader is the amount of whitespace in a line. // 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) * 1em / $base-font-size; $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. // 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; $base-half-leader: $base-leader / 2;
// 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
@function absolute-unit($number) {
@return not (relative-unit($number) or unitless($number));
}
@if $relative-font-sizing and not relative-unit($font-unit) {
@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 in pixels
@mixin establish-baseline($font-size: $base-font-size) { @mixin establish-baseline($font-size: $base-font-size) {
body { body {
font-size: $font-size / $ie-font-ratio; font-size: $font-size / $ie-font-ratio;
@include adjust-leading-to(1, $font-size); @include adjust-leading-to(1, if($relative-font-sizing, $font-size, $base-font-size));
} }
html>body { html>body {
font-size: $font-size; font-size: $font-size;
@ -42,13 +67,19 @@ $base-half-leader: $base-leader / 2;
// font size should use up. Does not have to be an integer, but it defaults // 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. // to the smallest integer that is large enough to fit the font.
// Use $from_size to adjust from a non-base font-size. // Use $from_size to adjust from a non-base font-size.
@mixin adjust-font-size-to($to-size, $lines: ceil($to-size / $base-line-height), $from-size: $base-font-size) { @mixin adjust-font-size-to($to-size, $lines: lines-for-font-size($to-size), $from-size: $base-font-size) {
font-size: 1em * $to-size / $from-size; @if $relative-font-sizing and $from-size != $base-font-size {
@include adjust-leading-to($lines, $to-size); @warn "$relative-font-sizing is false but a relative font size was passed to adjust-font-size-to";
}
font-size: $font-unit * $to-size / $from-size;
@include adjust-leading-to($lines, if($relative-font-sizing, $to-size, $base-font-size));
} }
@mixin adjust-leading-to($lines, $font-size: $base-font-size) { @mixin adjust-leading-to($lines, $font-size: $base-font-size) {
line-height: 1em * $lines * $base-line-height / $font-size; @if $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;
} }
// Calculate rhythm units // Calculate rhythm units
@ -56,32 +87,55 @@ $base-half-leader: $base-leader / 2;
$lines: 1, $lines: 1,
$font-size: $base-font-size $font-size: $base-font-size
) { ) {
$rhythm: 1em * $lines * $base-line-height / $font-size; @if $relative-font-sizing and $font-size != $base-font-size {
@warn "$relative-font-sizing is false but a relative font size was passed to the rhythm function";
}
$rhythm: $font-unit * $lines * $base-line-height / $font-size;
@return $rhythm; @return $rhythm;
} }
@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 {
$lines: $lines + 1;
}
@return $lines;
}
// Apply leading whitespace // Apply leading whitespace
@mixin leader($lines: 1, $font-size: $base-font-size, $property: margin) { @mixin leader($lines: 1, $font-size: $base-font-size, $property: margin) {
#{$property}-top: rhythm($lines, $font-size); $leader: rhythm($lines, $font-size);
@if unit($leader) == px {
$leader: floor($leader)
}
#{$property}-top: $leader;
} }
// Apply leading whitespace as padding
@mixin padding-leader($lines: 1, $font-size: $base-font-size) { @mixin padding-leader($lines: 1, $font-size: $base-font-size) {
@include leader($lines, $font-size, padding); @include leader($lines, $font-size, padding);
} }
// Apply leading whitespace as margin
@mixin margin-leader($lines: 1, $font-size: $base-font-size) { @mixin margin-leader($lines: 1, $font-size: $base-font-size) {
@include leader($lines, $font-size, margin); @include leader($lines, $font-size, margin);
} }
// Apply trailing whitespace // Apply trailing whitespace
@mixin trailer($lines: 1, $font-size: $base-font-size, $property: margin) { @mixin trailer($lines: 1, $font-size: $base-font-size, $property: margin) {
#{$property}-bottom: rhythm($lines, $font-size); $leader: rhythm($lines, $font-size);
@if unit($leader) == px {
$leader: ceil($leader)
}
#{$property}-bottom: $leader;
} }
// Apply trailing whitespace as padding
@mixin padding-trailer($lines: 1, $font-size: $base-font-size) { @mixin padding-trailer($lines: 1, $font-size: $base-font-size) {
@include trailer($lines, $font-size, padding); @include trailer($lines, $font-size, padding);
} }
// Apply trailing whitespace as margin
@mixin margin-trailer($lines: 1, $font-size: $base-font-size) { @mixin margin-trailer($lines: 1, $font-size: $base-font-size) {
@include trailer($lines, $font-size, margin); @include trailer($lines, $font-size, margin);
} }
@ -97,19 +151,25 @@ $base-half-leader: $base-leader / 2;
// Apply a border width to any side without destroying the vertical rhythm // Apply a border width to any side without destroying the vertical rhythm
@mixin apply-side-rhythm-border($side, $width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) { @mixin apply-side-rhythm-border($side, $width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) {
@if $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";
}
border-#{$side}: { border-#{$side}: {
style: $border-style; style: $border-style;
width: 1em * $width / $font-size; width: $font-unit * $width / $font-size;
}; };
padding-#{$side}: 1em / $font-size * ($lines * $base-line-height - $width); padding-#{$side}: $font-unit / $font-size * ($lines * $base-line-height - $width);
} }
// Aplly rhythm borders equally to all sides // Aplly rhythm borders equally to all sides
@mixin rhythm-borders($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) { @mixin rhythm-borders($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) {
@if $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";
}
border: { border: {
style: $border-style; style: $border-style;
width: 1em * $width / $font-size; }; width: $font-unit * $width / $font-size; };
padding: 1em / $font-size * ($lines * $base-line-height - $width); padding: $font-unit / $font-size * ($lines * $base-line-height - $width);
} }
// Apply a leading rhythm border // Apply a leading rhythm border

View File

@ -10,7 +10,7 @@ module Compass
attr_accessor :working_path, :options attr_accessor :working_path, :options
def initialize(working_path, options) def initialize(working_path, options)
self.working_path = working_path self.working_path = working_path.to_s
self.options = options self.options = options
end end

View File

@ -6,7 +6,7 @@ module Compass
attr_accessor :working_path, :from, :to, :options, :sass_options, :staleness_checker, :importer attr_accessor :working_path, :from, :to, :options, :sass_options, :staleness_checker, :importer
def initialize(working_path, from, to, options) def initialize(working_path, from, to, options)
self.working_path = working_path self.working_path = working_path.to_s
self.from, self.to = from.gsub('./', ''), to self.from, self.to = from.gsub('./', ''), to
self.logger = options.delete(:logger) self.logger = options.delete(:logger)
sass_opts = options.delete(:sass) || {} sass_opts = options.delete(:sass) || {}

View File

@ -565,15 +565,12 @@
.ie-horizontal-filter { .ie-horizontal-filter {
*zoom: 1; *zoom: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(gradientType=1, startColorstr='#FFFFFFFF', endColorstr='#FF000000')";
filter: progid:DXImageTransform.Microsoft.gradient(gradientType=1, startColorstr='#FFFFFFFF', endColorstr='#FF000000'); } filter: progid:DXImageTransform.Microsoft.gradient(gradientType=1, startColorstr='#FFFFFFFF', endColorstr='#FF000000'); }
.ie-vertical-filter { .ie-vertical-filter {
*zoom: 1; *zoom: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FFFFFFFF', endColorstr='#FF000000')";
filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FFFFFFFF', endColorstr='#FF000000'); } filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FFFFFFFF', endColorstr='#FF000000'); }
.ie-alpha-filter { .ie-alpha-filter {
*zoom: 1; *zoom: 1;
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FFFFFFFF', endColorstr='#00FFFFFF')";
filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FFFFFFFF', endColorstr='#00FFFFFF'); } filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#FFFFFFFF', endColorstr='#00FFFFFF'); }

View File

@ -1,4 +1,3 @@
div { div {
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)";
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=20); filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=20);
opacity: 0.2; } opacity: 0.2; }