compass 0.12.0 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,7 +1,16 @@
1
1
  require 'rubygems'
2
- require 'bundler'
3
- Bundler.setup
4
- require 'rake/dsl_definition' rescue nil
2
+ if ENV["PKG"]
3
+ $: << File.expand_path(File.dirname(__FILE__))+"/lib"
4
+ else
5
+ require 'bundler'
6
+ Bundler.setup
7
+ end
8
+
9
+ begin
10
+ require 'rake/dsl_definition'
11
+ rescue LoadError
12
+ #pass
13
+ end
5
14
  require 'compass'
6
15
 
7
16
  # ----- Default: Testing ------
@@ -10,12 +19,17 @@ task :default => [:test, :features]
10
19
 
11
20
  require 'rake/testtask'
12
21
  require 'fileutils'
22
+
23
+ begin
13
24
  require 'cucumber'
14
25
  require 'cucumber/rake/task'
15
26
 
16
27
  Cucumber::Rake::Task.new(:features) do |t|
17
28
  t.cucumber_opts = "features --format progress"
18
29
  end
30
+ rescue LoadError
31
+ $stderr.puts "cannot load cucumber"
32
+ end
19
33
 
20
34
  Rake::TestTask.new :test do |t|
21
35
  t.libs << 'lib'
@@ -124,3 +138,20 @@ rescue LoadError => e
124
138
  puts "WARNING: #{e}"
125
139
  end
126
140
 
141
+ begin
142
+ require 'packager/rake_task'
143
+ require 'compass/version'
144
+ # Building a package:
145
+ # 1. Get packager installed and make sure your system is setup correctly according to their docs.
146
+ # 2. Make sure you are actually using a universal binary that has been nametooled.
147
+ # 3. PKG=1 OFFICIAL=1 rake packager:pkg
148
+ Packager::RakeTask.new(:pkg) do |t|
149
+ t.package_name = "Compass"
150
+ t.version = Compass::VERSION
151
+ t.domain = "compass-style.org"
152
+ t.bin_files = ["compass"]
153
+ t.resource_files = FileList["frameworks/**/*"] + ["VERSION.yml", "LICENSE.markdown"]
154
+ end
155
+ rescue LoadError => e
156
+ puts "WARNING: #{e}"
157
+ end
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 12
4
- :build: 0
4
+ :build: 1
5
5
  :name: Alnilam
@@ -1,18 +1,18 @@
1
1
  @import "compass/layout/grid-background";
2
2
 
3
- // The base font size
3
+ // The base font size.
4
4
  $base-font-size: 16px !default;
5
5
 
6
- // The base line height is the basic unit of line hightness.
6
+ // The base line height determines the basic unit of vertical rhythm.
7
7
  $base-line-height: 24px !default;
8
8
 
9
- // set the default border style for rhythm borders
9
+ // Set the default border style for rhythm borders.
10
10
  $default-rhythm-border-style: solid !default;
11
11
 
12
12
  // The IE font ratio is a fact of life. Deal with it.
13
13
  $ie-font-ratio: 16px / 100%;
14
14
 
15
- // Set to false if you want to use absolute pixes in sizing your typography.
15
+ // Set to false if you want to use absolute pixels in sizing your typography.
16
16
  $relative-font-sizing: true !default;
17
17
 
18
18
  // Allows the `adjust-font-size-to` mixin and the `lines-for-font-size` function
@@ -25,26 +25,26 @@ $round-to-nearest-half-line: false !default;
25
25
  $min-line-padding: 2px !default;
26
26
 
27
27
  // $base-font-size but in your output unit of choice.
28
- // Defaults to 1em when `$relative-font-sizing`
28
+ // Defaults to 1em when `$relative-font-sizing` is true.
29
29
  $font-unit: if($relative-font-sizing, 1em, $base-font-size) !default;
30
30
 
31
- // The basic unit of font rhythm
31
+ // The basic unit of font rhythm.
32
32
  $base-rhythm-unit: $base-line-height / $base-font-size * $font-unit;
33
33
 
34
34
  // The leader is the amount of whitespace in a line.
35
- // It might be useful in your calculations
35
+ // It might be useful in your calculations.
36
36
  $base-leader: ($base-line-height - $base-font-size) * $font-unit / $base-font-size;
37
37
 
38
38
  // The half-leader is the amount of whitespace above and below a line.
39
- // It might be useful in your calculations
39
+ // It might be useful in your calculations.
40
40
  $base-half-leader: $base-leader / 2;
41
41
 
42
- // True if a number has a relative unit
42
+ // True if a number has a relative unit.
43
43
  @function relative-unit($number) {
44
44
  @return unit($number) == "%" or unit($number) == "em" or unit($number) == "rem"
45
45
  }
46
46
 
47
- // True if a number has an absolute unit
47
+ // True if a number has an absolute unit.
48
48
  @function absolute-unit($number) {
49
49
  @return not (relative-unit($number) or unitless($number));
50
50
  }
@@ -53,7 +53,7 @@ $base-half-leader: $base-leader / 2;
53
53
  @warn "$relative-font-sizing is true but $font-unit is set to #{$font-unit} which is not a relative unit.";
54
54
  }
55
55
 
56
- // Establishes a font baseline for the given font-size in pixels
56
+ // Establishes a font baseline for the given font-size.
57
57
  @mixin establish-baseline($font-size: $base-font-size) {
58
58
  body {
59
59
  font-size: $font-size / $ie-font-ratio;
@@ -70,7 +70,7 @@ $base-half-leader: $base-leader / 2;
70
70
  }
71
71
 
72
72
  // Show a background image that can be used to debug your alignments.
73
- // include the $img argument if you would rather use your own image than the
73
+ // Include the $img argument if you would rather use your own image than the
74
74
  // Compass default gradient image.
75
75
  @mixin debug-vertical-alignment($img: false) {
76
76
  @if $img {
@@ -80,11 +80,11 @@ $base-half-leader: $base-leader / 2;
80
80
  }
81
81
  }
82
82
 
83
- // Adjust a block to have a different font size and leading to maintain the rhythm.
84
- // $lines is a number that is how many times the baseline rhythm this
85
- // font size should use up. Does not have to be an integer, but it defaults
86
- // to the smallest integer that is large enough to fit the font.
87
- // Use $from_size to adjust from a non-base font-size.
83
+ // Adjust a block to have a different font size and line height to maintain the
84
+ // rhythm. $lines specifies how many multiples of the baseline rhythm each line
85
+ // of this font should use up. It does not have to be an integer, but it
86
+ // defaults to the smallest integer that is large enough to fit the font.
87
+ // Use $from-size to adjust from a font-size other than the base font-size.
88
88
  @mixin adjust-font-size-to($to-size, $lines: lines-for-font-size($to-size), $from-size: $base-font-size) {
89
89
  @if not $relative-font-sizing and $from-size != $base-font-size {
90
90
  @warn "$relative-font-sizing is false but a relative font size was passed to adjust-font-size-to";
@@ -93,14 +93,15 @@ $base-half-leader: $base-leader / 2;
93
93
  @include adjust-leading-to($lines, if($relative-font-sizing, $to-size, $base-font-size));
94
94
  }
95
95
 
96
+ // Adjust a block to have different line height to maintain the rhythm.
97
+ // $lines specifies how many multiples of the baseline rhythm each line of this
98
+ // font should use up. It does not have to be an integer, but it defaults to the
99
+ // smallest integer that is large enough to fit the font.
96
100
  @mixin adjust-leading-to($lines, $font-size: $base-font-size) {
97
- @if not $relative-font-sizing and $font-size != $base-font-size {
98
- @warn "$relative-font-sizing is false but a relative font size was passed to adjust-leading-to";
99
- }
100
- line-height: $font-unit * $lines * $base-line-height / $font-size;
101
+ line-height: rhythm($lines, $font-size);
101
102
  }
102
103
 
103
- // Calculate rhythm units
104
+ // Calculate rhythm units.
104
105
  @function rhythm(
105
106
  $lines: 1,
106
107
  $font-size: $base-font-size
@@ -109,9 +110,14 @@ $base-half-leader: $base-leader / 2;
109
110
  @warn "$relative-font-sizing is false but a relative font size was passed to the rhythm function";
110
111
  }
111
112
  $rhythm: $font-unit * $lines * $base-line-height / $font-size;
113
+ // Round the pixels down to nearest integer.
114
+ @if unit($rhythm) == px {
115
+ $rhythm: floor($rhythm);
116
+ }
112
117
  @return $rhythm;
113
118
  }
114
119
 
120
+ // Calculate the minimum multiple of rhythm units needed to contain the font-size.
115
121
  @function lines-for-font-size($font-size) {
116
122
  $lines: if($round-to-nearest-half-line,
117
123
  ceil(2 * $font-size / $base-line-height) / 2,
@@ -122,46 +128,37 @@ $base-half-leader: $base-leader / 2;
122
128
  @return $lines;
123
129
  }
124
130
 
125
- // Apply leading whitespace
131
+ // Apply leading whitespace. The $property can be margin or padding.
126
132
  @mixin leader($lines: 1, $font-size: $base-font-size, $property: margin) {
127
- $leader: rhythm($lines, $font-size);
128
- @if unit($leader) == px {
129
- $leader: floor($leader)
130
- }
131
- #{$property}-top: $leader;
133
+ #{$property}-top: rhythm($lines, $font-size);
132
134
  }
133
135
 
134
- // Apply leading whitespace as padding
136
+ // Apply leading whitespace as padding.
135
137
  @mixin padding-leader($lines: 1, $font-size: $base-font-size) {
136
- @include leader($lines, $font-size, padding);
138
+ padding-top: rhythm($lines, $font-size);
137
139
  }
138
140
 
139
- // Apply leading whitespace as margin
141
+ // Apply leading whitespace as margin.
140
142
  @mixin margin-leader($lines: 1, $font-size: $base-font-size) {
141
- @include leader($lines, $font-size, margin);
143
+ margin-top: rhythm($lines, $font-size);
142
144
  }
143
145
 
144
- // Apply trailing whitespace
146
+ // Apply trailing whitespace. The $property can be margin or padding.
145
147
  @mixin trailer($lines: 1, $font-size: $base-font-size, $property: margin) {
146
- $leader: rhythm($lines, $font-size);
147
- @if unit($leader) == px {
148
- $leader: ceil($leader)
149
- }
150
- #{$property}-bottom: $leader;
148
+ #{$property}-bottom: rhythm($lines, $font-size);
151
149
  }
152
150
 
153
- // Apply trailing whitespace as padding
151
+ // Apply trailing whitespace as padding.
154
152
  @mixin padding-trailer($lines: 1, $font-size: $base-font-size) {
155
- @include trailer($lines, $font-size, padding);
153
+ padding-bottom: rhythm($lines, $font-size);
156
154
  }
157
155
 
158
- // Apply trailing whitespace as margin
156
+ // Apply trailing whitespace as margin.
159
157
  @mixin margin-trailer($lines: 1, $font-size: $base-font-size) {
160
- @include trailer($lines, $font-size, margin);
158
+ margin-bottom: rhythm($lines, $font-size);
161
159
  }
162
160
 
163
- // Whitespace application shortcut
164
- // Apply top margin/padding + bottom padding/margin
161
+ // Shorthand mixin to apply whitespace for top and bottom margins and padding.
165
162
  @mixin rhythm($leader: 0, $padding-leader: 0, $padding-trailer: 0, $trailer: 0, $font-size: $base-font-size) {
166
163
  @include leader($leader, $font-size);
167
164
  @include padding-leader($padding-leader, $font-size);
@@ -169,8 +166,8 @@ $base-half-leader: $base-leader / 2;
169
166
  @include trailer($trailer, $font-size);
170
167
  }
171
168
 
172
- // Apply a border width to any side without destroying the vertical rhythm.
173
- // The available space ($lines) must be greater than the width of your border.
169
+ // Apply a border and whitespace to any side without destroying the vertical
170
+ // rhythm. The whitespace must be greater than the width of the border.
174
171
  @mixin apply-side-rhythm-border($side, $width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) {
175
172
  @if not $relative-font-sizing and $font-size != $base-font-size {
176
173
  @warn "$relative-font-sizing is false but a relative font size was passed to apply-side-rhythm-border";
@@ -182,33 +179,35 @@ $base-half-leader: $base-leader / 2;
182
179
  padding-#{$side}: $font-unit / $font-size * ($lines * $base-line-height - $width);
183
180
  }
184
181
 
185
- // Aplly rhythm borders equally to all sides
182
+ // Apply borders and whitespace equally to all sides.
186
183
  @mixin rhythm-borders($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) {
187
184
  @if not $relative-font-sizing and $font-size != $base-font-size {
188
185
  @warn "$relative-font-sizing is false but a relative font size was passed to rhythm-borders";
189
186
  }
190
187
  border: {
191
188
  style: $border-style;
192
- width: $font-unit * $width / $font-size; };
189
+ width: $font-unit * $width / $font-size;
190
+ };
193
191
  padding: $font-unit / $font-size * ($lines * $base-line-height - $width);
194
192
  }
195
193
 
196
- // Apply a leading rhythm border
194
+ // Apply a leading border.
197
195
  @mixin leading-border($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) {
198
196
  @include apply-side-rhythm-border(top, $width, $lines, $font-size, $border-style);
199
197
  }
200
198
 
201
- // Apply a trailing rhythm border
199
+ // Apply a trailing border.
202
200
  @mixin trailing-border($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) {
203
201
  @include apply-side-rhythm-border(bottom, $width, $lines, $font-size, $border-style);
204
202
  }
205
203
 
206
- // Apply both leading and trailing rhythm borders
204
+ // Apply both leading and trailing borders.
207
205
  @mixin horizontal-borders($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) {
208
206
  @include leading-border($width, $lines, $font-size, $border-style);
209
207
  @include trailing-border($width, $lines, $font-size, $border-style);
210
208
  }
211
209
 
210
+ // Alias for `horizontal-borders` mixin.
212
211
  @mixin h-borders($width: 1px, $lines: 1, $font-size: $base-font-size, $border-style: $default-rhythm-border-style) {
213
212
  @include horizontal-borders($width, $lines, $font-size, $border-style);
214
213
  }
@@ -5,7 +5,8 @@ module Compass::SassExtensions::Functions::FontFiles
5
5
  :opentype => 'opentype',
6
6
  :ttf => 'truetype',
7
7
  :truetype => 'truetype',
8
- :svg => 'svg'
8
+ :svg => 'svg',
9
+ :eot => 'embedded-opentype'
9
10
  }
10
11
 
11
12
  def font_files(*args)
@@ -24,7 +25,8 @@ module Compass::SassExtensions::Functions::FontFiles
24
25
  if FONT_TYPES.key? type
25
26
  skip_next = true
26
27
  else
27
- type = arg.to_s.split('.').last.gsub('"', '').to_sym
28
+ # let pass url like font.type?thing#stuff
29
+ type = arg.to_s.split('.').last.gsub(/(\?(.*))?(#(.*))?"/, '').to_sym
28
30
  end
29
31
 
30
32
  if FONT_TYPES.key? type
@@ -126,6 +126,18 @@ class SassExtensionsTest < Test::Unit::TestCase
126
126
  evaluate("font-files('/font/name.woff')")
127
127
  end
128
128
 
129
+ assert_nothing_raised Sass::SyntaxError do
130
+ evaluate("font-files('/font/name.svg#fontId')")
131
+ end
132
+
133
+ assert_nothing_raised Sass::SyntaxError do
134
+ evaluate("font-files('/font/name.eot?#iefix')")
135
+ end
136
+
137
+ assert_nothing_raised Sass::SyntaxError do
138
+ evaluate("font-files('/font/name.svg?mightbedynamic=something%20+escaped#fontId')")
139
+ end
140
+
129
141
  assert_raises Sass::SyntaxError do
130
142
  evaluate("font-files('/font/name.ext')")
131
143
  end
metadata CHANGED
@@ -1,25 +1,25 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: compass
3
3
  version: !ruby/object:Gem::Version
4
- hash: 47
5
- prerelease:
4
+ prerelease: false
6
5
  segments:
7
6
  - 0
8
7
  - 12
9
- - 0
10
- version: 0.12.0
8
+ - 1
9
+ version: 0.12.1
11
10
  platform: ruby
12
11
  authors:
13
12
  - Chris Eppstein
13
+ - Scott Davis
14
14
  - Eric A. Meyer
15
15
  - Brandon Mathis
16
+ - Anthony Short
16
17
  - Nico Hagenburger
17
- - Scott Davis
18
18
  autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
21
 
22
- date: 2012-03-12 00:00:00 -07:00
22
+ date: 2012-03-14 00:00:00 -07:00
23
23
  default_executable:
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
@@ -30,7 +30,6 @@ dependencies:
30
30
  requirements:
31
31
  - - ~>
32
32
  - !ruby/object:Gem::Version
33
- hash: 5
34
33
  segments:
35
34
  - 3
36
35
  - 1
@@ -45,7 +44,6 @@ dependencies:
45
44
  requirements:
46
45
  - - ~>
47
46
  - !ruby/object:Gem::Version
48
- hash: 11
49
47
  segments:
50
48
  - 1
51
49
  - 2
@@ -60,7 +58,6 @@ dependencies:
60
58
  requirements:
61
59
  - - ">="
62
60
  - !ruby/object:Gem::Version
63
- hash: 25
64
61
  segments:
65
62
  - 0
66
63
  - 2
@@ -1300,7 +1297,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
1300
1297
  requirements:
1301
1298
  - - ">="
1302
1299
  - !ruby/object:Gem::Version
1303
- hash: 3
1304
1300
  segments:
1305
1301
  - 0
1306
1302
  version: "0"
@@ -1309,14 +1305,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1309
1305
  requirements:
1310
1306
  - - ">="
1311
1307
  - !ruby/object:Gem::Version
1312
- hash: 3
1313
1308
  segments:
1314
1309
  - 0
1315
1310
  version: "0"
1316
1311
  requirements: []
1317
1312
 
1318
1313
  rubyforge_project:
1319
- rubygems_version: 1.4.2
1314
+ rubygems_version: 1.3.7
1320
1315
  signing_key:
1321
1316
  specification_version: 3
1322
1317
  summary: A Real Stylesheet Framework