autoprefixer-rails 1.0.20140213 → 1.1.20140218
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +11 -0
- data/README.md +19 -3
- data/lib/autoprefixer-rails.rb +9 -12
- data/lib/autoprefixer-rails/processor.rb +5 -9
- data/lib/autoprefixer-rails/railtie.rb +7 -6
- data/lib/autoprefixer-rails/version.rb +1 -1
- data/lib/rake/autoprefixer_tasks.rb +4 -3
- data/spec/app/app/assets/stylesheets/test.css +3 -1
- data/spec/app/config/autoprefixer.yml +1 -0
- data/spec/app/config/initializers/compress.rb +1 -0
- data/spec/autoprefixer_spec.rb +17 -2
- data/spec/rails_spec.rb +3 -1
- data/spec/spec_helper.rb +0 -2
- data/vendor/autoprefixer.js +1260 -350
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d6b8c2d1c98f08ffae83aa569ad72e413c35990a
|
4
|
+
data.tar.gz: 79ff2b2e77318a3f532e34e3591ad815f76ae255
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4b3a7c25c389cea4d91bdfb05eed960d67287b6db476c983b7ac55b3a490b3446b00c7bb431b6e530ed78ec964e51c2cc1f4dfedfb919773593963dc59a2204
|
7
|
+
data.tar.gz: 6f0ff25e0c1a30bb0ec72ad6198fc765fc020b8d5bce954bf9d7a53e7b9d6d382849066c4c6ee13a10b4a62621bea14caca178012a748d340023a23de0838e4f
|
data/ChangeLog.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
## 1.1 “Nutrisco et extingo”
|
2
|
+
* Add source map annotation comment support.
|
3
|
+
* Add inline source map support.
|
4
|
+
* Autodetect previous inline source map.
|
5
|
+
* Fix source maps support on Windows.
|
6
|
+
* Fix source maps support in subdirectory.
|
7
|
+
* Change CSS indentation to create nice visual cascade of prefixes.
|
8
|
+
* Fix flexbox support for IE 10 (by Roland Warmerdam).
|
9
|
+
* Better `break-inside` support.
|
10
|
+
* Fix prefixing, when two same properties are near.
|
11
|
+
|
1
12
|
## 1.0 “Plus ultra”
|
2
13
|
* Source map support.
|
3
14
|
* Save origin indents and code formatting.
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@ support to add vendor prefixes automatically using the Asset Pipeline:
|
|
32
32
|
```css
|
33
33
|
:-webkit-full-screen a {
|
34
34
|
-webkit-transition: -webkit-transform 1s;
|
35
|
-
|
35
|
+
transition: transform 1s
|
36
36
|
}
|
37
37
|
:-moz-full-screen a {
|
38
38
|
transition: transform 1s
|
@@ -42,7 +42,7 @@ support to add vendor prefixes automatically using the Asset Pipeline:
|
|
42
42
|
}
|
43
43
|
:fullscreen a {
|
44
44
|
-webkit-transition: -webkit-transform 1s;
|
45
|
-
|
45
|
+
transition: transform 1s
|
46
46
|
}
|
47
47
|
```
|
48
48
|
|
@@ -99,7 +99,23 @@ You can specify browsers by `browsers` option:
|
|
99
99
|
AutoprefixerRails.process(css, from: 'a.css', browsers: ['> 1%', 'ie 10']).css
|
100
100
|
```
|
101
101
|
|
102
|
-
|
102
|
+
## Visual Cascade
|
103
|
+
|
104
|
+
By default, Autoprefixer will change CSS indentation to create nice visual
|
105
|
+
cascade of prefixes.
|
106
|
+
|
107
|
+
```css
|
108
|
+
a {
|
109
|
+
-webkit-box-sizing: border-box;
|
110
|
+
-moz-box-sizing: border-box;
|
111
|
+
box-sizing: border-box
|
112
|
+
}
|
113
|
+
```
|
114
|
+
|
115
|
+
You can disable it by `cascade: false` in `config/autoprefixer.yml`
|
116
|
+
or in `process()` options.
|
117
|
+
|
118
|
+
## Source Map
|
103
119
|
|
104
120
|
Autoprefixer will generate source map, if you set `map` option to `true` in
|
105
121
|
`process` method.
|
data/lib/autoprefixer-rails.rb
CHANGED
@@ -4,26 +4,23 @@ module AutoprefixerRails
|
|
4
4
|
autoload :Sprockets, 'autoprefixer-rails/sprockets'
|
5
5
|
|
6
6
|
# Add prefixes to `css`. See `Processor#process` for options.
|
7
|
-
def self.process(css, opts = {
|
7
|
+
def self.process(css, opts = {})
|
8
8
|
browsers = opts.delete(:browsers)
|
9
|
-
|
9
|
+
options = opts.has_key?(:cascade) ? { cascade: opts.delete(:cascade) } : {}
|
10
|
+
processor(browsers, options).process(css, opts)
|
10
11
|
end
|
11
12
|
|
12
13
|
# Add Autoprefixer for Sprockets environment in `assets`.
|
13
14
|
# You can specify `browsers` actual in your project.
|
14
|
-
def self.install(assets, browsers = nil)
|
15
|
-
Sprockets.new( processor(browsers) ).install(assets)
|
15
|
+
def self.install(assets, browsers = nil, opts = {})
|
16
|
+
Sprockets.new( processor(browsers, opts) ).install(assets)
|
16
17
|
end
|
17
18
|
|
18
19
|
# Cache processor instances
|
19
|
-
def self.processor(browsers=nil)
|
20
|
-
@cache
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
# Deprecated method. Use `process` instead.
|
25
|
-
def self.compile(css, browsers = nil)
|
26
|
-
processor(browsers).compile(css)
|
20
|
+
def self.processor(browsers = nil, opts = {})
|
21
|
+
@cache ||= {}
|
22
|
+
cache_key = browsers.hash.to_s + opts.hash.to_s
|
23
|
+
@cache[cache_key] ||= Processor.new(browsers, opts)
|
27
24
|
end
|
28
25
|
end
|
29
26
|
|
@@ -4,8 +4,10 @@ require 'execjs'
|
|
4
4
|
module AutoprefixerRails
|
5
5
|
# Ruby to JS wrapper for Autoprefixer processor instance
|
6
6
|
class Processor
|
7
|
-
def initialize(browsers=nil)
|
7
|
+
def initialize(browsers = nil, opts = {})
|
8
8
|
@browsers = browsers || []
|
9
|
+
@options = opts
|
10
|
+
@options[:cascade] = true unless @options.has_key? :cascade
|
9
11
|
end
|
10
12
|
|
11
13
|
# Process `css` and return result.
|
@@ -29,13 +31,6 @@ module AutoprefixerRails
|
|
29
31
|
@processor ||= ExecJS.compile(build_js)
|
30
32
|
end
|
31
33
|
|
32
|
-
# Deprecated method. Use `process` instead.
|
33
|
-
def compile(css)
|
34
|
-
warn 'autoprefixer-rails: Replace compile() to process(). ' +
|
35
|
-
'Method compile() is deprecated and will be removed in 1.1.'
|
36
|
-
processor.call('process', css)['css']
|
37
|
-
end
|
38
|
-
|
39
34
|
private
|
40
35
|
|
41
36
|
# Cache autoprefixer.js content
|
@@ -60,7 +55,8 @@ module AutoprefixerRails
|
|
60
55
|
"var processor = autoprefixer;"
|
61
56
|
else
|
62
57
|
browsers = @browsers.map(&:to_s).join("', '")
|
63
|
-
|
58
|
+
options = @options.map { |k, v| "#{k}: #{v.inspect}"}.join(',')
|
59
|
+
"var processor = autoprefixer('#{browsers}', { #{options} });"
|
64
60
|
end
|
65
61
|
end
|
66
62
|
|
@@ -5,18 +5,19 @@ begin
|
|
5
5
|
class Railtie < ::Rails::Railtie
|
6
6
|
rake_tasks do |app|
|
7
7
|
require 'rake/autoprefixer_tasks'
|
8
|
-
Rake::AutoprefixerTasks.new(
|
8
|
+
Rake::AutoprefixerTasks.new(*config(app))
|
9
9
|
end
|
10
10
|
|
11
11
|
initializer :setup_autoprefixer, group: :all do |app|
|
12
|
-
AutoprefixerRails.install(app.assets,
|
12
|
+
AutoprefixerRails.install(app.assets, *config(app))
|
13
13
|
end
|
14
14
|
|
15
15
|
# Read browsers requirements from application config
|
16
|
-
def
|
17
|
-
file
|
18
|
-
|
19
|
-
|
16
|
+
def config(app)
|
17
|
+
file = app.root.join('config/autoprefixer.yml')
|
18
|
+
options = file.exist? ? YAML.load_file(file).symbolize_keys : { }
|
19
|
+
options = { browsers: nil }.merge(options)
|
20
|
+
[options.delete(:browsers), options]
|
20
21
|
end
|
21
22
|
end
|
22
23
|
end
|
@@ -10,9 +10,10 @@ module Rake
|
|
10
10
|
class AutoprefixerTasks < Rake::TaskLib
|
11
11
|
attr_reader :browsers
|
12
12
|
|
13
|
-
def initialize(browsers = [])
|
14
|
-
@browsers
|
15
|
-
@
|
13
|
+
def initialize(browsers = [], options = {})
|
14
|
+
@browsers = browsers
|
15
|
+
@options = options
|
16
|
+
@processor = AutoprefixerRails.processor(@browsers, @options)
|
16
17
|
define
|
17
18
|
end
|
18
19
|
|
@@ -0,0 +1 @@
|
|
1
|
+
Rails.application.config.assets.css_compressor = nil
|
data/spec/autoprefixer_spec.rb
CHANGED
@@ -12,7 +12,10 @@ describe AutoprefixerRails do
|
|
12
12
|
|
13
13
|
it "process CSS for selected browsers" do
|
14
14
|
result = AutoprefixerRails.process(@css, browsers: ['chrome 25'])
|
15
|
-
result.css.should ==
|
15
|
+
result.css.should == "a {\n" +
|
16
|
+
" -webkit-transition: all 1s;\n" +
|
17
|
+
" transition: all 1s\n" +
|
18
|
+
"}\n"
|
16
19
|
end
|
17
20
|
|
18
21
|
it "generates source map" do
|
@@ -20,6 +23,15 @@ describe AutoprefixerRails do
|
|
20
23
|
result.map.should be_a(String)
|
21
24
|
end
|
22
25
|
|
26
|
+
it "disable visual cascade on request" do
|
27
|
+
css = "a {\n transition: all 1s\n }"
|
28
|
+
result = AutoprefixerRails.process(@css, cascade: false)
|
29
|
+
result.css.should == "a {\n" +
|
30
|
+
" -webkit-transition: all 1s;\n" +
|
31
|
+
" transition: all 1s\n" +
|
32
|
+
"}\n"
|
33
|
+
end
|
34
|
+
|
23
35
|
it "uses file name in syntax errors", not_jruby: true do
|
24
36
|
lambda {
|
25
37
|
AutoprefixerRails.process('a {', from: 'a.css')
|
@@ -40,7 +52,10 @@ describe AutoprefixerRails do
|
|
40
52
|
end
|
41
53
|
|
42
54
|
it "integrates with Sprockets" do
|
43
|
-
@assets['test.css'].to_s.should ==
|
55
|
+
@assets['test.css'].to_s.should == "a {\n" +
|
56
|
+
" -webkit-transition: all 1s;\n" +
|
57
|
+
" transition: all 1s\n" +
|
58
|
+
"}\n"
|
44
59
|
end
|
45
60
|
|
46
61
|
it "shows file name from Sprockets", not_jruby: true do
|
data/spec/rails_spec.rb
CHANGED
@@ -9,7 +9,9 @@ describe CssController, type: :controller do
|
|
9
9
|
it "integrates with Rails and Sass" do
|
10
10
|
get :test, file: 'sass'
|
11
11
|
response.should be_success
|
12
|
-
response.body.should == "a{
|
12
|
+
response.body.should == "a {\n" +
|
13
|
+
" -webkit-transition: all 1s;\n" +
|
14
|
+
" transition: all 1s; }\n"
|
13
15
|
end
|
14
16
|
end
|
15
17
|
|
data/spec/spec_helper.rb
CHANGED
data/vendor/autoprefixer.js
CHANGED
@@ -365,7 +365,7 @@
|
|
365
365
|
|
366
366
|
},{}],3:[function(_dereq_,module,exports){
|
367
367
|
(function() {
|
368
|
-
var Autoprefixer, Browsers, Prefixes, autoprefixer, infoCache, postcss,
|
368
|
+
var Autoprefixer, Browsers, Prefixes, autoprefixer, infoCache, isPlainObject, postcss,
|
369
369
|
__slice = [].slice,
|
370
370
|
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
|
371
371
|
|
@@ -377,19 +377,29 @@
|
|
377
377
|
|
378
378
|
infoCache = null;
|
379
379
|
|
380
|
+
isPlainObject = function(obj) {
|
381
|
+
return Object.prototype.toString.apply(obj) === '[object Object]';
|
382
|
+
};
|
383
|
+
|
380
384
|
autoprefixer = function() {
|
381
|
-
var browsers, prefixes, reqs;
|
385
|
+
var browsers, options, prefixes, reqs;
|
382
386
|
reqs = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
|
383
|
-
if (reqs.length === 1 && reqs[0]
|
384
|
-
|
387
|
+
if (reqs.length === 1 && isPlainObject(reqs[0])) {
|
388
|
+
options = reqs[0];
|
389
|
+
reqs = void 0;
|
385
390
|
} else if (reqs.length === 0 || (reqs.length === 1 && (reqs[0] == null))) {
|
386
391
|
reqs = void 0;
|
392
|
+
} else if (reqs.length <= 2 && (reqs[0] instanceof Array || (reqs[0] == null))) {
|
393
|
+
options = reqs[1];
|
394
|
+
reqs = reqs[0];
|
395
|
+
} else if (typeof reqs[reqs.length - 1] === 'object') {
|
396
|
+
options = reqs.pop();
|
387
397
|
}
|
388
398
|
if (reqs == null) {
|
389
399
|
reqs = autoprefixer["default"];
|
390
400
|
}
|
391
401
|
browsers = new Browsers(autoprefixer.data.browsers, reqs);
|
392
|
-
prefixes = new Prefixes(autoprefixer.data.prefixes, browsers);
|
402
|
+
prefixes = new Prefixes(autoprefixer.data.prefixes, browsers, options);
|
393
403
|
return new Autoprefixer(prefixes, autoprefixer.data);
|
394
404
|
};
|
395
405
|
|
@@ -399,9 +409,10 @@
|
|
399
409
|
};
|
400
410
|
|
401
411
|
Autoprefixer = (function() {
|
402
|
-
function Autoprefixer(prefixes, data) {
|
412
|
+
function Autoprefixer(prefixes, data, options) {
|
403
413
|
this.prefixes = prefixes;
|
404
414
|
this.data = data;
|
415
|
+
this.options = options != null ? options : {};
|
405
416
|
this.postcss = __bind(this.postcss, this);
|
406
417
|
this.browsers = this.prefixes.browsers.selected;
|
407
418
|
}
|
@@ -413,25 +424,6 @@
|
|
413
424
|
return this.processor().process(str, options);
|
414
425
|
};
|
415
426
|
|
416
|
-
Autoprefixer.prototype.compile = function(str, options) {
|
417
|
-
var fixed, name, value;
|
418
|
-
if (options == null) {
|
419
|
-
options = {};
|
420
|
-
}
|
421
|
-
fixed = {};
|
422
|
-
for (name in options) {
|
423
|
-
value = options[name];
|
424
|
-
if (name === 'file') {
|
425
|
-
name = 'from';
|
426
|
-
}
|
427
|
-
fixed[name] = value;
|
428
|
-
}
|
429
|
-
if (typeof console !== "undefined" && console !== null) {
|
430
|
-
console.warn('autoprefixer: replace compile() to process(). ' + 'Method compile() is deprecated and will be removed in 1.1.');
|
431
|
-
}
|
432
|
-
return this.process(str, fixed).css;
|
433
|
-
};
|
434
|
-
|
435
427
|
Autoprefixer.prototype.postcss = function(css) {
|
436
428
|
this.prefixes.processor.remove(css);
|
437
429
|
return this.prefixes.processor.add(css);
|
@@ -482,7 +474,7 @@
|
|
482
474
|
|
483
475
|
}).call(this);
|
484
476
|
|
485
|
-
},{"../data/browsers":1,"../data/prefixes":2,"./browsers":4,"./info":
|
477
|
+
},{"../data/browsers":1,"../data/prefixes":2,"./browsers":4,"./info":30,"./prefixes":35,"postcss":52}],4:[function(_dereq_,module,exports){
|
486
478
|
(function() {
|
487
479
|
var Browsers, utils;
|
488
480
|
|
@@ -508,6 +500,13 @@
|
|
508
500
|
});
|
509
501
|
};
|
510
502
|
|
503
|
+
Browsers.withPrefix = function(value) {
|
504
|
+
if (!this.prefixesRegexp) {
|
505
|
+
this.prefixesRegexp = RegExp("" + (this.prefixes().join('|')));
|
506
|
+
}
|
507
|
+
return this.prefixesRegexp.test(value);
|
508
|
+
};
|
509
|
+
|
511
510
|
function Browsers(data, requirements) {
|
512
511
|
this.data = data;
|
513
512
|
this.selected = this.parse(requirements);
|
@@ -674,9 +673,9 @@
|
|
674
673
|
|
675
674
|
}).call(this);
|
676
675
|
|
677
|
-
},{"../data/browsers":1,"./utils":
|
676
|
+
},{"../data/browsers":1,"./utils":38}],5:[function(_dereq_,module,exports){
|
678
677
|
(function() {
|
679
|
-
var Browsers, Declaration, Prefixer, vendor,
|
678
|
+
var Browsers, Declaration, Prefixer, utils, vendor,
|
680
679
|
__hasProp = {}.hasOwnProperty,
|
681
680
|
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
682
681
|
|
@@ -686,6 +685,8 @@
|
|
686
685
|
|
687
686
|
vendor = _dereq_('postcss/lib/vendor');
|
688
687
|
|
688
|
+
utils = _dereq_('./utils');
|
689
|
+
|
689
690
|
Declaration = (function(_super) {
|
690
691
|
__extends(Declaration, _super);
|
691
692
|
|
@@ -725,15 +726,69 @@
|
|
725
726
|
return decl;
|
726
727
|
};
|
727
728
|
|
728
|
-
Declaration.prototype.
|
729
|
+
Declaration.prototype.needCascade = function(decl) {
|
730
|
+
return decl._autoprefixerCascade || (decl._autoprefixerCascade = !!this.all.options.cascade && decl.before.indexOf("\n") !== -1);
|
731
|
+
};
|
732
|
+
|
733
|
+
Declaration.prototype.maxPrefixed = function(prefixes, decl) {
|
734
|
+
var max, prefix, _i, _len;
|
735
|
+
if (decl._autoprefixerMax) {
|
736
|
+
return decl._autoprefixerMax;
|
737
|
+
}
|
738
|
+
max = 0;
|
739
|
+
for (_i = 0, _len = prefixes.length; _i < _len; _i++) {
|
740
|
+
prefix = prefixes[_i];
|
741
|
+
prefix = utils.removeNote(prefix);
|
742
|
+
if (prefix.length > max) {
|
743
|
+
max = prefix.length;
|
744
|
+
}
|
745
|
+
}
|
746
|
+
return decl._autoprefixerMax = max;
|
747
|
+
};
|
748
|
+
|
749
|
+
Declaration.prototype.calcBefore = function(prefixes, decl, prefix) {
|
750
|
+
var before, diff, i, max, _i;
|
751
|
+
if (prefix == null) {
|
752
|
+
prefix = '';
|
753
|
+
}
|
754
|
+
before = decl.before;
|
755
|
+
max = this.maxPrefixed(prefixes, decl);
|
756
|
+
diff = max - utils.removeNote(prefix).length;
|
757
|
+
for (i = _i = 0; 0 <= diff ? _i < diff : _i > diff; i = 0 <= diff ? ++_i : --_i) {
|
758
|
+
before += ' ';
|
759
|
+
}
|
760
|
+
return before;
|
761
|
+
};
|
762
|
+
|
763
|
+
Declaration.prototype.restoreBefore = function(decl) {
|
764
|
+
var lines, min;
|
765
|
+
lines = decl.before.split("\n");
|
766
|
+
min = lines[lines.length - 1];
|
767
|
+
this.all.group(decl).up(function(prefixed) {
|
768
|
+
var array, last;
|
769
|
+
array = prefixed.before.split("\n");
|
770
|
+
last = array[array.length - 1];
|
771
|
+
if (last.length < min.length) {
|
772
|
+
return min = last;
|
773
|
+
}
|
774
|
+
});
|
775
|
+
lines[lines.length - 1] = min;
|
776
|
+
return decl.before = lines.join("\n");
|
777
|
+
};
|
778
|
+
|
779
|
+
Declaration.prototype.insert = function(decl, prefix, prefixes) {
|
729
780
|
var cloned;
|
730
781
|
cloned = this.set(this.clone(decl), prefix);
|
731
|
-
if (cloned) {
|
732
|
-
return
|
782
|
+
if (!cloned) {
|
783
|
+
return;
|
784
|
+
}
|
785
|
+
if (this.needCascade(decl)) {
|
786
|
+
cloned.before = this.calcBefore(prefixes, decl, prefix);
|
733
787
|
}
|
788
|
+
return decl.parent.insertBefore(decl, cloned);
|
734
789
|
};
|
735
790
|
|
736
|
-
Declaration.prototype.add = function(decl, prefix) {
|
791
|
+
Declaration.prototype.add = function(decl, prefix, prefixes) {
|
737
792
|
var already, prefixed;
|
738
793
|
prefixed = this.prefixed(decl.prop, prefix);
|
739
794
|
already = this.all.group(decl).up(function(i) {
|
@@ -742,7 +797,19 @@
|
|
742
797
|
if (already || this.otherPrefixes(decl.value, prefix)) {
|
743
798
|
return;
|
744
799
|
}
|
745
|
-
return this.insert(decl, prefix);
|
800
|
+
return this.insert(decl, prefix, prefixes);
|
801
|
+
};
|
802
|
+
|
803
|
+
Declaration.prototype.process = function(decl) {
|
804
|
+
var prefixes;
|
805
|
+
if (this.needCascade(decl)) {
|
806
|
+
this.restoreBefore(decl);
|
807
|
+
if (prefixes = Declaration.__super__.process.apply(this, arguments)) {
|
808
|
+
return decl.before = this.calcBefore(prefixes, decl);
|
809
|
+
}
|
810
|
+
} else {
|
811
|
+
return Declaration.__super__.process.apply(this, arguments);
|
812
|
+
}
|
746
813
|
};
|
747
814
|
|
748
815
|
Declaration.prototype.old = function(prop, prefix) {
|
@@ -757,7 +824,7 @@
|
|
757
824
|
|
758
825
|
}).call(this);
|
759
826
|
|
760
|
-
},{"./browsers":4,"./prefixer":
|
827
|
+
},{"./browsers":4,"./prefixer":34,"./utils":38,"postcss/lib/vendor":58}],6:[function(_dereq_,module,exports){
|
761
828
|
(function() {
|
762
829
|
var AlignContent, Declaration, flexSpec,
|
763
830
|
__hasProp = {}.hasOwnProperty,
|
@@ -816,7 +883,7 @@
|
|
816
883
|
|
817
884
|
}).call(this);
|
818
885
|
|
819
|
-
},{"../declaration":5,"./flex-spec":
|
886
|
+
},{"../declaration":5,"./flex-spec":20}],7:[function(_dereq_,module,exports){
|
820
887
|
(function() {
|
821
888
|
var AlignItems, Declaration, flexSpec,
|
822
889
|
__hasProp = {}.hasOwnProperty,
|
@@ -875,7 +942,7 @@
|
|
875
942
|
|
876
943
|
}).call(this);
|
877
944
|
|
878
|
-
},{"../declaration":5,"./flex-spec":
|
945
|
+
},{"../declaration":5,"./flex-spec":20}],8:[function(_dereq_,module,exports){
|
879
946
|
(function() {
|
880
947
|
var AlignSelf, Declaration, flexSpec,
|
881
948
|
__hasProp = {}.hasOwnProperty,
|
@@ -932,7 +999,7 @@
|
|
932
999
|
|
933
1000
|
}).call(this);
|
934
1001
|
|
935
|
-
},{"../declaration":5,"./flex-spec":
|
1002
|
+
},{"../declaration":5,"./flex-spec":20}],9:[function(_dereq_,module,exports){
|
936
1003
|
(function() {
|
937
1004
|
var BorderImage, Declaration,
|
938
1005
|
__hasProp = {}.hasOwnProperty,
|
@@ -1021,6 +1088,62 @@
|
|
1021
1088
|
}).call(this);
|
1022
1089
|
|
1023
1090
|
},{"../declaration":5}],11:[function(_dereq_,module,exports){
|
1091
|
+
(function() {
|
1092
|
+
var BreakInside, Declaration,
|
1093
|
+
__hasProp = {}.hasOwnProperty,
|
1094
|
+
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
1095
|
+
|
1096
|
+
Declaration = _dereq_('../declaration');
|
1097
|
+
|
1098
|
+
BreakInside = (function(_super) {
|
1099
|
+
__extends(BreakInside, _super);
|
1100
|
+
|
1101
|
+
function BreakInside() {
|
1102
|
+
return BreakInside.__super__.constructor.apply(this, arguments);
|
1103
|
+
}
|
1104
|
+
|
1105
|
+
BreakInside.names = ['break-inside', 'page-break-inside', 'column-break-inside'];
|
1106
|
+
|
1107
|
+
BreakInside.prototype.prefixed = function(prop, prefix) {
|
1108
|
+
if (prefix === '-webkit-') {
|
1109
|
+
return prefix + 'column-break-inside';
|
1110
|
+
} else if (prefix === '-moz-') {
|
1111
|
+
return 'page-break-inside';
|
1112
|
+
} else {
|
1113
|
+
return BreakInside.__super__.prefixed.apply(this, arguments);
|
1114
|
+
}
|
1115
|
+
};
|
1116
|
+
|
1117
|
+
BreakInside.prototype.normalize = function() {
|
1118
|
+
return 'break-inside';
|
1119
|
+
};
|
1120
|
+
|
1121
|
+
BreakInside.prototype.set = function(decl, prefix) {
|
1122
|
+
if (decl.value === 'avoid-column' || decl.value === 'avoid-page') {
|
1123
|
+
decl.value = 'avoid';
|
1124
|
+
}
|
1125
|
+
return BreakInside.__super__.set.apply(this, arguments);
|
1126
|
+
};
|
1127
|
+
|
1128
|
+
BreakInside.prototype.insert = function(decl, prefix, prefixes) {
|
1129
|
+
if (decl.value === 'avoid-region') {
|
1130
|
+
|
1131
|
+
} else if (decl.value === 'avoid-page' && prefix === '-webkit-') {
|
1132
|
+
|
1133
|
+
} else {
|
1134
|
+
return BreakInside.__super__.insert.apply(this, arguments);
|
1135
|
+
}
|
1136
|
+
};
|
1137
|
+
|
1138
|
+
return BreakInside;
|
1139
|
+
|
1140
|
+
})(Declaration);
|
1141
|
+
|
1142
|
+
module.exports = BreakInside;
|
1143
|
+
|
1144
|
+
}).call(this);
|
1145
|
+
|
1146
|
+
},{"../declaration":5}],12:[function(_dereq_,module,exports){
|
1024
1147
|
(function() {
|
1025
1148
|
var DisplayFlex, OldDisplayFlex, OldValue, Value, flexSpec,
|
1026
1149
|
__hasProp = {}.hasOwnProperty,
|
@@ -1092,7 +1215,7 @@
|
|
1092
1215
|
|
1093
1216
|
}).call(this);
|
1094
1217
|
|
1095
|
-
},{"../old-value":
|
1218
|
+
},{"../old-value":33,"../value":39,"./flex-spec":20}],13:[function(_dereq_,module,exports){
|
1096
1219
|
(function() {
|
1097
1220
|
var FillAvailable, OldValue, Value,
|
1098
1221
|
__hasProp = {}.hasOwnProperty,
|
@@ -1135,7 +1258,7 @@
|
|
1135
1258
|
|
1136
1259
|
}).call(this);
|
1137
1260
|
|
1138
|
-
},{"../old-value":
|
1261
|
+
},{"../old-value":33,"../value":39}],14:[function(_dereq_,module,exports){
|
1139
1262
|
(function() {
|
1140
1263
|
var Declaration, Filter,
|
1141
1264
|
__hasProp = {}.hasOwnProperty,
|
@@ -1166,7 +1289,7 @@
|
|
1166
1289
|
|
1167
1290
|
}).call(this);
|
1168
1291
|
|
1169
|
-
},{"../declaration":5}],
|
1292
|
+
},{"../declaration":5}],15:[function(_dereq_,module,exports){
|
1170
1293
|
(function() {
|
1171
1294
|
var Declaration, FlexBasis, flexSpec,
|
1172
1295
|
__hasProp = {}.hasOwnProperty,
|
@@ -1183,17 +1306,17 @@
|
|
1183
1306
|
return FlexBasis.__super__.constructor.apply(this, arguments);
|
1184
1307
|
}
|
1185
1308
|
|
1186
|
-
FlexBasis.names = ['flex-basis'];
|
1309
|
+
FlexBasis.names = ['flex-basis', 'flex-preferred-size'];
|
1187
1310
|
|
1188
1311
|
FlexBasis.prototype.normalize = function() {
|
1189
|
-
return 'flex';
|
1312
|
+
return 'flex-basis';
|
1190
1313
|
};
|
1191
1314
|
|
1192
1315
|
FlexBasis.prototype.prefixed = function(prop, prefix) {
|
1193
1316
|
var spec, _ref;
|
1194
1317
|
_ref = flexSpec(prefix), spec = _ref[0], prefix = _ref[1];
|
1195
1318
|
if (spec === 2012) {
|
1196
|
-
return prefix + 'flex';
|
1319
|
+
return prefix + 'flex-preferred-size';
|
1197
1320
|
} else {
|
1198
1321
|
return FlexBasis.__super__.prefixed.apply(this, arguments);
|
1199
1322
|
}
|
@@ -1202,11 +1325,7 @@
|
|
1202
1325
|
FlexBasis.prototype.set = function(decl, prefix) {
|
1203
1326
|
var spec, _ref;
|
1204
1327
|
_ref = flexSpec(prefix), spec = _ref[0], prefix = _ref[1];
|
1205
|
-
if (spec === 2012) {
|
1206
|
-
decl.prop = prefix + 'flex';
|
1207
|
-
decl.value = '0 1 ' + decl.value;
|
1208
|
-
return decl;
|
1209
|
-
} else if (spec === 'final') {
|
1328
|
+
if (spec === 2012 || spec === 'final') {
|
1210
1329
|
return FlexBasis.__super__.set.apply(this, arguments);
|
1211
1330
|
}
|
1212
1331
|
};
|
@@ -1219,7 +1338,7 @@
|
|
1219
1338
|
|
1220
1339
|
}).call(this);
|
1221
1340
|
|
1222
|
-
},{"../declaration":5,"./flex-spec":
|
1341
|
+
},{"../declaration":5,"./flex-spec":20}],16:[function(_dereq_,module,exports){
|
1223
1342
|
(function() {
|
1224
1343
|
var Declaration, FlexDirection, flexSpec,
|
1225
1344
|
__hasProp = {}.hasOwnProperty,
|
@@ -1242,7 +1361,7 @@
|
|
1242
1361
|
return 'flex-direction';
|
1243
1362
|
};
|
1244
1363
|
|
1245
|
-
FlexDirection.prototype.insert = function(decl, prefix) {
|
1364
|
+
FlexDirection.prototype.insert = function(decl, prefix, prefixes) {
|
1246
1365
|
var already, cloned, dir, orient, spec, value, _ref;
|
1247
1366
|
_ref = flexSpec(prefix), spec = _ref[0], prefix = _ref[1];
|
1248
1367
|
if (spec === 2009) {
|
@@ -1258,10 +1377,16 @@
|
|
1258
1377
|
cloned = this.clone(decl);
|
1259
1378
|
cloned.prop = prefix + 'box-orient';
|
1260
1379
|
cloned.value = orient;
|
1380
|
+
if (this.needCascade(decl)) {
|
1381
|
+
cloned.before = this.calcBefore(prefixes, decl, prefix);
|
1382
|
+
}
|
1261
1383
|
decl.parent.insertBefore(decl, cloned);
|
1262
1384
|
cloned = this.clone(decl);
|
1263
1385
|
cloned.prop = prefix + 'box-direction';
|
1264
1386
|
cloned.value = dir;
|
1387
|
+
if (this.needCascade(decl)) {
|
1388
|
+
cloned.before = this.calcBefore(prefixes, decl, prefix);
|
1389
|
+
}
|
1265
1390
|
return decl.parent.insertBefore(decl, cloned);
|
1266
1391
|
} else {
|
1267
1392
|
return FlexDirection.__super__.insert.apply(this, arguments);
|
@@ -1286,7 +1411,7 @@
|
|
1286
1411
|
|
1287
1412
|
}).call(this);
|
1288
1413
|
|
1289
|
-
},{"../declaration":5,"./flex-spec":
|
1414
|
+
},{"../declaration":5,"./flex-spec":20}],17:[function(_dereq_,module,exports){
|
1290
1415
|
(function() {
|
1291
1416
|
var Declaration, FlexFlow, flexSpec,
|
1292
1417
|
__hasProp = {}.hasOwnProperty,
|
@@ -1323,7 +1448,7 @@
|
|
1323
1448
|
|
1324
1449
|
}).call(this);
|
1325
1450
|
|
1326
|
-
},{"../declaration":5,"./flex-spec":
|
1451
|
+
},{"../declaration":5,"./flex-spec":20}],18:[function(_dereq_,module,exports){
|
1327
1452
|
(function() {
|
1328
1453
|
var Declaration, Flex, flexSpec,
|
1329
1454
|
__hasProp = {}.hasOwnProperty,
|
@@ -1340,7 +1465,7 @@
|
|
1340
1465
|
return Flex.__super__.constructor.apply(this, arguments);
|
1341
1466
|
}
|
1342
1467
|
|
1343
|
-
Flex.names = ['flex-grow'];
|
1468
|
+
Flex.names = ['flex-grow', 'flex-positive'];
|
1344
1469
|
|
1345
1470
|
Flex.prototype.normalize = function() {
|
1346
1471
|
return 'flex';
|
@@ -1352,7 +1477,7 @@
|
|
1352
1477
|
if (spec === 2009) {
|
1353
1478
|
return prefix + 'box-flex';
|
1354
1479
|
} else if (spec === 2012) {
|
1355
|
-
return prefix + 'flex';
|
1480
|
+
return prefix + 'flex-positive';
|
1356
1481
|
} else {
|
1357
1482
|
return Flex.__super__.prefixed.apply(this, arguments);
|
1358
1483
|
}
|
@@ -1366,7 +1491,7 @@
|
|
1366
1491
|
|
1367
1492
|
}).call(this);
|
1368
1493
|
|
1369
|
-
},{"../declaration":5,"./flex-spec":
|
1494
|
+
},{"../declaration":5,"./flex-spec":20}],19:[function(_dereq_,module,exports){
|
1370
1495
|
(function() {
|
1371
1496
|
var Declaration, FlexShrink, flexSpec,
|
1372
1497
|
__hasProp = {}.hasOwnProperty,
|
@@ -1383,17 +1508,17 @@
|
|
1383
1508
|
return FlexShrink.__super__.constructor.apply(this, arguments);
|
1384
1509
|
}
|
1385
1510
|
|
1386
|
-
FlexShrink.names = ['flex-shrink'];
|
1511
|
+
FlexShrink.names = ['flex-shrink', 'flex-negative'];
|
1387
1512
|
|
1388
1513
|
FlexShrink.prototype.normalize = function() {
|
1389
|
-
return 'flex';
|
1514
|
+
return 'flex-shrink';
|
1390
1515
|
};
|
1391
1516
|
|
1392
1517
|
FlexShrink.prototype.prefixed = function(prop, prefix) {
|
1393
1518
|
var spec, _ref;
|
1394
1519
|
_ref = flexSpec(prefix), spec = _ref[0], prefix = _ref[1];
|
1395
1520
|
if (spec === 2012) {
|
1396
|
-
return prefix + 'flex';
|
1521
|
+
return prefix + 'flex-negative';
|
1397
1522
|
} else {
|
1398
1523
|
return FlexShrink.__super__.prefixed.apply(this, arguments);
|
1399
1524
|
}
|
@@ -1402,11 +1527,7 @@
|
|
1402
1527
|
FlexShrink.prototype.set = function(decl, prefix) {
|
1403
1528
|
var spec, _ref;
|
1404
1529
|
_ref = flexSpec(prefix), spec = _ref[0], prefix = _ref[1];
|
1405
|
-
if (spec === 2012) {
|
1406
|
-
decl.prop = prefix + 'flex';
|
1407
|
-
decl.value = '0 ' + decl.value;
|
1408
|
-
return decl;
|
1409
|
-
} else if (spec === 'final') {
|
1530
|
+
if (spec === 2012 || spec === 'final') {
|
1410
1531
|
return FlexShrink.__super__.set.apply(this, arguments);
|
1411
1532
|
}
|
1412
1533
|
};
|
@@ -1419,7 +1540,7 @@
|
|
1419
1540
|
|
1420
1541
|
}).call(this);
|
1421
1542
|
|
1422
|
-
},{"../declaration":5,"./flex-spec":
|
1543
|
+
},{"../declaration":5,"./flex-spec":20}],20:[function(_dereq_,module,exports){
|
1423
1544
|
(function() {
|
1424
1545
|
module.exports = function(prefix) {
|
1425
1546
|
var spec;
|
@@ -1432,7 +1553,7 @@
|
|
1432
1553
|
|
1433
1554
|
}).call(this);
|
1434
1555
|
|
1435
|
-
},{}],
|
1556
|
+
},{}],21:[function(_dereq_,module,exports){
|
1436
1557
|
(function() {
|
1437
1558
|
var Declaration, FlexWrap, flexSpec,
|
1438
1559
|
__hasProp = {}.hasOwnProperty,
|
@@ -1467,7 +1588,7 @@
|
|
1467
1588
|
|
1468
1589
|
}).call(this);
|
1469
1590
|
|
1470
|
-
},{"../declaration":5,"./flex-spec":
|
1591
|
+
},{"../declaration":5,"./flex-spec":20}],22:[function(_dereq_,module,exports){
|
1471
1592
|
(function() {
|
1472
1593
|
var Declaration, Flex, flexSpec,
|
1473
1594
|
__hasProp = {}.hasOwnProperty,
|
@@ -1486,6 +1607,11 @@
|
|
1486
1607
|
|
1487
1608
|
Flex.names = ['flex', 'box-flex'];
|
1488
1609
|
|
1610
|
+
Flex.oldValues = {
|
1611
|
+
'auto': '1',
|
1612
|
+
'none': '0'
|
1613
|
+
};
|
1614
|
+
|
1489
1615
|
Flex.prototype.prefixed = function(prop, prefix) {
|
1490
1616
|
var spec, _ref;
|
1491
1617
|
_ref = flexSpec(prefix), spec = _ref[0], prefix = _ref[1];
|
@@ -1496,7 +1622,7 @@
|
|
1496
1622
|
}
|
1497
1623
|
};
|
1498
1624
|
|
1499
|
-
Flex.prototype.normalize = function(
|
1625
|
+
Flex.prototype.normalize = function() {
|
1500
1626
|
return 'flex';
|
1501
1627
|
};
|
1502
1628
|
|
@@ -1505,6 +1631,7 @@
|
|
1505
1631
|
spec = flexSpec(prefix)[0];
|
1506
1632
|
if (spec === 2009) {
|
1507
1633
|
decl.value = decl.value.split(' ')[0];
|
1634
|
+
decl.value = Flex.oldValues[decl.value] || decl.value;
|
1508
1635
|
return Flex.__super__.set.call(this, decl, prefix);
|
1509
1636
|
} else {
|
1510
1637
|
return Flex.__super__.set.apply(this, arguments);
|
@@ -1519,7 +1646,7 @@
|
|
1519
1646
|
|
1520
1647
|
}).call(this);
|
1521
1648
|
|
1522
|
-
},{"../declaration":5,"./flex-spec":
|
1649
|
+
},{"../declaration":5,"./flex-spec":20}],23:[function(_dereq_,module,exports){
|
1523
1650
|
(function() {
|
1524
1651
|
var Fullscreen, Selector,
|
1525
1652
|
__hasProp = {}.hasOwnProperty,
|
@@ -1554,7 +1681,7 @@
|
|
1554
1681
|
|
1555
1682
|
}).call(this);
|
1556
1683
|
|
1557
|
-
},{"../selector":
|
1684
|
+
},{"../selector":37}],24:[function(_dereq_,module,exports){
|
1558
1685
|
(function() {
|
1559
1686
|
var Gradient, OldValue, Value, isDirection, list, utils,
|
1560
1687
|
__hasProp = {}.hasOwnProperty,
|
@@ -1769,7 +1896,7 @@
|
|
1769
1896
|
|
1770
1897
|
}).call(this);
|
1771
1898
|
|
1772
|
-
},{"../old-value":
|
1899
|
+
},{"../old-value":33,"../utils":38,"../value":39,"postcss/lib/list":48}],25:[function(_dereq_,module,exports){
|
1773
1900
|
(function() {
|
1774
1901
|
var Declaration, JustifyContent, flexSpec,
|
1775
1902
|
__hasProp = {}.hasOwnProperty,
|
@@ -1833,7 +1960,7 @@
|
|
1833
1960
|
|
1834
1961
|
}).call(this);
|
1835
1962
|
|
1836
|
-
},{"../declaration":5,"./flex-spec":
|
1963
|
+
},{"../declaration":5,"./flex-spec":20}],26:[function(_dereq_,module,exports){
|
1837
1964
|
(function() {
|
1838
1965
|
var Declaration, Order, flexSpec,
|
1839
1966
|
__hasProp = {}.hasOwnProperty,
|
@@ -1887,7 +2014,7 @@
|
|
1887
2014
|
|
1888
2015
|
}).call(this);
|
1889
2016
|
|
1890
|
-
},{"../declaration":5,"./flex-spec":
|
2017
|
+
},{"../declaration":5,"./flex-spec":20}],27:[function(_dereq_,module,exports){
|
1891
2018
|
(function() {
|
1892
2019
|
var Placeholder, Selector,
|
1893
2020
|
__hasProp = {}.hasOwnProperty,
|
@@ -1904,6 +2031,10 @@
|
|
1904
2031
|
|
1905
2032
|
Placeholder.names = ['::placeholder'];
|
1906
2033
|
|
2034
|
+
Placeholder.prototype.possible = function() {
|
2035
|
+
return Placeholder.__super__.possible.apply(this, arguments).concat('-moz- old');
|
2036
|
+
};
|
2037
|
+
|
1907
2038
|
Placeholder.prototype.prefixed = function(prefix) {
|
1908
2039
|
if ('-webkit-' === prefix) {
|
1909
2040
|
return '::-webkit-input-placeholder';
|
@@ -1924,7 +2055,7 @@
|
|
1924
2055
|
|
1925
2056
|
}).call(this);
|
1926
2057
|
|
1927
|
-
},{"../selector":
|
2058
|
+
},{"../selector":37}],28:[function(_dereq_,module,exports){
|
1928
2059
|
(function() {
|
1929
2060
|
var Transform, Value,
|
1930
2061
|
__hasProp = {}.hasOwnProperty,
|
@@ -1957,7 +2088,7 @@
|
|
1957
2088
|
|
1958
2089
|
}).call(this);
|
1959
2090
|
|
1960
|
-
},{"../value":
|
2091
|
+
},{"../value":39}],29:[function(_dereq_,module,exports){
|
1961
2092
|
(function() {
|
1962
2093
|
var OldValue, Transition, Value,
|
1963
2094
|
__hasProp = {}.hasOwnProperty,
|
@@ -1996,7 +2127,7 @@
|
|
1996
2127
|
|
1997
2128
|
}).call(this);
|
1998
2129
|
|
1999
|
-
},{"../old-value":
|
2130
|
+
},{"../old-value":33,"../value":39}],30:[function(_dereq_,module,exports){
|
2000
2131
|
(function() {
|
2001
2132
|
var capitalize, names, prefix;
|
2002
2133
|
|
@@ -2112,7 +2243,7 @@
|
|
2112
2243
|
|
2113
2244
|
}).call(this);
|
2114
2245
|
|
2115
|
-
},{}],
|
2246
|
+
},{}],31:[function(_dereq_,module,exports){
|
2116
2247
|
(function() {
|
2117
2248
|
var Keyframes, Prefixer,
|
2118
2249
|
__hasProp = {}.hasOwnProperty,
|
@@ -2154,7 +2285,77 @@
|
|
2154
2285
|
|
2155
2286
|
}).call(this);
|
2156
2287
|
|
2157
|
-
},{"./prefixer":
|
2288
|
+
},{"./prefixer":34}],32:[function(_dereq_,module,exports){
|
2289
|
+
(function() {
|
2290
|
+
var OldSelector;
|
2291
|
+
|
2292
|
+
OldSelector = (function() {
|
2293
|
+
function OldSelector(selector, prefix) {
|
2294
|
+
var _i, _len, _ref;
|
2295
|
+
this.prefix = prefix;
|
2296
|
+
this.prefixed = selector.prefixed(this.prefix);
|
2297
|
+
this.regexp = selector.regexp(this.prefix);
|
2298
|
+
this.prefixeds = [];
|
2299
|
+
_ref = selector.possible();
|
2300
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
2301
|
+
prefix = _ref[_i];
|
2302
|
+
this.prefixeds.push([selector.prefixed(prefix), selector.regexp(prefix)]);
|
2303
|
+
}
|
2304
|
+
this.unprefixed = selector.name;
|
2305
|
+
this.nameRegexp = selector.regexp();
|
2306
|
+
}
|
2307
|
+
|
2308
|
+
OldSelector.prototype.isHack = function(rule) {
|
2309
|
+
var before, index, regexp, rules, some, string, _i, _len, _ref, _ref1;
|
2310
|
+
index = rule.parent.index(rule) + 1;
|
2311
|
+
rules = rule.parent.rules;
|
2312
|
+
while (index < rules.length) {
|
2313
|
+
before = rules[index].selector;
|
2314
|
+
if (!before) {
|
2315
|
+
return true;
|
2316
|
+
}
|
2317
|
+
if (before.indexOf(this.unprefixed) !== -1 && before.match(this.nameRegexp)) {
|
2318
|
+
return false;
|
2319
|
+
}
|
2320
|
+
some = false;
|
2321
|
+
_ref = this.prefixeds;
|
2322
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
2323
|
+
_ref1 = _ref[_i], string = _ref1[0], regexp = _ref1[1];
|
2324
|
+
if (before.indexOf(string) !== -1 && before.match(regexp)) {
|
2325
|
+
some = true;
|
2326
|
+
break;
|
2327
|
+
}
|
2328
|
+
}
|
2329
|
+
if (!some) {
|
2330
|
+
return true;
|
2331
|
+
}
|
2332
|
+
index += 1;
|
2333
|
+
}
|
2334
|
+
return true;
|
2335
|
+
};
|
2336
|
+
|
2337
|
+
OldSelector.prototype.check = function(rule) {
|
2338
|
+
if (rule.selector.indexOf(this.prefixed) === -1) {
|
2339
|
+
return false;
|
2340
|
+
}
|
2341
|
+
if (!rule.selector.match(this.regexp)) {
|
2342
|
+
return false;
|
2343
|
+
}
|
2344
|
+
if (this.isHack(rule)) {
|
2345
|
+
return false;
|
2346
|
+
}
|
2347
|
+
return true;
|
2348
|
+
};
|
2349
|
+
|
2350
|
+
return OldSelector;
|
2351
|
+
|
2352
|
+
})();
|
2353
|
+
|
2354
|
+
module.exports = OldSelector;
|
2355
|
+
|
2356
|
+
}).call(this);
|
2357
|
+
|
2358
|
+
},{}],33:[function(_dereq_,module,exports){
|
2158
2359
|
(function() {
|
2159
2360
|
var OldValue, utils;
|
2160
2361
|
|
@@ -2185,7 +2386,7 @@
|
|
2185
2386
|
|
2186
2387
|
}).call(this);
|
2187
2388
|
|
2188
|
-
},{"./utils":
|
2389
|
+
},{"./utils":38}],34:[function(_dereq_,module,exports){
|
2189
2390
|
(function() {
|
2190
2391
|
var Browsers, Prefixer, utils, vendor;
|
2191
2392
|
|
@@ -2242,21 +2443,25 @@
|
|
2242
2443
|
};
|
2243
2444
|
|
2244
2445
|
Prefixer.prototype.process = function(node) {
|
2245
|
-
var parent, prefix, _i, _len,
|
2446
|
+
var parent, prefix, prefixes, _i, _j, _len, _len1, _ref;
|
2246
2447
|
if (!this.check(node)) {
|
2247
2448
|
return;
|
2248
2449
|
}
|
2249
2450
|
parent = this.parentPrefix(node);
|
2451
|
+
prefixes = [];
|
2250
2452
|
_ref = this.prefixes;
|
2251
|
-
_results = [];
|
2252
2453
|
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
2253
2454
|
prefix = _ref[_i];
|
2254
2455
|
if (parent && parent !== utils.removeNote(prefix)) {
|
2255
2456
|
continue;
|
2256
2457
|
}
|
2257
|
-
|
2458
|
+
prefixes.push(prefix);
|
2258
2459
|
}
|
2259
|
-
|
2460
|
+
for (_j = 0, _len1 = prefixes.length; _j < _len1; _j++) {
|
2461
|
+
prefix = prefixes[_j];
|
2462
|
+
this.add(node, prefix, prefixes);
|
2463
|
+
}
|
2464
|
+
return prefixes;
|
2260
2465
|
};
|
2261
2466
|
|
2262
2467
|
Prefixer.prototype.clone = function(node, overrides) {
|
@@ -2271,20 +2476,22 @@
|
|
2271
2476
|
|
2272
2477
|
}).call(this);
|
2273
2478
|
|
2274
|
-
},{"./browsers":4,"./utils":
|
2479
|
+
},{"./browsers":4,"./utils":38,"postcss/lib/vendor":58}],35:[function(_dereq_,module,exports){
|
2275
2480
|
(function() {
|
2276
|
-
var Declaration, Keyframes, Prefixes, Processor, Selector, Value, declsCache, utils, vendor;
|
2481
|
+
var Browsers, Declaration, Keyframes, Prefixes, Processor, Selector, Value, declsCache, utils, vendor;
|
2277
2482
|
|
2278
2483
|
utils = _dereq_('./utils');
|
2279
2484
|
|
2280
2485
|
vendor = _dereq_('postcss/lib/vendor');
|
2281
2486
|
|
2282
|
-
Processor = _dereq_('./processor');
|
2283
|
-
|
2284
2487
|
Declaration = _dereq_('./declaration');
|
2285
2488
|
|
2489
|
+
Processor = _dereq_('./processor');
|
2490
|
+
|
2286
2491
|
Keyframes = _dereq_('./keyframes');
|
2287
2492
|
|
2493
|
+
Browsers = _dereq_('./browsers');
|
2494
|
+
|
2288
2495
|
Selector = _dereq_('./selector');
|
2289
2496
|
|
2290
2497
|
Value = _dereq_('./value');
|
@@ -2313,6 +2520,8 @@
|
|
2313
2520
|
|
2314
2521
|
Declaration.hack(_dereq_('./hacks/flex-shrink'));
|
2315
2522
|
|
2523
|
+
Declaration.hack(_dereq_('./hacks/break-inside'));
|
2524
|
+
|
2316
2525
|
Declaration.hack(_dereq_('./hacks/border-image'));
|
2317
2526
|
|
2318
2527
|
Declaration.hack(_dereq_('./hacks/align-content'));
|
@@ -2336,10 +2545,11 @@
|
|
2336
2545
|
declsCache = {};
|
2337
2546
|
|
2338
2547
|
Prefixes = (function() {
|
2339
|
-
function Prefixes(data, browsers) {
|
2548
|
+
function Prefixes(data, browsers, options) {
|
2340
2549
|
var _ref;
|
2341
2550
|
this.data = data;
|
2342
2551
|
this.browsers = browsers;
|
2552
|
+
this.options = options != null ? options : {};
|
2343
2553
|
_ref = this.preprocess(this.select(this.data)), this.add = _ref[0], this.remove = _ref[1];
|
2344
2554
|
this.processor = new Processor(this);
|
2345
2555
|
}
|
@@ -2466,7 +2676,7 @@
|
|
2466
2676
|
selector = Selector.load(name, prefixes);
|
2467
2677
|
for (_j = 0, _len1 = prefixes.length; _j < _len1; _j++) {
|
2468
2678
|
prefix = prefixes[_j];
|
2469
|
-
remove.selectors.push(selector.
|
2679
|
+
remove.selectors.push(selector.old(prefix));
|
2470
2680
|
}
|
2471
2681
|
} else if (name[0] === '@') {
|
2472
2682
|
for (_k = 0, _len2 = prefixes.length; _k < _len2; _k++) {
|
@@ -2560,10 +2770,22 @@
|
|
2560
2770
|
index += step;
|
2561
2771
|
while (index >= 0 && index < length) {
|
2562
2772
|
other = rule.decls[index];
|
2563
|
-
if (
|
2564
|
-
|
2565
|
-
|
2566
|
-
|
2773
|
+
if (other.type === 'decl') {
|
2774
|
+
if (step === -1 && other.prop === unprefixed) {
|
2775
|
+
if (!Browsers.withPrefix(other.value)) {
|
2776
|
+
break;
|
2777
|
+
}
|
2778
|
+
}
|
2779
|
+
if (_this.unprefixed(other.prop) !== unprefixed) {
|
2780
|
+
break;
|
2781
|
+
} else if (callback(other) === true) {
|
2782
|
+
return true;
|
2783
|
+
}
|
2784
|
+
if (step === +1 && other.prop === unprefixed) {
|
2785
|
+
if (!Browsers.withPrefix(other.value)) {
|
2786
|
+
break;
|
2787
|
+
}
|
2788
|
+
}
|
2567
2789
|
}
|
2568
2790
|
index += step;
|
2569
2791
|
}
|
@@ -2588,7 +2810,7 @@
|
|
2588
2810
|
|
2589
2811
|
}).call(this);
|
2590
2812
|
|
2591
|
-
},{"./declaration":5,"./hacks/align-content":6,"./hacks/align-items":7,"./hacks/align-self":8,"./hacks/border-image":9,"./hacks/border-radius":10,"./hacks/display-flex":
|
2813
|
+
},{"./browsers":4,"./declaration":5,"./hacks/align-content":6,"./hacks/align-items":7,"./hacks/align-self":8,"./hacks/border-image":9,"./hacks/border-radius":10,"./hacks/break-inside":11,"./hacks/display-flex":12,"./hacks/fill-available":13,"./hacks/filter":14,"./hacks/flex":22,"./hacks/flex-basis":15,"./hacks/flex-direction":16,"./hacks/flex-flow":17,"./hacks/flex-grow":18,"./hacks/flex-shrink":19,"./hacks/flex-wrap":21,"./hacks/fullscreen":23,"./hacks/gradient":24,"./hacks/justify-content":25,"./hacks/order":26,"./hacks/placeholder":27,"./hacks/transform":28,"./hacks/transition":29,"./keyframes":31,"./processor":36,"./selector":37,"./utils":38,"./value":39,"postcss/lib/vendor":58}],36:[function(_dereq_,module,exports){
|
2592
2814
|
(function() {
|
2593
2815
|
var Processor, Value, utils, vendor;
|
2594
2816
|
|
@@ -2655,7 +2877,7 @@
|
|
2655
2877
|
checker = _ref[_i];
|
2656
2878
|
css.eachRule((function(_this) {
|
2657
2879
|
return function(rule, i) {
|
2658
|
-
if (checker(rule)) {
|
2880
|
+
if (checker.check(rule)) {
|
2659
2881
|
return rule.parent.remove(i);
|
2660
2882
|
}
|
2661
2883
|
};
|
@@ -2695,14 +2917,18 @@
|
|
2695
2917
|
|
2696
2918
|
}).call(this);
|
2697
2919
|
|
2698
|
-
},{"./utils":
|
2920
|
+
},{"./utils":38,"./value":39,"postcss/lib/vendor":58}],37:[function(_dereq_,module,exports){
|
2699
2921
|
(function() {
|
2700
|
-
var Prefixer, Selector, utils,
|
2922
|
+
var Browsers, OldSelector, Prefixer, Selector, utils,
|
2701
2923
|
__hasProp = {}.hasOwnProperty,
|
2702
2924
|
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
2703
2925
|
|
2926
|
+
OldSelector = _dereq_('./old-selector');
|
2927
|
+
|
2704
2928
|
Prefixer = _dereq_('./prefixer');
|
2705
2929
|
|
2930
|
+
Browsers = _dereq_('./browsers');
|
2931
|
+
|
2706
2932
|
utils = _dereq_('./utils');
|
2707
2933
|
|
2708
2934
|
Selector = (function(_super) {
|
@@ -2715,24 +2941,14 @@
|
|
2715
2941
|
this.regexpCache = {};
|
2716
2942
|
}
|
2717
2943
|
|
2718
|
-
Selector.prototype.check = function(rule
|
2719
|
-
|
2720
|
-
|
2721
|
-
if (rule.selector.indexOf(name) !== -1) {
|
2722
|
-
return !!rule.selector.match(this.regexp(prefix));
|
2944
|
+
Selector.prototype.check = function(rule) {
|
2945
|
+
if (rule.selector.indexOf(this.name) !== -1) {
|
2946
|
+
return !!rule.selector.match(this.regexp());
|
2723
2947
|
} else {
|
2724
2948
|
return false;
|
2725
2949
|
}
|
2726
2950
|
};
|
2727
2951
|
|
2728
|
-
Selector.prototype.checker = function(prefix) {
|
2729
|
-
return (function(_this) {
|
2730
|
-
return function(rule) {
|
2731
|
-
return _this.check(rule, prefix);
|
2732
|
-
};
|
2733
|
-
})(this);
|
2734
|
-
};
|
2735
|
-
|
2736
2952
|
Selector.prototype.prefixed = function(prefix) {
|
2737
2953
|
return this.name.replace(/^([^\w]*)/, '$1' + prefix);
|
2738
2954
|
};
|
@@ -2743,7 +2959,53 @@
|
|
2743
2959
|
return this.regexpCache[prefix];
|
2744
2960
|
}
|
2745
2961
|
name = prefix ? this.prefixed(prefix) : this.name;
|
2746
|
-
return this.regexpCache = RegExp("(^|[^:\"'=])" + (utils.escapeRegexp(name)), "gi");
|
2962
|
+
return this.regexpCache[prefix] = RegExp("(^|[^:\"'=])" + (utils.escapeRegexp(name)), "gi");
|
2963
|
+
};
|
2964
|
+
|
2965
|
+
Selector.prototype.possible = function() {
|
2966
|
+
return Browsers.prefixes();
|
2967
|
+
};
|
2968
|
+
|
2969
|
+
Selector.prototype.prefixeds = function(rule) {
|
2970
|
+
var prefix, prefixeds, _i, _len, _ref;
|
2971
|
+
if (rule._autoprefixerPrefixeds) {
|
2972
|
+
return rule._autoprefixerPrefixeds;
|
2973
|
+
}
|
2974
|
+
prefixeds = {};
|
2975
|
+
_ref = this.possible();
|
2976
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
2977
|
+
prefix = _ref[_i];
|
2978
|
+
prefixeds[prefix] = this.replace(rule.selector, prefix);
|
2979
|
+
}
|
2980
|
+
return rule._autoprefixerPrefixeds = prefixeds;
|
2981
|
+
};
|
2982
|
+
|
2983
|
+
Selector.prototype.already = function(rule, prefixeds, prefix) {
|
2984
|
+
var before, index, key, prefixed, some;
|
2985
|
+
index = rule.parent.index(rule) - 1;
|
2986
|
+
while (index >= 0) {
|
2987
|
+
before = rule.parent.rules[index];
|
2988
|
+
if (before.type !== 'rule') {
|
2989
|
+
return false;
|
2990
|
+
}
|
2991
|
+
some = false;
|
2992
|
+
for (key in prefixeds) {
|
2993
|
+
prefixed = prefixeds[key];
|
2994
|
+
if (before.selector === prefixed) {
|
2995
|
+
if (prefix === key) {
|
2996
|
+
return true;
|
2997
|
+
} else {
|
2998
|
+
some = true;
|
2999
|
+
break;
|
3000
|
+
}
|
3001
|
+
}
|
3002
|
+
}
|
3003
|
+
if (!some) {
|
3004
|
+
return false;
|
3005
|
+
}
|
3006
|
+
index -= 1;
|
3007
|
+
}
|
3008
|
+
return false;
|
2747
3009
|
};
|
2748
3010
|
|
2749
3011
|
Selector.prototype.replace = function(selector, prefix) {
|
@@ -2751,19 +3013,21 @@
|
|
2751
3013
|
};
|
2752
3014
|
|
2753
3015
|
Selector.prototype.add = function(rule, prefix) {
|
2754
|
-
var cloned,
|
2755
|
-
|
2756
|
-
if (
|
2757
|
-
return i.selector === prefixed;
|
2758
|
-
})) {
|
3016
|
+
var cloned, prefixeds;
|
3017
|
+
prefixeds = this.prefixeds(rule);
|
3018
|
+
if (this.already(rule, prefixeds, prefix)) {
|
2759
3019
|
return;
|
2760
3020
|
}
|
2761
3021
|
cloned = this.clone(rule, {
|
2762
|
-
selector:
|
3022
|
+
selector: prefixeds[prefix]
|
2763
3023
|
});
|
2764
3024
|
return rule.parent.insertBefore(rule, cloned);
|
2765
3025
|
};
|
2766
3026
|
|
3027
|
+
Selector.prototype.old = function(prefix) {
|
3028
|
+
return new OldSelector(this, prefix);
|
3029
|
+
};
|
3030
|
+
|
2767
3031
|
return Selector;
|
2768
3032
|
|
2769
3033
|
})(Prefixer);
|
@@ -2772,7 +3036,7 @@
|
|
2772
3036
|
|
2773
3037
|
}).call(this);
|
2774
3038
|
|
2775
|
-
},{"./
|
3039
|
+
},{"./browsers":4,"./old-selector":32,"./prefixer":34,"./utils":38}],38:[function(_dereq_,module,exports){
|
2776
3040
|
(function() {
|
2777
3041
|
module.exports = {
|
2778
3042
|
error: function(text) {
|
@@ -2815,7 +3079,7 @@
|
|
2815
3079
|
|
2816
3080
|
}).call(this);
|
2817
3081
|
|
2818
|
-
},{}],
|
3082
|
+
},{}],39:[function(_dereq_,module,exports){
|
2819
3083
|
(function() {
|
2820
3084
|
var OldValue, Prefixer, Value, utils, vendor,
|
2821
3085
|
__hasProp = {}.hasOwnProperty,
|
@@ -2914,7 +3178,9 @@
|
|
2914
3178
|
|
2915
3179
|
}).call(this);
|
2916
3180
|
|
2917
|
-
},{"./old-value":
|
3181
|
+
},{"./old-value":33,"./prefixer":34,"./utils":38,"postcss/lib/vendor":58}],40:[function(_dereq_,module,exports){
|
3182
|
+
|
3183
|
+
},{}],41:[function(_dereq_,module,exports){
|
2918
3184
|
// shim for using process in browser
|
2919
3185
|
|
2920
3186
|
var process = module.exports = {};
|
@@ -2969,7 +3235,7 @@ process.chdir = function (dir) {
|
|
2969
3235
|
throw new Error('process.chdir is not supported');
|
2970
3236
|
};
|
2971
3237
|
|
2972
|
-
},{}],
|
3238
|
+
},{}],42:[function(_dereq_,module,exports){
|
2973
3239
|
(function (process){
|
2974
3240
|
// Copyright Joyent, Inc. and other Node contributors.
|
2975
3241
|
//
|
@@ -3197,7 +3463,7 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3197
3463
|
;
|
3198
3464
|
|
3199
3465
|
}).call(this,_dereq_("/home/ai/Dev/autoprefixer/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"))
|
3200
|
-
},{"/home/ai/Dev/autoprefixer/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":
|
3466
|
+
},{"/home/ai/Dev/autoprefixer/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":41}],43:[function(_dereq_,module,exports){
|
3201
3467
|
(function() {
|
3202
3468
|
var AtRule, Container, name, _fn, _i, _len, _ref,
|
3203
3469
|
__hasProp = {}.hasOwnProperty,
|
@@ -3213,8 +3479,25 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3213
3479
|
AtRule.__super__.constructor.apply(this, arguments);
|
3214
3480
|
}
|
3215
3481
|
|
3482
|
+
AtRule.prototype.styleType = function() {
|
3483
|
+
return this.type + ((this.rules != null) || (this.decls != null) ? '-body' : '-bodiless');
|
3484
|
+
};
|
3485
|
+
|
3486
|
+
AtRule.prototype.defaultStyle = function(type) {
|
3487
|
+
if (type === 'atrule-body') {
|
3488
|
+
return {
|
3489
|
+
between: ' ',
|
3490
|
+
after: this.defaultAfter()
|
3491
|
+
};
|
3492
|
+
} else {
|
3493
|
+
return {
|
3494
|
+
between: ''
|
3495
|
+
};
|
3496
|
+
}
|
3497
|
+
};
|
3498
|
+
|
3216
3499
|
AtRule.prototype.addMixin = function(type) {
|
3217
|
-
var mixin, name, value, _ref;
|
3500
|
+
var container, detector, mixin, name, value, _ref;
|
3218
3501
|
mixin = type === 'rules' ? Container.WithRules : Container.WithDecls;
|
3219
3502
|
if (!mixin) {
|
3220
3503
|
return;
|
@@ -3225,6 +3508,11 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3225
3508
|
if (name === 'constructor') {
|
3226
3509
|
continue;
|
3227
3510
|
}
|
3511
|
+
container = Container.prototype[name] === value;
|
3512
|
+
detector = name === 'append' || name === 'prepend';
|
3513
|
+
if (container && !detector) {
|
3514
|
+
continue;
|
3515
|
+
}
|
3228
3516
|
this[name] = value;
|
3229
3517
|
}
|
3230
3518
|
return mixin.apply(this);
|
@@ -3233,21 +3521,19 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3233
3521
|
AtRule.raw('params');
|
3234
3522
|
|
3235
3523
|
AtRule.prototype.stringify = function(builder, last) {
|
3236
|
-
var params, semicolon;
|
3237
|
-
|
3238
|
-
|
3239
|
-
|
3240
|
-
|
3241
|
-
|
3242
|
-
return this.stringifyBlock(builder,
|
3524
|
+
var name, params, semicolon, style;
|
3525
|
+
style = this.style();
|
3526
|
+
name = '@' + this.name;
|
3527
|
+
params = this._params ? this._params.toString() : '';
|
3528
|
+
name += this.afterName != null ? this.afterName : params ? ' ' : '';
|
3529
|
+
if ((this.rules != null) || (this.decls != null)) {
|
3530
|
+
return this.stringifyBlock(builder, name + params + style.between + '{');
|
3243
3531
|
} else {
|
3244
3532
|
if (this.before) {
|
3245
3533
|
builder(this.before);
|
3246
3534
|
}
|
3247
3535
|
semicolon = !last || this.semicolon ? ';' : '';
|
3248
|
-
return builder(
|
3249
|
-
before: ' '
|
3250
|
-
}) + semicolon, this);
|
3536
|
+
return builder(name + params + style.between + semicolon, this);
|
3251
3537
|
}
|
3252
3538
|
};
|
3253
3539
|
|
@@ -3258,7 +3544,9 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3258
3544
|
_ref = ['append', 'prepend'];
|
3259
3545
|
_fn = function(name) {
|
3260
3546
|
return AtRule.prototype[name] = function(child) {
|
3261
|
-
|
3547
|
+
var mixin;
|
3548
|
+
mixin = child.type === 'decl' ? 'decls' : 'rules';
|
3549
|
+
this.addMixin(mixin);
|
3262
3550
|
return this[name](child);
|
3263
3551
|
};
|
3264
3552
|
};
|
@@ -3271,9 +3559,49 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3271
3559
|
|
3272
3560
|
}).call(this);
|
3273
3561
|
|
3274
|
-
},{"./container":
|
3562
|
+
},{"./container":45}],44:[function(_dereq_,module,exports){
|
3563
|
+
(function() {
|
3564
|
+
var Comment, Node,
|
3565
|
+
__hasProp = {}.hasOwnProperty,
|
3566
|
+
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
3567
|
+
|
3568
|
+
Node = _dereq_('./node');
|
3569
|
+
|
3570
|
+
Comment = (function(_super) {
|
3571
|
+
__extends(Comment, _super);
|
3572
|
+
|
3573
|
+
function Comment() {
|
3574
|
+
this.type = 'comment';
|
3575
|
+
Comment.__super__.constructor.apply(this, arguments);
|
3576
|
+
}
|
3577
|
+
|
3578
|
+
Comment.prototype.defaultStyle = function() {
|
3579
|
+
return {
|
3580
|
+
left: ' ',
|
3581
|
+
right: ' '
|
3582
|
+
};
|
3583
|
+
};
|
3584
|
+
|
3585
|
+
Comment.prototype.stringify = function(builder) {
|
3586
|
+
var style;
|
3587
|
+
if (this.before) {
|
3588
|
+
builder(this.before);
|
3589
|
+
}
|
3590
|
+
style = this.style();
|
3591
|
+
return builder("/*" + (style.left + this.text + style.right) + "*/", this);
|
3592
|
+
};
|
3593
|
+
|
3594
|
+
return Comment;
|
3595
|
+
|
3596
|
+
})(Node);
|
3597
|
+
|
3598
|
+
module.exports = Comment;
|
3599
|
+
|
3600
|
+
}).call(this);
|
3601
|
+
|
3602
|
+
},{"./node":50}],45:[function(_dereq_,module,exports){
|
3275
3603
|
(function() {
|
3276
|
-
var Container, Declaration, Node,
|
3604
|
+
var Container, Declaration, Node,
|
3277
3605
|
__hasProp = {}.hasOwnProperty,
|
3278
3606
|
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
3279
3607
|
|
@@ -3285,13 +3613,11 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3285
3613
|
__extends(Container, _super);
|
3286
3614
|
|
3287
3615
|
function Container() {
|
3288
|
-
|
3289
|
-
return _ref;
|
3616
|
+
return Container.__super__.constructor.apply(this, arguments);
|
3290
3617
|
}
|
3291
3618
|
|
3292
3619
|
Container.prototype.stringifyContent = function(builder) {
|
3293
|
-
var last
|
3294
|
-
_this = this;
|
3620
|
+
var last;
|
3295
3621
|
if (!this.rules && !this.decls) {
|
3296
3622
|
return;
|
3297
3623
|
}
|
@@ -3302,20 +3628,35 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3302
3628
|
});
|
3303
3629
|
} else if (this.decls) {
|
3304
3630
|
last = this.decls.length - 1;
|
3305
|
-
return this.decls.map(function(
|
3306
|
-
return decl
|
3307
|
-
|
3631
|
+
return this.decls.map((function(_this) {
|
3632
|
+
return function(decl, i) {
|
3633
|
+
return decl.stringify(builder, last !== i || _this.semicolon);
|
3634
|
+
};
|
3635
|
+
})(this));
|
3636
|
+
}
|
3637
|
+
};
|
3638
|
+
|
3639
|
+
Container.prototype.defaultAfter = function() {
|
3640
|
+
var _ref;
|
3641
|
+
if (this.list.length === 0) {
|
3642
|
+
return '';
|
3643
|
+
} else if (((_ref = this.list[0].before) != null ? _ref.indexOf("\n") : void 0) === -1) {
|
3644
|
+
return this.list[0].before;
|
3645
|
+
} else {
|
3646
|
+
return "\n";
|
3308
3647
|
}
|
3309
3648
|
};
|
3310
3649
|
|
3311
3650
|
Container.prototype.stringifyBlock = function(builder, start) {
|
3651
|
+
var style;
|
3652
|
+
style = this.style();
|
3312
3653
|
if (this.before) {
|
3313
3654
|
builder(this.before);
|
3314
3655
|
}
|
3315
3656
|
builder(start, this, 'start');
|
3316
3657
|
this.stringifyContent(builder);
|
3317
|
-
if (
|
3318
|
-
builder(
|
3658
|
+
if (style.after) {
|
3659
|
+
builder(style.after);
|
3319
3660
|
}
|
3320
3661
|
return builder('}', this, 'end');
|
3321
3662
|
};
|
@@ -3327,24 +3668,59 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3327
3668
|
};
|
3328
3669
|
|
3329
3670
|
Container.prototype.each = function(callback) {
|
3330
|
-
var id, index, list;
|
3671
|
+
var id, index, list, result;
|
3331
3672
|
this.lastEach || (this.lastEach = 0);
|
3332
3673
|
this.indexes || (this.indexes = {});
|
3333
3674
|
this.lastEach += 1;
|
3334
3675
|
id = this.lastEach;
|
3335
3676
|
this.indexes[id] = 0;
|
3336
3677
|
list = this.list;
|
3678
|
+
if (!list) {
|
3679
|
+
return;
|
3680
|
+
}
|
3337
3681
|
while (this.indexes[id] < list.length) {
|
3338
3682
|
index = this.indexes[id];
|
3339
|
-
callback(list[index], index);
|
3683
|
+
result = callback(list[index], index);
|
3684
|
+
if (result === false) {
|
3685
|
+
break;
|
3686
|
+
}
|
3340
3687
|
this.indexes[id] += 1;
|
3341
3688
|
}
|
3342
3689
|
delete this.indexes[id];
|
3343
|
-
|
3690
|
+
if (result === false) {
|
3691
|
+
return false;
|
3692
|
+
}
|
3693
|
+
};
|
3694
|
+
|
3695
|
+
Container.prototype.eachInside = function(callback) {
|
3696
|
+
return this.each((function(_this) {
|
3697
|
+
return function(child, i) {
|
3698
|
+
var result;
|
3699
|
+
result = callback(child, i);
|
3700
|
+
if (result !== false && child.eachInside) {
|
3701
|
+
result = child.eachInside(callback);
|
3702
|
+
}
|
3703
|
+
if (result === false) {
|
3704
|
+
return result;
|
3705
|
+
}
|
3706
|
+
};
|
3707
|
+
})(this));
|
3344
3708
|
};
|
3345
3709
|
|
3346
3710
|
Container.prototype.eachDecl = function(callback) {};
|
3347
3711
|
|
3712
|
+
Container.prototype.eachComment = function(callback) {
|
3713
|
+
return this.eachInside((function(_this) {
|
3714
|
+
return function(child, i) {
|
3715
|
+
var result;
|
3716
|
+
result = child.type === 'comment' ? callback(child, i) : void 0;
|
3717
|
+
if (result === false) {
|
3718
|
+
return result;
|
3719
|
+
}
|
3720
|
+
};
|
3721
|
+
})(this));
|
3722
|
+
};
|
3723
|
+
|
3348
3724
|
Container.prototype.append = function(child) {
|
3349
3725
|
child = this.normalize(child, this.list[this.list.length - 1]);
|
3350
3726
|
this.list.push(child);
|
@@ -3352,25 +3728,25 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3352
3728
|
};
|
3353
3729
|
|
3354
3730
|
Container.prototype.prepend = function(child) {
|
3355
|
-
var id, index,
|
3731
|
+
var id, index, _ref;
|
3356
3732
|
child = this.normalize(child, this.list[0], 'prepend');
|
3357
3733
|
this.list.unshift(child);
|
3358
|
-
|
3359
|
-
for (id in
|
3360
|
-
index =
|
3734
|
+
_ref = this.indexes;
|
3735
|
+
for (id in _ref) {
|
3736
|
+
index = _ref[id];
|
3361
3737
|
this.indexes[id] = index + 1;
|
3362
3738
|
}
|
3363
3739
|
return this;
|
3364
3740
|
};
|
3365
3741
|
|
3366
3742
|
Container.prototype.insertBefore = function(exist, add) {
|
3367
|
-
var id, index,
|
3743
|
+
var id, index, _ref;
|
3368
3744
|
exist = this.index(exist);
|
3369
3745
|
add = this.normalize(add, this.list[exist], exist === 0 ? 'prepend' : void 0);
|
3370
3746
|
this.list.splice(exist, 0, add);
|
3371
|
-
|
3372
|
-
for (id in
|
3373
|
-
index =
|
3747
|
+
_ref = this.indexes;
|
3748
|
+
for (id in _ref) {
|
3749
|
+
index = _ref[id];
|
3374
3750
|
if (index >= exist) {
|
3375
3751
|
this.indexes[id] = index + 1;
|
3376
3752
|
}
|
@@ -3379,13 +3755,13 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3379
3755
|
};
|
3380
3756
|
|
3381
3757
|
Container.prototype.insertAfter = function(exist, add) {
|
3382
|
-
var id, index,
|
3758
|
+
var id, index, _ref;
|
3383
3759
|
exist = this.index(exist);
|
3384
3760
|
add = this.normalize(add, this.list[exist]);
|
3385
3761
|
this.list.splice(exist + 1, 0, add);
|
3386
|
-
|
3387
|
-
for (id in
|
3388
|
-
index =
|
3762
|
+
_ref = this.indexes;
|
3763
|
+
for (id in _ref) {
|
3764
|
+
index = _ref[id];
|
3389
3765
|
if (index > exist) {
|
3390
3766
|
this.indexes[id] = index + 1;
|
3391
3767
|
}
|
@@ -3394,12 +3770,12 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3394
3770
|
};
|
3395
3771
|
|
3396
3772
|
Container.prototype.remove = function(child) {
|
3397
|
-
var id, index,
|
3773
|
+
var id, index, _ref;
|
3398
3774
|
child = this.index(child);
|
3399
3775
|
this.list.splice(child, 1);
|
3400
|
-
|
3401
|
-
for (id in
|
3402
|
-
index =
|
3776
|
+
_ref = this.indexes;
|
3777
|
+
for (id in _ref) {
|
3778
|
+
index = _ref[id];
|
3403
3779
|
if (index >= child) {
|
3404
3780
|
this.indexes[id] = index - 1;
|
3405
3781
|
}
|
@@ -3423,6 +3799,18 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3423
3799
|
}
|
3424
3800
|
};
|
3425
3801
|
|
3802
|
+
Container.prop('first', {
|
3803
|
+
get: function() {
|
3804
|
+
return this.list[0];
|
3805
|
+
}
|
3806
|
+
});
|
3807
|
+
|
3808
|
+
Container.prop('last', {
|
3809
|
+
get: function() {
|
3810
|
+
return this.list[this.list.length - 1];
|
3811
|
+
}
|
3812
|
+
});
|
3813
|
+
|
3426
3814
|
Container.prop('list', {
|
3427
3815
|
get: function() {
|
3428
3816
|
return this.rules || this.decls;
|
@@ -3450,35 +3838,40 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3450
3838
|
}
|
3451
3839
|
|
3452
3840
|
WithRules.prototype.eachDecl = function(callback) {
|
3453
|
-
this.each(function(child) {
|
3454
|
-
|
3841
|
+
return this.each(function(child) {
|
3842
|
+
var result;
|
3843
|
+
if (!child.eachDecl) {
|
3844
|
+
return;
|
3845
|
+
}
|
3846
|
+
result = child.eachDecl(callback);
|
3847
|
+
if (result === false) {
|
3848
|
+
return result;
|
3849
|
+
}
|
3455
3850
|
});
|
3456
|
-
return this;
|
3457
3851
|
};
|
3458
3852
|
|
3459
3853
|
WithRules.prototype.eachRule = function(callback) {
|
3460
|
-
|
3461
|
-
|
3462
|
-
|
3463
|
-
|
3464
|
-
|
3465
|
-
|
3466
|
-
|
3467
|
-
|
3468
|
-
|
3854
|
+
return this.each((function(_this) {
|
3855
|
+
return function(child, i) {
|
3856
|
+
var result;
|
3857
|
+
result = child.type === 'rule' ? callback(child, i) : child.eachRule ? child.eachRule(callback) : void 0;
|
3858
|
+
if (result === false) {
|
3859
|
+
return result;
|
3860
|
+
}
|
3861
|
+
};
|
3862
|
+
})(this));
|
3469
3863
|
};
|
3470
3864
|
|
3471
3865
|
WithRules.prototype.eachAtRule = function(callback) {
|
3472
|
-
|
3473
|
-
|
3474
|
-
|
3475
|
-
callback(child, i);
|
3476
|
-
if (
|
3477
|
-
return
|
3866
|
+
return this.eachInside((function(_this) {
|
3867
|
+
return function(child, i) {
|
3868
|
+
var result;
|
3869
|
+
result = child.type === 'atrule' ? callback(child, i) : void 0;
|
3870
|
+
if (result === false) {
|
3871
|
+
return result;
|
3478
3872
|
}
|
3479
|
-
}
|
3480
|
-
});
|
3481
|
-
return this;
|
3873
|
+
};
|
3874
|
+
})(this));
|
3482
3875
|
};
|
3483
3876
|
|
3484
3877
|
return WithRules;
|
@@ -3501,11 +3894,18 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3501
3894
|
};
|
3502
3895
|
|
3503
3896
|
WithDecls.prototype.eachDecl = function(callback) {
|
3504
|
-
|
3505
|
-
|
3506
|
-
|
3507
|
-
|
3508
|
-
|
3897
|
+
return this.each((function(_this) {
|
3898
|
+
return function(node, i) {
|
3899
|
+
var result;
|
3900
|
+
if (node.type !== 'decl') {
|
3901
|
+
return;
|
3902
|
+
}
|
3903
|
+
result = callback(node, i);
|
3904
|
+
if (result === false) {
|
3905
|
+
return result;
|
3906
|
+
}
|
3907
|
+
};
|
3908
|
+
})(this));
|
3509
3909
|
};
|
3510
3910
|
|
3511
3911
|
return WithDecls;
|
@@ -3516,7 +3916,7 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3516
3916
|
|
3517
3917
|
}).call(this);
|
3518
3918
|
|
3519
|
-
},{"./declaration":
|
3919
|
+
},{"./declaration":46,"./node":50}],46:[function(_dereq_,module,exports){
|
3520
3920
|
(function() {
|
3521
3921
|
var Declaration, Node, vendor,
|
3522
3922
|
__hasProp = {}.hasOwnProperty,
|
@@ -3534,30 +3934,44 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3534
3934
|
Declaration.__super__.constructor.apply(this, arguments);
|
3535
3935
|
}
|
3536
3936
|
|
3937
|
+
Declaration.prototype.defaultStyle = function() {
|
3938
|
+
return {
|
3939
|
+
before: "\n ",
|
3940
|
+
between: ': '
|
3941
|
+
};
|
3942
|
+
};
|
3943
|
+
|
3537
3944
|
Declaration.raw('value');
|
3538
3945
|
|
3946
|
+
Declaration.prop('important', {
|
3947
|
+
get: function() {
|
3948
|
+
return !!this._important;
|
3949
|
+
},
|
3950
|
+
set: function(value) {
|
3951
|
+
if (typeof value === 'string' && value !== '') {
|
3952
|
+
return this._important = value;
|
3953
|
+
} else if (value) {
|
3954
|
+
return this._important = ' !important';
|
3955
|
+
} else {
|
3956
|
+
return this._important = false;
|
3957
|
+
}
|
3958
|
+
}
|
3959
|
+
});
|
3960
|
+
|
3539
3961
|
Declaration.prototype.stringify = function(builder, semicolon) {
|
3540
|
-
var string;
|
3541
|
-
|
3542
|
-
|
3962
|
+
var string, style;
|
3963
|
+
style = this.style();
|
3964
|
+
if (style.before) {
|
3965
|
+
builder(style.before);
|
3543
3966
|
}
|
3544
|
-
string = this.prop +
|
3545
|
-
|
3546
|
-
});
|
3967
|
+
string = this.prop + style.between + this._value.toString();
|
3968
|
+
string += this._important || '';
|
3547
3969
|
if (semicolon) {
|
3548
3970
|
string += ';';
|
3549
3971
|
}
|
3550
3972
|
return builder(string, this);
|
3551
3973
|
};
|
3552
3974
|
|
3553
|
-
Declaration.prototype.removeSelf = function() {
|
3554
|
-
if (!this.parent) {
|
3555
|
-
return;
|
3556
|
-
}
|
3557
|
-
this.parent.remove(this);
|
3558
|
-
return this;
|
3559
|
-
};
|
3560
|
-
|
3561
3975
|
Declaration.prototype.clone = function(obj) {
|
3562
3976
|
var cloned;
|
3563
3977
|
cloned = Declaration.__super__.clone.apply(this, arguments);
|
@@ -3573,74 +3987,27 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3573
3987
|
|
3574
3988
|
}).call(this);
|
3575
3989
|
|
3576
|
-
},{"./node":
|
3990
|
+
},{"./node":50,"./vendor":58}],47:[function(_dereq_,module,exports){
|
3577
3991
|
(function() {
|
3578
|
-
var
|
3579
|
-
|
3580
|
-
|
3581
|
-
|
3582
|
-
|
3583
|
-
|
3584
|
-
|
3585
|
-
|
3586
|
-
map = new SourceMap.SourceMapGenerator({
|
3587
|
-
file: opts.to || 'to.css'
|
3588
|
-
});
|
3589
|
-
result = new Result(css, '');
|
3590
|
-
line = 1;
|
3591
|
-
column = 1;
|
3592
|
-
builder = function(str, node, type) {
|
3593
|
-
var last, lines, _ref, _ref1;
|
3594
|
-
result.css += str;
|
3595
|
-
if ((node != null ? (_ref = node.source) != null ? _ref.start : void 0 : void 0) && type !== 'end') {
|
3596
|
-
map.addMapping({
|
3597
|
-
source: node.source.file || 'from.css',
|
3598
|
-
original: {
|
3599
|
-
line: node.source.start.line,
|
3600
|
-
column: node.source.start.column - 1
|
3601
|
-
},
|
3602
|
-
generated: {
|
3603
|
-
line: line,
|
3604
|
-
column: column - 1
|
3605
|
-
}
|
3606
|
-
});
|
3607
|
-
}
|
3608
|
-
lines = str.match(/\n/g);
|
3609
|
-
if (lines) {
|
3610
|
-
line += lines.length;
|
3611
|
-
last = str.lastIndexOf("\n");
|
3612
|
-
column = str.length - last;
|
3992
|
+
var lazy;
|
3993
|
+
|
3994
|
+
lazy = function(klass, name, callback) {
|
3995
|
+
var cache;
|
3996
|
+
cache = name + 'Cache';
|
3997
|
+
return klass.prototype[name] = function() {
|
3998
|
+
if (this[cache] != null) {
|
3999
|
+
return this[cache];
|
3613
4000
|
} else {
|
3614
|
-
|
3615
|
-
}
|
3616
|
-
if ((node != null ? (_ref1 = node.source) != null ? _ref1.end : void 0 : void 0) && type !== 'start') {
|
3617
|
-
return map.addMapping({
|
3618
|
-
source: node.source.file || 'from.css',
|
3619
|
-
original: {
|
3620
|
-
line: node.source.end.line,
|
3621
|
-
column: node.source.end.column
|
3622
|
-
},
|
3623
|
-
generated: {
|
3624
|
-
line: line,
|
3625
|
-
column: column
|
3626
|
-
}
|
3627
|
-
});
|
4001
|
+
return this[cache] = callback.apply(this, arguments);
|
3628
4002
|
}
|
3629
4003
|
};
|
3630
|
-
css.stringify(builder);
|
3631
|
-
if (typeof opts.map === 'string') {
|
3632
|
-
prev = new SourceMap.SourceMapConsumer(opts.map);
|
3633
|
-
map.applySourceMap(prev);
|
3634
|
-
}
|
3635
|
-
result.map = map.toString();
|
3636
|
-
return result;
|
3637
4004
|
};
|
3638
4005
|
|
3639
|
-
module.exports =
|
4006
|
+
module.exports = lazy;
|
3640
4007
|
|
3641
4008
|
}).call(this);
|
3642
4009
|
|
3643
|
-
},{
|
4010
|
+
},{}],48:[function(_dereq_,module,exports){
|
3644
4011
|
(function() {
|
3645
4012
|
var list;
|
3646
4013
|
|
@@ -3706,9 +4073,252 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3706
4073
|
|
3707
4074
|
}).call(this);
|
3708
4075
|
|
3709
|
-
},{}],
|
4076
|
+
},{}],49:[function(_dereq_,module,exports){
|
3710
4077
|
(function() {
|
3711
|
-
var
|
4078
|
+
var MapGenerator, Result, base64, fs, lazy, mozilla, path;
|
4079
|
+
|
4080
|
+
mozilla = _dereq_('source-map');
|
4081
|
+
|
4082
|
+
base64 = _dereq_('base64-js');
|
4083
|
+
|
4084
|
+
Result = _dereq_('./result');
|
4085
|
+
|
4086
|
+
lazy = _dereq_('./lazy');
|
4087
|
+
|
4088
|
+
path = _dereq_('path');
|
4089
|
+
|
4090
|
+
fs = _dereq_('fs');
|
4091
|
+
|
4092
|
+
MapGenerator = (function() {
|
4093
|
+
function MapGenerator(root, opts) {
|
4094
|
+
this.root = root;
|
4095
|
+
this.opts = opts;
|
4096
|
+
}
|
4097
|
+
|
4098
|
+
MapGenerator.prototype.startWith = function(string, start) {
|
4099
|
+
return string.slice(0, +(start.length - 1) + 1 || 9e9) === start;
|
4100
|
+
};
|
4101
|
+
|
4102
|
+
MapGenerator.prototype.isMap = function() {
|
4103
|
+
if (typeof this.opts.map === 'boolean') {
|
4104
|
+
return this.opts.map;
|
4105
|
+
}
|
4106
|
+
return !!this.opts.inlineMap || !!this.prevMap();
|
4107
|
+
};
|
4108
|
+
|
4109
|
+
lazy(MapGenerator, 'isInline', function() {
|
4110
|
+
if (this.opts.inlineMap != null) {
|
4111
|
+
return this.opts.inlineMap;
|
4112
|
+
}
|
4113
|
+
return this.isPrevInline();
|
4114
|
+
});
|
4115
|
+
|
4116
|
+
lazy(MapGenerator, 'isPrevInline', function() {
|
4117
|
+
var text;
|
4118
|
+
if (!this.prevAnnotation()) {
|
4119
|
+
return false;
|
4120
|
+
}
|
4121
|
+
text = this.prevAnnotation().text;
|
4122
|
+
return this.startWith(text, '# sourceMappingURL=data:');
|
4123
|
+
});
|
4124
|
+
|
4125
|
+
lazy(MapGenerator, 'prevMap', function() {
|
4126
|
+
var byte, bytes, file, map, start, text;
|
4127
|
+
if (this.opts.map && typeof this.opts.map !== 'boolean') {
|
4128
|
+
return this.opts.map;
|
4129
|
+
}
|
4130
|
+
if (this.isPrevInline()) {
|
4131
|
+
start = '# sourceMappingURL=data:application/json;base64,';
|
4132
|
+
text = this.prevAnnotation().text;
|
4133
|
+
text = text.slice(start.length);
|
4134
|
+
bytes = base64.toByteArray(text);
|
4135
|
+
return ((function() {
|
4136
|
+
var _i, _len, _results;
|
4137
|
+
_results = [];
|
4138
|
+
for (_i = 0, _len = bytes.length; _i < _len; _i++) {
|
4139
|
+
byte = bytes[_i];
|
4140
|
+
_results.push(String.fromCharCode(byte));
|
4141
|
+
}
|
4142
|
+
return _results;
|
4143
|
+
})()).join('');
|
4144
|
+
} else if (this.opts.from) {
|
4145
|
+
map = this.opts.from + '.map';
|
4146
|
+
if (this.prevAnnotation()) {
|
4147
|
+
file = this.prevAnnotation().text.replace('# sourceMappingURL=', '');
|
4148
|
+
map = path.join(path.dirname(this.opts.from), file);
|
4149
|
+
}
|
4150
|
+
if (typeof fs.existsSync === "function" ? fs.existsSync(map) : void 0) {
|
4151
|
+
return fs.readFileSync(map).toString();
|
4152
|
+
} else {
|
4153
|
+
return false;
|
4154
|
+
}
|
4155
|
+
}
|
4156
|
+
});
|
4157
|
+
|
4158
|
+
lazy(MapGenerator, 'prevAnnotation', function() {
|
4159
|
+
var last;
|
4160
|
+
last = this.root.last;
|
4161
|
+
if (!last) {
|
4162
|
+
return null;
|
4163
|
+
}
|
4164
|
+
if (last.type === 'comment' && this.startWith(last.text, '# sourceMappingURL=')) {
|
4165
|
+
return last;
|
4166
|
+
} else {
|
4167
|
+
return null;
|
4168
|
+
}
|
4169
|
+
});
|
4170
|
+
|
4171
|
+
MapGenerator.prototype.clearAnnotation = function() {
|
4172
|
+
var _ref;
|
4173
|
+
return (_ref = this.prevAnnotation()) != null ? _ref.removeSelf() : void 0;
|
4174
|
+
};
|
4175
|
+
|
4176
|
+
MapGenerator.prototype.applyPrevMap = function() {
|
4177
|
+
var from, prev, source;
|
4178
|
+
if (this.prevMap()) {
|
4179
|
+
prev = this.prevMap();
|
4180
|
+
prev = typeof prev === 'string' ? JSON.parse(prev) : prev instanceof mozilla.SourceMapConsumer ? mozilla.SourceMapGenerator.fromSourceMap(prev).toJSON() : typeof prev === 'object' && prev.toJSON ? prev.toJSON() : prev;
|
4181
|
+
from = path.dirname(this.opts.from);
|
4182
|
+
prev.sources = (function() {
|
4183
|
+
var _i, _len, _ref, _results;
|
4184
|
+
_ref = prev.sources;
|
4185
|
+
_results = [];
|
4186
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
4187
|
+
source = _ref[_i];
|
4188
|
+
_results.push(this.relative(path.resolve(from, source)));
|
4189
|
+
}
|
4190
|
+
return _results;
|
4191
|
+
}).call(this);
|
4192
|
+
prev = new mozilla.SourceMapConsumer(prev);
|
4193
|
+
return this.map.applySourceMap(prev, this.relative(this.opts.from));
|
4194
|
+
}
|
4195
|
+
};
|
4196
|
+
|
4197
|
+
MapGenerator.prototype.addAnnotation = function() {
|
4198
|
+
var bytes, char, content;
|
4199
|
+
if (this.opts.mapAnnotation === false) {
|
4200
|
+
return;
|
4201
|
+
}
|
4202
|
+
if (this.prevMap() && !this.prevAnnotation()) {
|
4203
|
+
return;
|
4204
|
+
}
|
4205
|
+
content = this.isInline() ? (bytes = (function() {
|
4206
|
+
var _i, _len, _ref, _results;
|
4207
|
+
_ref = this.map.toString();
|
4208
|
+
_results = [];
|
4209
|
+
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
4210
|
+
char = _ref[_i];
|
4211
|
+
_results.push(char.charCodeAt(0));
|
4212
|
+
}
|
4213
|
+
return _results;
|
4214
|
+
}).call(this), "data:application/json;base64," + base64.fromByteArray(bytes)) : this.outputFile() + '.map';
|
4215
|
+
return this.css += "\n/*# sourceMappingURL=" + content + " */";
|
4216
|
+
};
|
4217
|
+
|
4218
|
+
MapGenerator.prototype.outputFile = function() {
|
4219
|
+
if (this.opts.to) {
|
4220
|
+
return path.basename(this.opts.to);
|
4221
|
+
} else {
|
4222
|
+
return 'to.css';
|
4223
|
+
}
|
4224
|
+
};
|
4225
|
+
|
4226
|
+
MapGenerator.prototype.generateMap = function() {
|
4227
|
+
this.stringify();
|
4228
|
+
this.applyPrevMap();
|
4229
|
+
this.addAnnotation();
|
4230
|
+
if (this.isInline()) {
|
4231
|
+
return new Result(this.css);
|
4232
|
+
} else {
|
4233
|
+
return new Result(this.css, this.map.toString());
|
4234
|
+
}
|
4235
|
+
};
|
4236
|
+
|
4237
|
+
MapGenerator.prototype.relative = function(file) {
|
4238
|
+
var from;
|
4239
|
+
from = this.opts.to ? path.dirname(this.opts.to) : '.';
|
4240
|
+
file = path.relative(from, file);
|
4241
|
+
if (path.sep === '\\') {
|
4242
|
+
file = file.replace('\\', '/');
|
4243
|
+
}
|
4244
|
+
return file;
|
4245
|
+
};
|
4246
|
+
|
4247
|
+
MapGenerator.prototype.sourcePath = function(node) {
|
4248
|
+
return this.relative(node.source.file || 'from.css');
|
4249
|
+
};
|
4250
|
+
|
4251
|
+
MapGenerator.prototype.stringify = function() {
|
4252
|
+
var builder, column, line;
|
4253
|
+
this.css = '';
|
4254
|
+
this.map = new mozilla.SourceMapGenerator({
|
4255
|
+
file: this.outputFile()
|
4256
|
+
});
|
4257
|
+
line = 1;
|
4258
|
+
column = 1;
|
4259
|
+
builder = (function(_this) {
|
4260
|
+
return function(str, node, type) {
|
4261
|
+
var last, lines, _ref, _ref1;
|
4262
|
+
_this.css += str;
|
4263
|
+
if ((node != null ? (_ref = node.source) != null ? _ref.start : void 0 : void 0) && type !== 'end') {
|
4264
|
+
_this.map.addMapping({
|
4265
|
+
source: _this.sourcePath(node),
|
4266
|
+
original: {
|
4267
|
+
line: node.source.start.line,
|
4268
|
+
column: node.source.start.column - 1
|
4269
|
+
},
|
4270
|
+
generated: {
|
4271
|
+
line: line,
|
4272
|
+
column: column - 1
|
4273
|
+
}
|
4274
|
+
});
|
4275
|
+
}
|
4276
|
+
lines = str.match(/\n/g);
|
4277
|
+
if (lines) {
|
4278
|
+
line += lines.length;
|
4279
|
+
last = str.lastIndexOf("\n");
|
4280
|
+
column = str.length - last;
|
4281
|
+
} else {
|
4282
|
+
column = column + str.length;
|
4283
|
+
}
|
4284
|
+
if ((node != null ? (_ref1 = node.source) != null ? _ref1.end : void 0 : void 0) && type !== 'start') {
|
4285
|
+
return _this.map.addMapping({
|
4286
|
+
source: _this.sourcePath(node),
|
4287
|
+
original: {
|
4288
|
+
line: node.source.end.line,
|
4289
|
+
column: node.source.end.column
|
4290
|
+
},
|
4291
|
+
generated: {
|
4292
|
+
line: line,
|
4293
|
+
column: column
|
4294
|
+
}
|
4295
|
+
});
|
4296
|
+
}
|
4297
|
+
};
|
4298
|
+
})(this);
|
4299
|
+
return this.root.stringify(builder);
|
4300
|
+
};
|
4301
|
+
|
4302
|
+
MapGenerator.prototype.getResult = function() {
|
4303
|
+
this.clearAnnotation();
|
4304
|
+
if (this.isMap()) {
|
4305
|
+
return this.generateMap();
|
4306
|
+
} else {
|
4307
|
+
return new Result(this.root.toString());
|
4308
|
+
}
|
4309
|
+
};
|
4310
|
+
|
4311
|
+
return MapGenerator;
|
4312
|
+
|
4313
|
+
})();
|
4314
|
+
|
4315
|
+
module.exports = MapGenerator;
|
4316
|
+
|
4317
|
+
}).call(this);
|
4318
|
+
|
4319
|
+
},{"./lazy":47,"./result":54,"base64-js":59,"fs":40,"path":42,"source-map":60}],50:[function(_dereq_,module,exports){
|
4320
|
+
(function() {
|
4321
|
+
var Node, Raw, clone, keys,
|
3712
4322
|
__hasProp = {}.hasOwnProperty;
|
3713
4323
|
|
3714
4324
|
Raw = _dereq_('./raw');
|
@@ -3737,6 +4347,19 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3737
4347
|
return cloned;
|
3738
4348
|
};
|
3739
4349
|
|
4350
|
+
keys = function(obj, keys) {
|
4351
|
+
var all, key;
|
4352
|
+
all = {};
|
4353
|
+
for (key in keys) {
|
4354
|
+
if (obj[key] != null) {
|
4355
|
+
all[key] = obj[key];
|
4356
|
+
} else {
|
4357
|
+
return false;
|
4358
|
+
}
|
4359
|
+
}
|
4360
|
+
return all;
|
4361
|
+
};
|
4362
|
+
|
3740
4363
|
Node = (function() {
|
3741
4364
|
function Node(defaults) {
|
3742
4365
|
var name, value;
|
@@ -3756,20 +4379,21 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3756
4379
|
Node.raw = function(name) {
|
3757
4380
|
var hidden;
|
3758
4381
|
hidden = '_' + name;
|
3759
|
-
this.prototype[hidden] = Raw.empty;
|
3760
4382
|
return this.prop(name, {
|
3761
4383
|
get: function() {
|
3762
|
-
var
|
3763
|
-
|
4384
|
+
var prop;
|
4385
|
+
prop = this[hidden];
|
4386
|
+
if (prop instanceof Raw) {
|
4387
|
+
return prop.value;
|
4388
|
+
} else {
|
4389
|
+
return prop;
|
4390
|
+
}
|
3764
4391
|
},
|
3765
4392
|
set: function(value) {
|
3766
4393
|
if (value instanceof Raw) {
|
3767
4394
|
return this[hidden] = value;
|
3768
4395
|
} else {
|
3769
|
-
|
3770
|
-
this[hidden] = new Raw();
|
3771
|
-
}
|
3772
|
-
return this[hidden].set(value);
|
4396
|
+
return this[hidden] = value;
|
3773
4397
|
}
|
3774
4398
|
}
|
3775
4399
|
});
|
@@ -3826,6 +4450,55 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3826
4450
|
return fixed;
|
3827
4451
|
};
|
3828
4452
|
|
4453
|
+
Node.prototype.defaultStyle = function() {
|
4454
|
+
return {};
|
4455
|
+
};
|
4456
|
+
|
4457
|
+
Node.prototype.styleType = function() {
|
4458
|
+
return this.type;
|
4459
|
+
};
|
4460
|
+
|
4461
|
+
Node.prototype.style = function() {
|
4462
|
+
var all, defaults, key, merge, root, style, type;
|
4463
|
+
type = this.styleType();
|
4464
|
+
defaults = this.defaultStyle(type);
|
4465
|
+
all = keys(this, defaults);
|
4466
|
+
if (all) {
|
4467
|
+
return all;
|
4468
|
+
}
|
4469
|
+
style = defaults;
|
4470
|
+
if (this.parent) {
|
4471
|
+
root = this;
|
4472
|
+
while (root.parent) {
|
4473
|
+
root = root.parent;
|
4474
|
+
}
|
4475
|
+
root.styleCache || (root.styleCache = {});
|
4476
|
+
if (root.styleCache[type]) {
|
4477
|
+
style = root.styleCache[type];
|
4478
|
+
} else {
|
4479
|
+
root.eachInside(function(another) {
|
4480
|
+
if (another.styleType() !== type) {
|
4481
|
+
return;
|
4482
|
+
}
|
4483
|
+
if (this === another) {
|
4484
|
+
return;
|
4485
|
+
}
|
4486
|
+
all = keys(another, style);
|
4487
|
+
if (all) {
|
4488
|
+
style = all;
|
4489
|
+
return false;
|
4490
|
+
}
|
4491
|
+
});
|
4492
|
+
root.styleCache[type] = style;
|
4493
|
+
}
|
4494
|
+
}
|
4495
|
+
merge = {};
|
4496
|
+
for (key in style) {
|
4497
|
+
merge[key] = this[key] != null ? this[key] : style[key];
|
4498
|
+
}
|
4499
|
+
return merge;
|
4500
|
+
};
|
4501
|
+
|
3829
4502
|
return Node;
|
3830
4503
|
|
3831
4504
|
})();
|
@@ -3834,14 +4507,16 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3834
4507
|
|
3835
4508
|
}).call(this);
|
3836
4509
|
|
3837
|
-
},{"./raw":
|
4510
|
+
},{"./raw":53}],51:[function(_dereq_,module,exports){
|
3838
4511
|
(function() {
|
3839
|
-
var AtRule, Declaration, Parser, Raw, Root, Rule, SyntexError;
|
4512
|
+
var AtRule, Comment, Declaration, Parser, Raw, Root, Rule, SyntexError;
|
3840
4513
|
|
3841
4514
|
SyntexError = _dereq_('./syntax-error');
|
3842
4515
|
|
3843
4516
|
Declaration = _dereq_('./declaration');
|
3844
4517
|
|
4518
|
+
Comment = _dereq_('./comment');
|
4519
|
+
|
3845
4520
|
AtRule = _dereq_('./at-rule');
|
3846
4521
|
|
3847
4522
|
Root = _dereq_('./root');
|
@@ -3906,7 +4581,19 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3906
4581
|
};
|
3907
4582
|
|
3908
4583
|
Parser.prototype.inComment = function() {
|
4584
|
+
var left, right, text, _ref, _ref1;
|
3909
4585
|
if (this.inside('comment')) {
|
4586
|
+
if (this.next('*/')) {
|
4587
|
+
_ref = this.startSpaces(this.prevBuffer()), text = _ref[0], left = _ref[1];
|
4588
|
+
_ref1 = this.endSpaces(text), text = _ref1[0], right = _ref1[1];
|
4589
|
+
this.current.text = text;
|
4590
|
+
this.current.left = left;
|
4591
|
+
this.current.right = right;
|
4592
|
+
this.move();
|
4593
|
+
this.pop();
|
4594
|
+
}
|
4595
|
+
return true;
|
4596
|
+
} else if (this.inside('value-comment')) {
|
3910
4597
|
if (this.next('*/')) {
|
3911
4598
|
this.popType();
|
3912
4599
|
this.move();
|
@@ -3917,13 +4604,20 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3917
4604
|
|
3918
4605
|
Parser.prototype.isComment = function() {
|
3919
4606
|
if (this.next('/*')) {
|
3920
|
-
this.
|
3921
|
-
|
3922
|
-
|
3923
|
-
|
3924
|
-
|
3925
|
-
|
3926
|
-
|
4607
|
+
if (this.inside('rules') || this.inside('decls')) {
|
4608
|
+
this.init(new Comment());
|
4609
|
+
this.addType('comment');
|
4610
|
+
this.move();
|
4611
|
+
return this.buffer = '';
|
4612
|
+
} else {
|
4613
|
+
this.commentPos = {
|
4614
|
+
line: this.line,
|
4615
|
+
column: this.column
|
4616
|
+
};
|
4617
|
+
this.addType('value-comment');
|
4618
|
+
this.move();
|
4619
|
+
return true;
|
4620
|
+
}
|
3927
4621
|
}
|
3928
4622
|
};
|
3929
4623
|
|
@@ -3931,7 +4625,7 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3931
4625
|
if (this.letter === '{' && (this.inside('decls') || this.inside('value'))) {
|
3932
4626
|
this.error("Unexpected {");
|
3933
4627
|
}
|
3934
|
-
if (this.inside('
|
4628
|
+
if (this.inside('prop') && (this.letter === '}' || this.letter === ';')) {
|
3935
4629
|
return this.error('Missing property value');
|
3936
4630
|
}
|
3937
4631
|
};
|
@@ -3946,6 +4640,7 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3946
4640
|
};
|
3947
4641
|
|
3948
4642
|
Parser.prototype.inAtrule = function(close) {
|
4643
|
+
var left, raw, right, _ref, _ref1;
|
3949
4644
|
if (this.inside('atrule-name')) {
|
3950
4645
|
if (this.space()) {
|
3951
4646
|
this.checkAtruleName();
|
@@ -3953,6 +4648,7 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3953
4648
|
this.trimmed = '';
|
3954
4649
|
this.setType('atrule-param');
|
3955
4650
|
} else if (this.letter === ';' || this.letter === '{' || close) {
|
4651
|
+
this.current.between = '';
|
3956
4652
|
this.checkAtruleName();
|
3957
4653
|
this.endAtruleParams();
|
3958
4654
|
} else {
|
@@ -3961,7 +4657,16 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3961
4657
|
return true;
|
3962
4658
|
} else if (this.inside('atrule-param')) {
|
3963
4659
|
if (this.letter === ';' || this.letter === '{' || close) {
|
3964
|
-
|
4660
|
+
_ref = this.startSpaces(this.prevBuffer()), raw = _ref[0], left = _ref[1];
|
4661
|
+
_ref1 = this.endSpaces(raw), raw = _ref1[0], right = _ref1[1];
|
4662
|
+
this.current.params = this.raw(this.trimmed.trim(), raw);
|
4663
|
+
if (this.current.params) {
|
4664
|
+
this.current.afterName = left;
|
4665
|
+
this.current.between = right;
|
4666
|
+
} else {
|
4667
|
+
this.current.afterName = '';
|
4668
|
+
this.current.between = left + right;
|
4669
|
+
}
|
3965
4670
|
this.endAtruleParams();
|
3966
4671
|
} else {
|
3967
4672
|
this.trimmed += this.letter;
|
@@ -3971,9 +4676,12 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3971
4676
|
};
|
3972
4677
|
|
3973
4678
|
Parser.prototype.inSelector = function() {
|
4679
|
+
var raw, spaces, _ref;
|
3974
4680
|
if (this.inside('selector')) {
|
3975
4681
|
if (this.letter === '{') {
|
3976
|
-
|
4682
|
+
_ref = this.endSpaces(this.prevBuffer()), raw = _ref[0], spaces = _ref[1];
|
4683
|
+
this.current.selector = this.raw(this.trimmed.trim(), raw);
|
4684
|
+
this.current.between = spaces;
|
3977
4685
|
this.semicolon = false;
|
3978
4686
|
this.buffer = '';
|
3979
4687
|
this.setType('decls');
|
@@ -3989,7 +4697,8 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
3989
4697
|
this.init(new Rule());
|
3990
4698
|
if (this.letter === '{') {
|
3991
4699
|
this.addType('decls');
|
3992
|
-
this.current.selector =
|
4700
|
+
this.current.selector = '';
|
4701
|
+
this.current.between = '';
|
3993
4702
|
this.semicolon = false;
|
3994
4703
|
this.buffer = '';
|
3995
4704
|
} else {
|
@@ -4023,14 +4732,14 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4023
4732
|
};
|
4024
4733
|
|
4025
4734
|
Parser.prototype.inProperty = function() {
|
4026
|
-
if (this.inside('
|
4735
|
+
if (this.inside('prop')) {
|
4027
4736
|
if (this.letter === ':') {
|
4028
4737
|
if (this.buffer[0] === '*' || this.buffer[0] === '_') {
|
4029
4738
|
this.current.before += this.buffer[0];
|
4030
4739
|
this.trimmed = this.trimmed.slice(1);
|
4031
4740
|
this.buffer = this.buffer.slice(1);
|
4032
4741
|
}
|
4033
|
-
this.current.prop = this.trim(
|
4742
|
+
this.current.prop = this.trimmed.trim();
|
4034
4743
|
this.current.between = this.prevBuffer().slice(this.current.prop.length);
|
4035
4744
|
this.buffer = '';
|
4036
4745
|
this.setType('value');
|
@@ -4047,7 +4756,7 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4047
4756
|
Parser.prototype.isProperty = function() {
|
4048
4757
|
if (this.inside('decls') && !this.space() && this.letter !== ';') {
|
4049
4758
|
this.init(new Declaration());
|
4050
|
-
this.addType('
|
4759
|
+
this.addType('prop');
|
4051
4760
|
this.buffer = this.letter;
|
4052
4761
|
this.trimmed = this.letter;
|
4053
4762
|
this.semicolon = false;
|
@@ -4056,6 +4765,7 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4056
4765
|
};
|
4057
4766
|
|
4058
4767
|
Parser.prototype.inValue = function(close) {
|
4768
|
+
var end, match, raw, spaces, trim, _ref;
|
4059
4769
|
if (this.inside('value')) {
|
4060
4770
|
if (this.letter === '(') {
|
4061
4771
|
this.inBrackets = true;
|
@@ -4066,7 +4776,16 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4066
4776
|
if (this.letter === ';') {
|
4067
4777
|
this.semicolon = true;
|
4068
4778
|
}
|
4069
|
-
|
4779
|
+
_ref = this.startSpaces(this.prevBuffer()), raw = _ref[0], spaces = _ref[1];
|
4780
|
+
trim = this.trimmed.trim();
|
4781
|
+
if (match = raw.match(/\s+!important\s*$/)) {
|
4782
|
+
this.current._important = match[0];
|
4783
|
+
end = -match[0].length - 1;
|
4784
|
+
raw = raw.slice(0, +end + 1 || 9e9);
|
4785
|
+
trim = trim.replace(/\s+!important$/, '');
|
4786
|
+
}
|
4787
|
+
this.current.value = this.raw(trim, raw);
|
4788
|
+
this.current.between += ':' + spaces;
|
4070
4789
|
this.pop();
|
4071
4790
|
} else {
|
4072
4791
|
this.trimmed += this.letter;
|
@@ -4087,9 +4806,11 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4087
4806
|
return this.inAtrule('close');
|
4088
4807
|
});
|
4089
4808
|
}
|
4090
|
-
if (this.
|
4809
|
+
if (this.inside('comment')) {
|
4810
|
+
return this.error('Unclosed comment', this.current.source.start);
|
4811
|
+
} else if (this.parents.length > 1) {
|
4091
4812
|
return this.error('Unclosed block', this.current.source.start);
|
4092
|
-
} else if (this.inside('comment')) {
|
4813
|
+
} else if (this.inside('value-comment')) {
|
4093
4814
|
return this.error('Unclosed comment', this.commentPos);
|
4094
4815
|
} else if (this.quote) {
|
4095
4816
|
return this.error('Unclosed quote', this.quotePos);
|
@@ -4153,6 +4874,14 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4153
4874
|
return this.buffer = '';
|
4154
4875
|
};
|
4155
4876
|
|
4877
|
+
Parser.prototype.raw = function(value, raw) {
|
4878
|
+
if (value !== raw) {
|
4879
|
+
return new Raw(value, raw);
|
4880
|
+
} else {
|
4881
|
+
return value;
|
4882
|
+
}
|
4883
|
+
};
|
4884
|
+
|
4156
4885
|
Parser.prototype.fixEnd = function(callback) {
|
4157
4886
|
var after, all, el, last, lines, start;
|
4158
4887
|
if (this.letter === '}') {
|
@@ -4238,8 +4967,26 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4238
4967
|
}
|
4239
4968
|
};
|
4240
4969
|
|
4241
|
-
Parser.prototype.
|
4242
|
-
|
4970
|
+
Parser.prototype.startSpaces = function(string) {
|
4971
|
+
var match, pos;
|
4972
|
+
match = string.match(/^\s*/);
|
4973
|
+
if (match) {
|
4974
|
+
pos = match[0].length;
|
4975
|
+
return [string.slice(pos), match[0]];
|
4976
|
+
} else {
|
4977
|
+
return [string, ''];
|
4978
|
+
}
|
4979
|
+
};
|
4980
|
+
|
4981
|
+
Parser.prototype.endSpaces = function(string) {
|
4982
|
+
var match, pos;
|
4983
|
+
match = string.match(/\s*$/);
|
4984
|
+
if (match) {
|
4985
|
+
pos = match[0].length + 1;
|
4986
|
+
return [string.slice(0, +(-pos) + 1 || 9e9), match[0]];
|
4987
|
+
} else {
|
4988
|
+
return [string, ''];
|
4989
|
+
}
|
4243
4990
|
};
|
4244
4991
|
|
4245
4992
|
return Parser;
|
@@ -4258,18 +5005,16 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4258
5005
|
|
4259
5006
|
}).call(this);
|
4260
5007
|
|
4261
|
-
},{"./at-rule":
|
5008
|
+
},{"./at-rule":43,"./comment":44,"./declaration":46,"./raw":53,"./root":55,"./rule":56,"./syntax-error":57}],52:[function(_dereq_,module,exports){
|
4262
5009
|
(function() {
|
4263
|
-
var AtRule, Declaration, PostCSS,
|
5010
|
+
var AtRule, Comment, Declaration, PostCSS, Root, Rule, postcss,
|
4264
5011
|
__slice = [].slice;
|
4265
5012
|
|
4266
|
-
generateMap = _dereq_('./generate-map');
|
4267
|
-
|
4268
5013
|
Declaration = _dereq_('./declaration');
|
4269
5014
|
|
4270
|
-
|
5015
|
+
Comment = _dereq_('./comment');
|
4271
5016
|
|
4272
|
-
|
5017
|
+
AtRule = _dereq_('./at-rule');
|
4273
5018
|
|
4274
5019
|
Rule = _dereq_('./rule');
|
4275
5020
|
|
@@ -4299,11 +5044,7 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4299
5044
|
parsed = returned;
|
4300
5045
|
}
|
4301
5046
|
}
|
4302
|
-
|
4303
|
-
return generateMap(parsed, opts);
|
4304
|
-
} else {
|
4305
|
-
return new Result(parsed, parsed.toString());
|
4306
|
-
}
|
5047
|
+
return parsed.toResult(opts);
|
4307
5048
|
};
|
4308
5049
|
|
4309
5050
|
return PostCSS;
|
@@ -4318,14 +5059,18 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4318
5059
|
|
4319
5060
|
postcss.parse = _dereq_('./parse');
|
4320
5061
|
|
4321
|
-
postcss.
|
4322
|
-
return new
|
5062
|
+
postcss.comment = function(defaults) {
|
5063
|
+
return new Comment(defaults);
|
4323
5064
|
};
|
4324
5065
|
|
4325
5066
|
postcss.atRule = function(defaults) {
|
4326
5067
|
return new AtRule(defaults);
|
4327
5068
|
};
|
4328
5069
|
|
5070
|
+
postcss.decl = function(defaults) {
|
5071
|
+
return new Declaration(defaults);
|
5072
|
+
};
|
5073
|
+
|
4329
5074
|
postcss.rule = function(defaults) {
|
4330
5075
|
return new Rule(defaults);
|
4331
5076
|
};
|
@@ -4338,33 +5083,29 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4338
5083
|
|
4339
5084
|
}).call(this);
|
4340
5085
|
|
4341
|
-
},{"./at-rule":
|
5086
|
+
},{"./at-rule":43,"./comment":44,"./declaration":46,"./parse":51,"./root":55,"./rule":56}],53:[function(_dereq_,module,exports){
|
4342
5087
|
(function() {
|
4343
5088
|
var Raw;
|
4344
5089
|
|
4345
5090
|
Raw = (function() {
|
4346
|
-
function
|
4347
|
-
|
4348
|
-
|
4349
|
-
|
4350
|
-
|
4351
|
-
Raw.prototype.set = function(value) {
|
4352
|
-
if (this.trimmed !== value) {
|
4353
|
-
this.changed = true;
|
4354
|
-
return this.trimmed = value;
|
5091
|
+
Raw.load = function(value, raw) {
|
5092
|
+
if ((raw != null) && value !== raw) {
|
5093
|
+
return new Raw(value, raw);
|
5094
|
+
} else {
|
5095
|
+
return value;
|
4355
5096
|
}
|
4356
5097
|
};
|
4357
5098
|
|
4358
|
-
Raw
|
4359
|
-
|
4360
|
-
|
4361
|
-
|
4362
|
-
|
4363
|
-
|
4364
|
-
|
4365
|
-
return
|
5099
|
+
function Raw(value, raw) {
|
5100
|
+
this.value = value;
|
5101
|
+
this.raw = raw;
|
5102
|
+
}
|
5103
|
+
|
5104
|
+
Raw.prototype.toString = function() {
|
5105
|
+
if (this.changed) {
|
5106
|
+
return this.value || '';
|
4366
5107
|
} else {
|
4367
|
-
return
|
5108
|
+
return this.raw || this.value || '';
|
4368
5109
|
}
|
4369
5110
|
};
|
4370
5111
|
|
@@ -4372,20 +5113,20 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4372
5113
|
|
4373
5114
|
})();
|
4374
5115
|
|
4375
|
-
Raw.empty = new Raw();
|
4376
|
-
|
4377
5116
|
module.exports = Raw;
|
4378
5117
|
|
4379
5118
|
}).call(this);
|
4380
5119
|
|
4381
|
-
},{}],
|
5120
|
+
},{}],54:[function(_dereq_,module,exports){
|
4382
5121
|
(function() {
|
4383
5122
|
var Result;
|
4384
5123
|
|
4385
5124
|
Result = (function() {
|
4386
|
-
function Result(
|
4387
|
-
this.parsed = parsed;
|
5125
|
+
function Result(css, map) {
|
4388
5126
|
this.css = css;
|
5127
|
+
if (map) {
|
5128
|
+
this.map = map;
|
5129
|
+
}
|
4389
5130
|
}
|
4390
5131
|
|
4391
5132
|
Result.prototype.toString = function() {
|
@@ -4400,14 +5141,24 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4400
5141
|
|
4401
5142
|
}).call(this);
|
4402
5143
|
|
4403
|
-
},{}],
|
5144
|
+
},{}],55:[function(_dereq_,module,exports){
|
4404
5145
|
(function() {
|
4405
|
-
var Container, Root,
|
5146
|
+
var AtRule, Comment, Container, Declaration, MapGenerator, Root, Rule,
|
4406
5147
|
__hasProp = {}.hasOwnProperty,
|
4407
5148
|
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
4408
5149
|
|
5150
|
+
MapGenerator = _dereq_('./map-generator');
|
5151
|
+
|
5152
|
+
Declaration = _dereq_('./declaration');
|
5153
|
+
|
4409
5154
|
Container = _dereq_('./container');
|
4410
5155
|
|
5156
|
+
Comment = _dereq_('./comment');
|
5157
|
+
|
5158
|
+
AtRule = _dereq_('./at-rule');
|
5159
|
+
|
5160
|
+
Rule = _dereq_('./rule');
|
5161
|
+
|
4411
5162
|
Root = (function(_super) {
|
4412
5163
|
__extends(Root, _super);
|
4413
5164
|
|
@@ -4432,6 +5183,15 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4432
5183
|
}
|
4433
5184
|
};
|
4434
5185
|
|
5186
|
+
Root.prototype.toResult = function(opts) {
|
5187
|
+
var map;
|
5188
|
+
if (opts == null) {
|
5189
|
+
opts = {};
|
5190
|
+
}
|
5191
|
+
map = new MapGenerator(this, opts);
|
5192
|
+
return map.getResult();
|
5193
|
+
};
|
5194
|
+
|
4435
5195
|
return Root;
|
4436
5196
|
|
4437
5197
|
})(Container.WithRules);
|
@@ -4440,9 +5200,9 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4440
5200
|
|
4441
5201
|
}).call(this);
|
4442
5202
|
|
4443
|
-
},{"./container":
|
5203
|
+
},{"./at-rule":43,"./comment":44,"./container":45,"./declaration":46,"./map-generator":49,"./rule":56}],56:[function(_dereq_,module,exports){
|
4444
5204
|
(function() {
|
4445
|
-
var Container, Declaration, Rule,
|
5205
|
+
var Container, Declaration, Rule, list,
|
4446
5206
|
__hasProp = {}.hasOwnProperty,
|
4447
5207
|
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
|
4448
5208
|
|
@@ -4450,6 +5210,8 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4450
5210
|
|
4451
5211
|
Declaration = _dereq_('./declaration');
|
4452
5212
|
|
5213
|
+
list = _dereq_('./list');
|
5214
|
+
|
4453
5215
|
Rule = (function(_super) {
|
4454
5216
|
__extends(Rule, _super);
|
4455
5217
|
|
@@ -4458,12 +5220,37 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4458
5220
|
Rule.__super__.constructor.apply(this, arguments);
|
4459
5221
|
}
|
4460
5222
|
|
5223
|
+
Rule.prototype.styleType = function() {
|
5224
|
+
return this.type + (this.decls.length ? '-body' : '-empty');
|
5225
|
+
};
|
5226
|
+
|
5227
|
+
Rule.prototype.defaultStyle = function(type) {
|
5228
|
+
if (type === 'rule-body') {
|
5229
|
+
return {
|
5230
|
+
between: ' ',
|
5231
|
+
after: this.defaultAfter()
|
5232
|
+
};
|
5233
|
+
} else {
|
5234
|
+
return {
|
5235
|
+
between: ' ',
|
5236
|
+
after: ''
|
5237
|
+
};
|
5238
|
+
}
|
5239
|
+
};
|
5240
|
+
|
4461
5241
|
Rule.raw('selector');
|
4462
5242
|
|
5243
|
+
Rule.prop('selectors', {
|
5244
|
+
get: function() {
|
5245
|
+
return list.comma(this.selector);
|
5246
|
+
},
|
5247
|
+
set: function(values) {
|
5248
|
+
return this.selector = values.join(', ');
|
5249
|
+
}
|
5250
|
+
});
|
5251
|
+
|
4463
5252
|
Rule.prototype.stringify = function(builder) {
|
4464
|
-
return this.stringifyBlock(builder, this._selector.
|
4465
|
-
after: ' '
|
4466
|
-
}) + '{');
|
5253
|
+
return this.stringifyBlock(builder, this._selector + this.style().between + '{');
|
4467
5254
|
};
|
4468
5255
|
|
4469
5256
|
return Rule;
|
@@ -4474,7 +5261,7 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4474
5261
|
|
4475
5262
|
}).call(this);
|
4476
5263
|
|
4477
|
-
},{"./container":
|
5264
|
+
},{"./container":45,"./declaration":46,"./list":48}],57:[function(_dereq_,module,exports){
|
4478
5265
|
(function() {
|
4479
5266
|
var SyntaxError,
|
4480
5267
|
__hasProp = {}.hasOwnProperty,
|
@@ -4503,7 +5290,7 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4503
5290
|
|
4504
5291
|
}).call(this);
|
4505
5292
|
|
4506
|
-
},{}],
|
5293
|
+
},{}],58:[function(_dereq_,module,exports){
|
4507
5294
|
(function() {
|
4508
5295
|
var vendor;
|
4509
5296
|
|
@@ -4532,7 +5319,130 @@ var substr = 'ab'.substr(-1) === 'b'
|
|
4532
5319
|
|
4533
5320
|
}).call(this);
|
4534
5321
|
|
4535
|
-
},{}],
|
5322
|
+
},{}],59:[function(_dereq_,module,exports){
|
5323
|
+
var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
|
5324
|
+
|
5325
|
+
;(function (exports) {
|
5326
|
+
'use strict';
|
5327
|
+
|
5328
|
+
var Arr = (typeof Uint8Array !== 'undefined')
|
5329
|
+
? Uint8Array
|
5330
|
+
: Array
|
5331
|
+
|
5332
|
+
var ZERO = '0'.charCodeAt(0)
|
5333
|
+
var PLUS = '+'.charCodeAt(0)
|
5334
|
+
var SLASH = '/'.charCodeAt(0)
|
5335
|
+
var NUMBER = '0'.charCodeAt(0)
|
5336
|
+
var LOWER = 'a'.charCodeAt(0)
|
5337
|
+
var UPPER = 'A'.charCodeAt(0)
|
5338
|
+
|
5339
|
+
function decode (elt) {
|
5340
|
+
var code = elt.charCodeAt(0)
|
5341
|
+
if (code === PLUS)
|
5342
|
+
return 62 // '+'
|
5343
|
+
if (code === SLASH)
|
5344
|
+
return 63 // '/'
|
5345
|
+
if (code < NUMBER)
|
5346
|
+
return -1 //no match
|
5347
|
+
if (code < NUMBER + 10)
|
5348
|
+
return code - NUMBER + 26 + 26
|
5349
|
+
if (code < UPPER + 26)
|
5350
|
+
return code - UPPER
|
5351
|
+
if (code < LOWER + 26)
|
5352
|
+
return code - LOWER + 26
|
5353
|
+
}
|
5354
|
+
|
5355
|
+
function b64ToByteArray (b64) {
|
5356
|
+
var i, j, l, tmp, placeHolders, arr
|
5357
|
+
|
5358
|
+
if (b64.length % 4 > 0) {
|
5359
|
+
throw new Error('Invalid string. Length must be a multiple of 4')
|
5360
|
+
}
|
5361
|
+
|
5362
|
+
// the number of equal signs (place holders)
|
5363
|
+
// if there are two placeholders, than the two characters before it
|
5364
|
+
// represent one byte
|
5365
|
+
// if there is only one, then the three characters before it represent 2 bytes
|
5366
|
+
// this is just a cheap hack to not do indexOf twice
|
5367
|
+
var len = b64.length
|
5368
|
+
placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0
|
5369
|
+
|
5370
|
+
// base64 is 4/3 + up to two characters of the original data
|
5371
|
+
arr = new Arr(b64.length * 3 / 4 - placeHolders)
|
5372
|
+
|
5373
|
+
// if there are placeholders, only get up to the last complete 4 chars
|
5374
|
+
l = placeHolders > 0 ? b64.length - 4 : b64.length
|
5375
|
+
|
5376
|
+
var L = 0
|
5377
|
+
|
5378
|
+
function push (v) {
|
5379
|
+
arr[L++] = v
|
5380
|
+
}
|
5381
|
+
|
5382
|
+
for (i = 0, j = 0; i < l; i += 4, j += 3) {
|
5383
|
+
tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3))
|
5384
|
+
push((tmp & 0xFF0000) >> 16)
|
5385
|
+
push((tmp & 0xFF00) >> 8)
|
5386
|
+
push(tmp & 0xFF)
|
5387
|
+
}
|
5388
|
+
|
5389
|
+
if (placeHolders === 2) {
|
5390
|
+
tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4)
|
5391
|
+
push(tmp & 0xFF)
|
5392
|
+
} else if (placeHolders === 1) {
|
5393
|
+
tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2)
|
5394
|
+
push((tmp >> 8) & 0xFF)
|
5395
|
+
push(tmp & 0xFF)
|
5396
|
+
}
|
5397
|
+
|
5398
|
+
return arr
|
5399
|
+
}
|
5400
|
+
|
5401
|
+
function uint8ToBase64 (uint8) {
|
5402
|
+
var i,
|
5403
|
+
extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
|
5404
|
+
output = "",
|
5405
|
+
temp, length
|
5406
|
+
|
5407
|
+
function encode (num) {
|
5408
|
+
return lookup.charAt(num)
|
5409
|
+
}
|
5410
|
+
|
5411
|
+
function tripletToBase64 (num) {
|
5412
|
+
return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F)
|
5413
|
+
}
|
5414
|
+
|
5415
|
+
// go through the array every three bytes, we'll deal with trailing stuff later
|
5416
|
+
for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
|
5417
|
+
temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
|
5418
|
+
output += tripletToBase64(temp)
|
5419
|
+
}
|
5420
|
+
|
5421
|
+
// pad the end with zeros, but make sure to not forget the extra bytes
|
5422
|
+
switch (extraBytes) {
|
5423
|
+
case 1:
|
5424
|
+
temp = uint8[uint8.length - 1]
|
5425
|
+
output += encode(temp >> 2)
|
5426
|
+
output += encode((temp << 4) & 0x3F)
|
5427
|
+
output += '=='
|
5428
|
+
break
|
5429
|
+
case 2:
|
5430
|
+
temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1])
|
5431
|
+
output += encode(temp >> 10)
|
5432
|
+
output += encode((temp >> 4) & 0x3F)
|
5433
|
+
output += encode((temp << 2) & 0x3F)
|
5434
|
+
output += '='
|
5435
|
+
break
|
5436
|
+
}
|
5437
|
+
|
5438
|
+
return output
|
5439
|
+
}
|
5440
|
+
|
5441
|
+
module.exports.toByteArray = b64ToByteArray
|
5442
|
+
module.exports.fromByteArray = uint8ToBase64
|
5443
|
+
}())
|
5444
|
+
|
5445
|
+
},{}],60:[function(_dereq_,module,exports){
|
4536
5446
|
/*
|
4537
5447
|
* Copyright 2009-2011 Mozilla Foundation and contributors
|
4538
5448
|
* Licensed under the New BSD license. See LICENSE.txt or:
|
@@ -4542,7 +5452,7 @@ exports.SourceMapGenerator = _dereq_('./source-map/source-map-generator').Source
|
|
4542
5452
|
exports.SourceMapConsumer = _dereq_('./source-map/source-map-consumer').SourceMapConsumer;
|
4543
5453
|
exports.SourceNode = _dereq_('./source-map/source-node').SourceNode;
|
4544
5454
|
|
4545
|
-
},{"./source-map/source-map-consumer":
|
5455
|
+
},{"./source-map/source-map-consumer":65,"./source-map/source-map-generator":66,"./source-map/source-node":67}],61:[function(_dereq_,module,exports){
|
4546
5456
|
/* -*- Mode: js; js-indent-level: 2; -*- */
|
4547
5457
|
/*
|
4548
5458
|
* Copyright 2011 Mozilla Foundation and contributors
|
@@ -4641,7 +5551,7 @@ define(function (_dereq_, exports, module) {
|
|
4641
5551
|
|
4642
5552
|
});
|
4643
5553
|
|
4644
|
-
},{"./util":
|
5554
|
+
},{"./util":68,"amdefine":69}],62:[function(_dereq_,module,exports){
|
4645
5555
|
/* -*- Mode: js; js-indent-level: 2; -*- */
|
4646
5556
|
/*
|
4647
5557
|
* Copyright 2011 Mozilla Foundation and contributors
|
@@ -4787,7 +5697,7 @@ define(function (_dereq_, exports, module) {
|
|
4787
5697
|
|
4788
5698
|
});
|
4789
5699
|
|
4790
|
-
},{"./base64":
|
5700
|
+
},{"./base64":63,"amdefine":69}],63:[function(_dereq_,module,exports){
|
4791
5701
|
/* -*- Mode: js; js-indent-level: 2; -*- */
|
4792
5702
|
/*
|
4793
5703
|
* Copyright 2011 Mozilla Foundation and contributors
|
@@ -4831,7 +5741,7 @@ define(function (_dereq_, exports, module) {
|
|
4831
5741
|
|
4832
5742
|
});
|
4833
5743
|
|
4834
|
-
},{"amdefine":
|
5744
|
+
},{"amdefine":69}],64:[function(_dereq_,module,exports){
|
4835
5745
|
/* -*- Mode: js; js-indent-level: 2; -*- */
|
4836
5746
|
/*
|
4837
5747
|
* Copyright 2011 Mozilla Foundation and contributors
|
@@ -4914,7 +5824,7 @@ define(function (_dereq_, exports, module) {
|
|
4914
5824
|
|
4915
5825
|
});
|
4916
5826
|
|
4917
|
-
},{"amdefine":
|
5827
|
+
},{"amdefine":69}],65:[function(_dereq_,module,exports){
|
4918
5828
|
/* -*- Mode: js; js-indent-level: 2; -*- */
|
4919
5829
|
/*
|
4920
5830
|
* Copyright 2011 Mozilla Foundation and contributors
|
@@ -5394,7 +6304,7 @@ define(function (_dereq_, exports, module) {
|
|
5394
6304
|
|
5395
6305
|
});
|
5396
6306
|
|
5397
|
-
},{"./array-set":
|
6307
|
+
},{"./array-set":61,"./base64-vlq":62,"./binary-search":64,"./util":68,"amdefine":69}],66:[function(_dereq_,module,exports){
|
5398
6308
|
/* -*- Mode: js; js-indent-level: 2; -*- */
|
5399
6309
|
/*
|
5400
6310
|
* Copyright 2011 Mozilla Foundation and contributors
|
@@ -5776,7 +6686,7 @@ define(function (_dereq_, exports, module) {
|
|
5776
6686
|
|
5777
6687
|
});
|
5778
6688
|
|
5779
|
-
},{"./array-set":
|
6689
|
+
},{"./array-set":61,"./base64-vlq":62,"./util":68,"amdefine":69}],67:[function(_dereq_,module,exports){
|
5780
6690
|
/* -*- Mode: js; js-indent-level: 2; -*- */
|
5781
6691
|
/*
|
5782
6692
|
* Copyright 2011 Mozilla Foundation and contributors
|
@@ -6149,7 +7059,7 @@ define(function (_dereq_, exports, module) {
|
|
6149
7059
|
|
6150
7060
|
});
|
6151
7061
|
|
6152
|
-
},{"./source-map-generator":
|
7062
|
+
},{"./source-map-generator":66,"./util":68,"amdefine":69}],68:[function(_dereq_,module,exports){
|
6153
7063
|
/* -*- Mode: js; js-indent-level: 2; -*- */
|
6154
7064
|
/*
|
6155
7065
|
* Copyright 2011 Mozilla Foundation and contributors
|
@@ -6356,7 +7266,7 @@ define(function (_dereq_, exports, module) {
|
|
6356
7266
|
|
6357
7267
|
});
|
6358
7268
|
|
6359
|
-
},{"amdefine":
|
7269
|
+
},{"amdefine":69}],69:[function(_dereq_,module,exports){
|
6360
7270
|
(function (process,__filename){
|
6361
7271
|
/** vim: et:ts=4:sw=4:sts=4
|
6362
7272
|
* @license amdefine 0.1.0 Copyright (c) 2011, The Dojo Foundation All Rights Reserved.
|
@@ -6659,6 +7569,6 @@ function amdefine(module, requireFn) {
|
|
6659
7569
|
module.exports = amdefine;
|
6660
7570
|
|
6661
7571
|
}).call(this,_dereq_("/home/ai/Dev/autoprefixer/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js"),"/../node_modules/postcss/node_modules/source-map/node_modules/amdefine/amdefine.js")
|
6662
|
-
},{"/home/ai/Dev/autoprefixer/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":
|
7572
|
+
},{"/home/ai/Dev/autoprefixer/node_modules/browserify/node_modules/insert-module-globals/node_modules/process/browser.js":41,"path":42}]},{},[3])
|
6663
7573
|
(3)
|
6664
7574
|
});
|