compass-core 1.0.0.alpha.13 → 1.0.0.alpha.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0.alpha.12
1
+ 1.0.0.alpha.13
@@ -36,7 +36,7 @@ module Compass
36
36
  Data.send(:define_method, :"default_#{name}", &default) if default
37
37
  Data.inherited_accessor(name)
38
38
  if name.to_s =~ /dir|path/
39
- strip_trailing_separator(name)
39
+ Data.strip_trailing_separator(name)
40
40
  end
41
41
  end
42
42
 
@@ -2,7 +2,7 @@ module Compass::Core::SassExtensions::Functions::Display
2
2
  DEFAULT_DISPLAY = {
3
3
  "block" => %w{address article aside blockquote center dir div dd details dl dt fieldset
4
4
  figcaption figure form footer frameset h1 h2 h3 h4 h5 h6 hr header hgroup
5
- isindex menu nav noframes noscript ol p pre section summary ul},
5
+ isindex main menu nav noframes noscript ol p pre section summary ul},
6
6
  "inline" => %w{a abbr acronym audio b basefont bdo big br canvas cite code command
7
7
  datalist dfn em embed font i img input keygen kbd label mark meter output
8
8
  progress q rp rt ruby s samp select small span strike strong sub
@@ -15,7 +15,7 @@ module Compass::Core::SassExtensions::Functions::Display
15
15
  "table-footer-group" => %w{tfoot},
16
16
  "table-row" => %w{tr},
17
17
  "table-cell" => %w{th td},
18
- "html5-block" => %w{article aside details figcaption figure footer header hgroup menu nav
18
+ "html5-block" => %w{article aside details figcaption figure footer header hgroup main menu nav
19
19
  section summary},
20
20
  "html5-inline" => %w{audio canvas command datalist embed keygen mark meter output progress rp
21
21
  rt ruby time video wbr},
@@ -9,33 +9,55 @@ module Compass::Core::SassExtensions::Functions::FontFiles
9
9
  :eot => 'embedded-opentype'
10
10
  }
11
11
 
12
+ def font_formats(*args)
13
+ formats = []
14
+ with_each_font_file(*args) do |path, type|
15
+ formats << Sass::Script::String.new(type)
16
+ end
17
+ return Sass::Script::List.new(formats, :comma)
18
+ end
19
+
12
20
  def font_files(*args)
13
21
  files = []
14
- args_length = args.length
22
+ with_each_font_file(*args) do |path, type|
23
+ files << "#{font_url(path)} format('#{type}')"
24
+ end
25
+ Sass::Script::String.new(files.join(", "))
26
+ end
27
+
28
+ protected
29
+ def with_each_font_file(*args)
15
30
  skip_next = false
16
31
 
17
- args.each_with_index do |arg, index|
32
+ args.each_with_index do |path, index|
33
+ assert_type path, :String
34
+ path = unquote(path)
35
+ # if we were told to skip this iteration, do so...
18
36
  if skip_next
19
37
  skip_next = false
20
38
  next
21
39
  end
22
40
 
23
- type = (args_length > (index + 1)) ? args[index + 1].value.to_sym : :wrong
41
+ # back-compat support for passing the font type e.g.
42
+ # font-files('path/to/file.ttf', truetype, 'path/to/file.otf', opentype);
43
+ type = args[index + 1]
44
+ type = type.nil? ? :wrong : type.value.to_sym
24
45
 
46
+ # if the type is valid, keep it, and skip the next index (as it was the type)
25
47
  if FONT_TYPES.key? type
26
48
  skip_next = true
49
+ # otherwise, we need to look at the file extension to derive the type...
27
50
  else
28
51
  # let pass url like font.type?thing#stuff
29
- type = arg.to_s.split('.').last.gsub(/(\?(.*))?(#(.*))?"/, '').to_sym
52
+ type = path.to_s.split('.').last.gsub(/(\?(.*))?(#(.*))?\"?/, '').to_sym
30
53
  end
31
54
 
32
55
  if FONT_TYPES.key? type
33
- files << "#{font_url(arg)} format('#{FONT_TYPES[type]}')"
56
+ yield(path, FONT_TYPES[type]) if block_given?
34
57
  else
35
- raise Sass::SyntaxError, "Could not determine font type for #{arg}"
58
+ raise Sass::SyntaxError, "Could not determine font type for #{path}"
36
59
  end
37
60
  end
38
-
39
- Sass::Script::String.new(files.join(", "))
40
61
  end
62
+
41
63
  end
@@ -555,7 +555,7 @@ module Compass::Core::SassExtensions::Functions::GradientSupport
555
555
  end
556
556
 
557
557
  def radial_svg(color_stops, cx, cy, r)
558
- gradient = %Q{<radialGradient id="grad" gradientUnits="userSpaceOnUse" cx="#{cx}" cy="#{cy}" r="#{r}">#{color_stops_svg(color_stops)}</radialGradient>}
558
+ gradient = %Q{<radialGradient id="grad" gradientUnits="userSpaceOnUse" cx="#{cx}" cy="#{cy}" r="#{r}%">#{color_stops_svg(color_stops)}</radialGradient>}
559
559
  svg(gradient)
560
560
  end
561
561
 
@@ -7,13 +7,12 @@ module Compass::Core::SassExtensions::Functions::InlineImage
7
7
  end
8
8
 
9
9
  def inline_font_files(*args)
10
- raise Sass::SyntaxError, "An even number of arguments must be passed to font_files()" unless args.size % 2 == 0
11
10
  files = []
12
- while args.size > 0
13
- path = args.shift.value
11
+ with_each_font_file(*args) do |path, type|
12
+ path = path.value
14
13
  real_path = File.join(Compass.configuration.fonts_path, path)
15
- url = inline_image_string(data(real_path), compute_mime_type(path))
16
- files << "#{url} format('#{args.shift}')"
14
+ data = inline_image_string(data(real_path), compute_mime_type(path))
15
+ files << "#{data} format('#{type}')"
17
16
  end
18
17
  Sass::Script::String.new(files.join(", "))
19
18
  end
@@ -27,7 +26,7 @@ protected
27
26
 
28
27
  private
29
28
  def compute_mime_type(path, mime_type = nil)
30
- return mime_type if mime_type
29
+ return mime_type.value if mime_type
31
30
  case path
32
31
  when /\.png$/i
33
32
  'image/png'
@@ -44,7 +43,7 @@ private
44
43
  when /\.ttf$/i
45
44
  'font/truetype'
46
45
  when /\.woff$/i
47
- 'application/x-font-woff'
46
+ 'application/font-woff'
48
47
  when /\.off$/i
49
48
  'font/openfont'
50
49
  when /\.([a-zA-Z]+)$/
@@ -47,7 +47,7 @@ module Compass::Core::SassExtensions::Functions::Urls
47
47
  base.declare :font_url, [:path, :only_path, :cache_buster]
48
48
  end
49
49
  end
50
- def font_url(path, only_path = Sass::Script::Bool.new(false), cache_buster = Sass::Script::Bool.new(false))
50
+ def font_url(path, only_path = Sass::Script::Bool.new(false), cache_buster = Sass::Script::Bool.new(true))
51
51
  path = path.value # get to the string value of the literal.
52
52
 
53
53
  # Short curcuit if they have provided an absolute url.
@@ -65,7 +65,7 @@ module Compass::Core::SassExtensions::Functions::Urls
65
65
 
66
66
  # Compute the real path to the font on the file system if the fonts_dir is set.
67
67
  real_path = if Compass.configuration.fonts_dir
68
- File.join(Compass.configuration.project_path, Compass.configuration.fonts_dir, path)
68
+ File.join(Compass.configuration.fonts_path, path.gsub(/#.*$/,""))
69
69
  end
70
70
 
71
71
  # prepend the path to the font if there's one
@@ -81,11 +81,13 @@ module Compass::Core::SassExtensions::Functions::Urls
81
81
 
82
82
  # Compute and append the cache buster if there is one.
83
83
  if cache_buster.to_bool
84
+ path, anchor = path.split("#", 2)
84
85
  if cache_buster.is_a?(Sass::Script::String)
85
86
  path += "?#{cache_buster.value}"
86
87
  else
87
88
  path = cache_busted_path(path, real_path)
88
89
  end
90
+ path = "#{path}#{"#" if anchor}#{anchor}"
89
91
  end
90
92
 
91
93
  # prepend the asset host if there is one.
@@ -131,9 +133,9 @@ module Compass::Core::SassExtensions::Functions::Urls
131
133
 
132
134
  # Compute the real path to the image on the file stystem if the images_dir is set.
133
135
  real_path = if Compass.configuration.images_path
134
- File.join(Compass.configuration.images_path, path)
136
+ File.join(Compass.configuration.images_path, path.gsub(/#.*$/,""))
135
137
  else
136
- File.join(Compass.configuration.project_path, path)
138
+ File.join(Compass.configuration.project_path, path.gsub(/#.*$/,""))
137
139
  end
138
140
 
139
141
  # prepend the path to the image if there's one
@@ -149,11 +151,13 @@ module Compass::Core::SassExtensions::Functions::Urls
149
151
 
150
152
  # Compute and append the cache buster if there is one.
151
153
  if cache_buster.to_bool
154
+ path, anchor = path.split("#", 2)
152
155
  if cache_buster.is_a?(Sass::Script::String)
153
156
  path += "?#{cache_buster.value}"
154
157
  else
155
158
  path = cache_busted_path(path, real_path)
156
159
  end
160
+ path = "#{path}#{"#" if anchor}#{anchor}"
157
161
  end
158
162
 
159
163
  # prepend the asset host if there is one.
@@ -198,9 +202,9 @@ module Compass::Core::SassExtensions::Functions::Urls
198
202
 
199
203
  # Compute the real path to the image on the file stystem if the generated_images_dir is set.
200
204
  real_path = if Compass.configuration.images_path
201
- File.join(Compass.configuration.images_path, path)
205
+ File.join(Compass.configuration.images_path, path.gsub(/#.*$/,""))
202
206
  else
203
- File.join(Compass.configuration.project_path, path)
207
+ File.join(Compass.configuration.project_path, path.gsub(/#.*$/,""))
204
208
  end
205
209
 
206
210
  # prepend the path to the image if there's one
@@ -216,11 +220,13 @@ module Compass::Core::SassExtensions::Functions::Urls
216
220
 
217
221
  # Compute and append the cache buster if there is one.
218
222
  if cache_buster.to_bool
223
+ path, anchor = path.split("#", 2)
219
224
  if cache_buster.is_a?(Sass::Script::String)
220
225
  path += "?#{cache_buster.value}"
221
226
  else
222
227
  path = cache_busted_path(path, real_path)
223
228
  end
229
+ path = "#{path}#{"#" if anchor}#{anchor}"
224
230
  end
225
231
 
226
232
  # prepend the asset host if there is one.
@@ -275,15 +281,23 @@ module Compass::Core::SassExtensions::Functions::Urls
275
281
  end
276
282
 
277
283
  def compute_cache_buster(path, real_path)
284
+ file = nil
278
285
  if Compass.configuration.asset_cache_buster
279
286
  args = [path]
280
287
  if Compass.configuration.asset_cache_buster.arity > 1
281
- args << (File.new(real_path) if real_path)
288
+ begin
289
+ file = File.new(real_path) if real_path
290
+ rescue Errno::ENOENT
291
+ # pass
292
+ end
293
+ args << file
282
294
  end
283
295
  Compass.configuration.asset_cache_buster.call(*args)
284
296
  elsif real_path
285
297
  default_cache_buster(path, real_path)
286
298
  end
299
+ ensure
300
+ file.close if file
287
301
  end
288
302
 
289
303
  def default_cache_buster(path, real_path)
@@ -6,10 +6,16 @@
6
6
  // Defaults to the $graceful-usage-threshold.
7
7
  $box-sizing-support-threshold: $critical-usage-threshold !default;
8
8
 
9
+ // The default box-sizing model when no argument is provided to the box-sizing mixin: [ content-box | border-box | padding-box ]
10
+ //
11
+ // The browser default is content-box, compass defaults to border-box.
12
+ $default-box-sizing: border-box !default;
13
+
14
+
9
15
  // Change the box model for Mozilla, Webkit, IE8 and the future
10
16
  //
11
17
  // $box-model: [ content-box | border-box | padding-box ]
12
- @mixin box-sizing($box-model) {
18
+ @mixin box-sizing($box-model: $default-box-sizing) {
13
19
  $box-model: unquote($box-model);
14
20
  @include prefixed-properties(css3-boxsizing, $box-sizing-support-threshold, (box-sizing: $box-model));
15
21
  }
@@ -11,7 +11,11 @@ $opacity-usage-threshold: $graceful-usage-threshold !default;
11
11
 
12
12
  @mixin opacity($opacity) {
13
13
  @include for-legacy-browser("ie", "8", $threshold: $opacity-usage-threshold) {
14
- filter: unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=#{round($opacity * 100)})");
14
+ @if $opacity == 1 {
15
+ filter: unquote("progid:DXImageTransform.Microsoft.Alpha(enabled=false)");
16
+ } @else {
17
+ filter: unquote("progid:DXImageTransform.Microsoft.Alpha(Opacity=#{round($opacity * 100)})");
18
+ }
15
19
  }
16
20
  opacity: $opacity;
17
21
  }
@@ -118,13 +118,13 @@ $transitionable-prefixed-values: transform, transform-origin !default;
118
118
  }
119
119
 
120
120
  @mixin transition($transitions...) {
121
- $default: compact($default-transition-property $default-transition-duration $default-transition-function $default-transition-delay);
121
+ $default: (compact($default-transition-property $default-transition-duration $default-transition-function $default-transition-delay),);
122
122
  $transitions: set-arglist-default($transitions, $default);
123
123
 
124
124
  @include with-each-prefix(css-transitions, $transition-support-threshold) {
125
- $delays: ();
126
- $transitions-without-delays: ();
127
- $transitions-with-delays: ();
125
+ $delays: comma-list();
126
+ $transitions-without-delays: comma-list();
127
+ $transitions-with-delays: comma-list();
128
128
  $has-delays: false;
129
129
 
130
130
 
@@ -68,7 +68,7 @@ $grid-background-force-fluid : false !default;
68
68
  }
69
69
 
70
70
  // and we add this column/gutter pair to our grid
71
- $grid: join($grid, ($column-color $a, $column-color $g, $gutter-color $g, $gutter-color $z));
71
+ $grid: join($grid, (lighten($column-color, 5%) $a, darken($column-color, 5%) $g, $gutter-color $g, $gutter-color $z));
72
72
  }
73
73
 
74
74
  @return $grid;
@@ -143,7 +143,7 @@ $rem-with-px-fallback: true !default;
143
143
  }
144
144
 
145
145
  // Use pixel fallback for browsers that don't understand rem units.
146
- @if $use-px-fallback {
146
+ @if $use-px-fallback and $px-values != $rem-values {
147
147
  #{$property}: $px-values;
148
148
  }
149
149
 
@@ -137,7 +137,7 @@ $relative-font-sizing: if($rhythm-unit == px, false, true);
137
137
  background: image-url($img);
138
138
  }
139
139
  @else {
140
- @include baseline-grid-background(rhythm());
140
+ @include baseline-grid-background(if($round-to-nearest-half-line, rhythm(1/2), rhythm(1)));
141
141
  }
142
142
  }
143
143
 
@@ -1,3 +1,5 @@
1
+ @import "compass/support";
2
+
1
3
  // Indicates the direction you prefer to move your text
2
4
  // when hiding it.
3
5
  //
@@ -56,6 +58,10 @@ $hide-text-direction: left !default;
56
58
  white-space: nowrap;
57
59
  overflow: hidden;
58
60
  }
61
+ @include for-legacy-browsers((ie: "7"), $critical-usage-threshold) {
62
+ //Text transform capitalize fixes text-replacement issue when used in a <button> element on ie7
63
+ text-transform:capitalize;
64
+ }
59
65
  }
60
66
 
61
67
  // Hides text in an element by squishing the text into oblivion.
metadata CHANGED
@@ -1,80 +1,95 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: compass-core
3
- version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha.13
3
+ version: !ruby/object:Gem::Version
4
+ hash: 1962072037
5
+ prerelease: 6
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 0
10
+ - alpha
11
+ - 14
12
+ version: 1.0.0.alpha.14
5
13
  platform: ruby
6
- authors:
14
+ authors:
7
15
  - Chris Eppstein
8
16
  autorequire:
9
17
  bindir: bin
10
18
  cert_chain: []
11
- date: 2013-11-27 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: sass
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '>='
18
- - !ruby/object:Gem::Version
19
+
20
+ date: 2013-12-05 00:00:00 Z
21
+ dependencies:
22
+ - !ruby/object:Gem::Dependency
23
+ version_requirements: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: -23480560
29
+ segments:
30
+ - 3
31
+ - 3
32
+ - rc
33
+ - 1
19
34
  version: 3.3.rc.1
20
- type: :runtime
35
+ name: sass
21
36
  prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - '>='
25
- - !ruby/object:Gem::Version
26
- version: 3.3.rc.1
27
- - !ruby/object:Gem::Dependency
28
- name: multi_json
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ~>
32
- - !ruby/object:Gem::Version
33
- version: '1.0'
34
37
  type: :runtime
38
+ requirement: *id001
39
+ - !ruby/object:Gem::Dependency
40
+ version_requirements: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ hash: 15
46
+ segments:
47
+ - 1
48
+ - 0
49
+ version: "1.0"
50
+ name: multi_json
35
51
  prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
52
+ type: :runtime
53
+ requirement: *id002
54
+ - !ruby/object:Gem::Dependency
55
+ version_requirements: &id003 !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
38
58
  - - ~>
39
- - !ruby/object:Gem::Version
40
- version: '1.0'
41
- - !ruby/object:Gem::Dependency
59
+ - !ruby/object:Gem::Version
60
+ hash: 9
61
+ segments:
62
+ - 1
63
+ - 3
64
+ version: "1.3"
42
65
  name: bundler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ~>
46
- - !ruby/object:Gem::Version
47
- version: '1.3'
48
- type: :development
49
66
  prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: '1.3'
55
- - !ruby/object:Gem::Dependency
56
- name: rake
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - '>='
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
67
  type: :development
68
+ requirement: *id003
69
+ - !ruby/object:Gem::Dependency
70
+ version_requirements: &id004 !ruby/object:Gem::Requirement
71
+ none: false
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ hash: 3
76
+ segments:
77
+ - 0
78
+ version: "0"
79
+ name: rake
63
80
  prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - '>='
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- description: The Compass core stylesheet library and minimum required ruby extensions.
70
- This library can be used stand-alone without the compass ruby configuration file
71
- or compass command line tools.
72
- email:
81
+ type: :development
82
+ requirement: *id004
83
+ description: The Compass core stylesheet library and minimum required ruby extensions. This library can be used stand-alone without the compass ruby configuration file or compass command line tools.
84
+ email:
73
85
  - chris@eppsteins.net
74
86
  executables: []
87
+
75
88
  extensions: []
89
+
76
90
  extra_rdoc_files: []
77
- files:
91
+
92
+ files:
78
93
  - data/caniuse.json
79
94
  - data/caniuse_extras/css-placeholder.json
80
95
  - lib/compass-core.rb
@@ -215,27 +230,39 @@ files:
215
230
  - VERSION
216
231
  - LICENSE.txt
217
232
  homepage: http://compass-style.org/reference/compass/
218
- licenses:
233
+ licenses:
219
234
  - MIT
220
- metadata: {}
221
235
  post_install_message:
222
236
  rdoc_options: []
223
- require_paths:
237
+
238
+ require_paths:
224
239
  - lib
225
- required_ruby_version: !ruby/object:Gem::Requirement
226
- requirements:
227
- - - '>='
228
- - !ruby/object:Gem::Version
229
- version: '0'
230
- required_rubygems_version: !ruby/object:Gem::Requirement
231
- requirements:
232
- - - '>'
233
- - !ruby/object:Gem::Version
240
+ required_ruby_version: !ruby/object:Gem::Requirement
241
+ none: false
242
+ requirements:
243
+ - - ">="
244
+ - !ruby/object:Gem::Version
245
+ hash: 3
246
+ segments:
247
+ - 0
248
+ version: "0"
249
+ required_rubygems_version: !ruby/object:Gem::Requirement
250
+ none: false
251
+ requirements:
252
+ - - ">"
253
+ - !ruby/object:Gem::Version
254
+ hash: 25
255
+ segments:
256
+ - 1
257
+ - 3
258
+ - 1
234
259
  version: 1.3.1
235
260
  requirements: []
261
+
236
262
  rubyforge_project:
237
- rubygems_version: 2.0.3
263
+ rubygems_version: 1.8.15
238
264
  signing_key:
239
- specification_version: 4
265
+ specification_version: 3
240
266
  summary: The Compass core stylesheet library
241
267
  test_files: []
268
+
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 246b011e8fd01cd10372aa322e905d2ec3e39078
4
- data.tar.gz: 78589762eea944050aeb2adf62816f5a9edfacc0
5
- SHA512:
6
- metadata.gz: 39562ece95cdd316d843b2ffdfd23ea1d243ca45db291bf9eded4a0061c848329ff0607636aa68e290e1b239164d1585dcd565e5758400216900656932591ca1
7
- data.tar.gz: 8a0380cadabfe9939982b2ea02e9a336b9bf8b224e68920ac8dd59f44e9d21b5a7da79a5e01fe68cc6b4cf69723c6b4592bd8db4211f1afa94054d2b2757d9e4