stylus-source 0.23.0 → 0.24.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +5 -5
- data/VERSION +1 -1
- data/vendor/lib/functions/index.js +11 -12
- data/vendor/lib/functions/index.styl +45 -0
- data/vendor/lib/parser.js +13 -0
- data/vendor/lib/stylus.js +1 -1
- data/vendor/lib/visitor/evaluator.js +8 -0
- data/vendor/node_modules/cssom/Jakefile.js +35 -0
- data/vendor/node_modules/cssom/lib/CSSImportRule.js +10 -9
- data/vendor/node_modules/cssom/lib/CSSKeyframeRule.js +2 -0
- data/vendor/node_modules/cssom/lib/CSSKeyframesRule.js +2 -1
- data/vendor/node_modules/cssom/lib/CSSMediaRule.js +2 -1
- data/vendor/node_modules/cssom/lib/CSSRule.js +1 -0
- data/vendor/node_modules/cssom/lib/CSSStyleDeclaration.js +7 -5
- data/vendor/node_modules/cssom/lib/CSSStyleRule.js +11 -9
- data/vendor/node_modules/cssom/lib/CSSStyleSheet.js +4 -4
- data/vendor/node_modules/cssom/lib/MediaList.js +3 -3
- data/vendor/node_modules/cssom/lib/StyleSheet.js +3 -1
- data/vendor/node_modules/cssom/lib/clone.js +5 -5
- data/vendor/node_modules/cssom/lib/index.js +14 -12
- data/vendor/node_modules/cssom/lib/parse.js +48 -43
- data/vendor/node_modules/cssom/package.json +5 -4
- data/vendor/node_modules/debug/History.md +35 -0
- data/vendor/node_modules/debug/Makefile +5 -0
- data/vendor/node_modules/debug/Readme.md +128 -0
- data/vendor/node_modules/debug/debug.js +111 -0
- data/vendor/node_modules/debug/example/app.js +19 -0
- data/vendor/node_modules/debug/example/browser.html +24 -0
- data/vendor/node_modules/debug/example/wildcards.js +10 -0
- data/vendor/node_modules/debug/example/worker.js +22 -0
- data/vendor/node_modules/debug/index.js +2 -0
- data/vendor/node_modules/debug/lib/debug.js +129 -0
- data/vendor/node_modules/debug/package.json +11 -0
- data/vendor/node_modules/growl/History.md +21 -0
- data/vendor/node_modules/growl/Readme.md +29 -20
- data/vendor/node_modules/growl/lib/growl.js +113 -36
- data/vendor/node_modules/growl/package.json +1 -1
- data/vendor/node_modules/growl/test.js +12 -13
- data/vendor/node_modules/mkdirp/README.markdown +35 -2
- data/vendor/node_modules/mkdirp/examples/pow.js +1 -1
- data/vendor/node_modules/mkdirp/index.js +72 -13
- data/vendor/node_modules/mkdirp/package.json +2 -2
- data/vendor/node_modules/mkdirp/test/chmod.js +38 -0
- data/vendor/node_modules/mkdirp/test/clobber.js +37 -0
- data/vendor/node_modules/mkdirp/test/perm.js +32 -0
- data/vendor/node_modules/mkdirp/test/perm_sync.js +39 -0
- data/vendor/node_modules/mkdirp/test/sync.js +27 -0
- data/vendor/node_modules/mkdirp/test/umask.js +28 -0
- data/vendor/node_modules/mkdirp/test/umask_sync.js +27 -0
- data/vendor/package.json +6 -5
- data/vendor/testing/test.css +39 -0
- data/vendor/testing/test.html +21 -0
- data/vendor/testing/test.js +5 -3
- data/vendor/testing/test.styl +42 -2
- metadata +23 -542
- data/vendor/History.md +0 -672
- data/vendor/Makefile +0 -20
- data/vendor/Readme.md +0 -155
- data/vendor/docs/bifs.md +0 -598
- data/vendor/docs/comments.md +0 -35
- data/vendor/docs/compare.md +0 -81
- data/vendor/docs/conditionals.md +0 -107
- data/vendor/docs/css-style.md +0 -77
- data/vendor/docs/error-reporting.md +0 -50
- data/vendor/docs/escape.md +0 -28
- data/vendor/docs/executable.md +0 -163
- data/vendor/docs/extend.md +0 -123
- data/vendor/docs/firebug.md +0 -59
- data/vendor/docs/font-face.md +0 -26
- data/vendor/docs/functions.md +0 -197
- data/vendor/docs/functions.url.md +0 -32
- data/vendor/docs/gedit.md +0 -24
- data/vendor/docs/import.md +0 -75
- data/vendor/docs/interpolation.md +0 -55
- data/vendor/docs/introspection.md +0 -38
- data/vendor/docs/iteration.md +0 -102
- data/vendor/docs/js.md +0 -157
- data/vendor/docs/keyframes.md +0 -122
- data/vendor/docs/kwargs.md +0 -34
- data/vendor/docs/literal.md +0 -16
- data/vendor/docs/media.md +0 -18
- data/vendor/docs/middleware.md +0 -72
- data/vendor/docs/mixins.md +0 -138
- data/vendor/docs/operators.md +0 -470
- data/vendor/docs/selectors.md +0 -133
- data/vendor/docs/textmate.md +0 -4
- data/vendor/docs/vargs.md +0 -84
- data/vendor/docs/variables.md +0 -85
- data/vendor/editors/Stylus.tmbundle/Commands/Compile and Display CSS.tmCommand +0 -33
- data/vendor/editors/Stylus.tmbundle/Preferences/Comments.tmPreferences +0 -36
- data/vendor/editors/Stylus.tmbundle/Syntaxes/Stylus.tmLanguage +0 -228
- data/vendor/editors/Stylus.tmbundle/info.plist +0 -10
- data/vendor/editors/gedit/styl.lang +0 -475
- data/vendor/examples/arithmetic.js +0 -12
- data/vendor/examples/arithmetic.styl +0 -29
- data/vendor/examples/basic.js +0 -12
- data/vendor/examples/basic.styl +0 -8
- data/vendor/examples/builtins.js +0 -12
- data/vendor/examples/builtins.styl +0 -56
- data/vendor/examples/comments.js +0 -11
- data/vendor/examples/comments.styl +0 -15
- data/vendor/examples/compress.js +0 -12
- data/vendor/examples/conversions.js +0 -12
- data/vendor/examples/conversions.styl +0 -34
- data/vendor/examples/functions.js +0 -12
- data/vendor/examples/functions.styl +0 -30
- data/vendor/examples/gradients.js +0 -13
- data/vendor/examples/gradients.styl +0 -8
- data/vendor/examples/images/gopher.jpg +0 -0
- data/vendor/examples/images/gradient.svg +0 -9
- data/vendor/examples/images/jesus.gif +0 -0
- data/vendor/examples/images/sprite.gif +0 -0
- data/vendor/examples/images.js +0 -20
- data/vendor/examples/images.styl +0 -15
- data/vendor/examples/implicit-functions.js +0 -12
- data/vendor/examples/implicit-functions.styl +0 -23
- data/vendor/examples/import.js +0 -12
- data/vendor/examples/import.styl +0 -11
- data/vendor/examples/js-functions.js +0 -55
- data/vendor/examples/js-functions.styl +0 -23
- data/vendor/examples/literal.js +0 -12
- data/vendor/examples/literal.styl +0 -8
- data/vendor/examples/middleware.js +0 -23
- data/vendor/examples/mixins/box.styl +0 -14
- data/vendor/examples/mixins/gradients.styl +0 -92
- data/vendor/examples/nesting.js +0 -12
- data/vendor/examples/nesting.styl +0 -14
- data/vendor/examples/variables.js +0 -12
- data/vendor/examples/variables.styl +0 -24
- data/vendor/node_modules/cssom/Jakefile +0 -37
- data/vendor/node_modules/cssom/MIT-LICENSE.txt +0 -20
- data/vendor/node_modules/cssom/README.mdown +0 -34
- data/vendor/node_modules/cssom/Rakefile +0 -23
- data/vendor/node_modules/cssom/animation.html +0 -27
- data/vendor/node_modules/cssom/bench.html +0 -47
- data/vendor/node_modules/cssom/comments.js +0 -63
- data/vendor/node_modules/cssom/docs/bar.css +0 -3
- data/vendor/node_modules/cssom/docs/col_table.html +0 -15
- data/vendor/node_modules/cssom/docs/cols.html +0 -14
- data/vendor/node_modules/cssom/docs/cols_inline-blocks.html +0 -33
- data/vendor/node_modules/cssom/docs/demo.css +0 -0
- data/vendor/node_modules/cssom/docs/diff.html +0 -132
- data/vendor/node_modules/cssom/docs/foo.css +0 -4
- data/vendor/node_modules/cssom/docs/parse.html +0 -282
- data/vendor/node_modules/cssom/docs/parse.html_ +0 -268
- data/vendor/node_modules/cssom/docs/parse2.html +0 -518
- data/vendor/node_modules/cssom/docs/parser.html +0 -31
- data/vendor/node_modules/cssom/index.html +0 -100
- data/vendor/node_modules/cssom/lib/CSSOM.js +0 -3
- data/vendor/node_modules/cssom/lib/Parser.js +0 -362
- data/vendor/node_modules/cssom/media.html +0 -17
- data/vendor/node_modules/cssom/plugins/toHTML.js +0 -32
- data/vendor/node_modules/cssom/server/index.html +0 -22
- data/vendor/node_modules/cssom/server/index.js +0 -21
- data/vendor/node_modules/cssom/shorthands.html +0 -21
- data/vendor/node_modules/cssom/strings.html +0 -10
- data/vendor/node_modules/cssom/test/CSSImportRule.test.js +0 -52
- data/vendor/node_modules/cssom/test/CSSStyleDeclaration.test.js +0 -42
- data/vendor/node_modules/cssom/test/CSSStyleRule.test.js +0 -12
- data/vendor/node_modules/cssom/test/CSSStyleSheet.test.js +0 -16
- data/vendor/node_modules/cssom/test/MediaList.test.js +0 -21
- data/vendor/node_modules/cssom/test/_helper.js +0 -122
- data/vendor/node_modules/cssom/test/clone.test.js +0 -38
- data/vendor/node_modules/cssom/test/fixtures/dummy.css +0 -3
- data/vendor/node_modules/cssom/test/helper.js +0 -122
- data/vendor/node_modules/cssom/test/index.html +0 -45
- data/vendor/node_modules/cssom/test/parse.test.js +0 -718
- data/vendor/node_modules/cssom/test/vendor/qunit.css +0 -189
- data/vendor/node_modules/cssom/test/vendor/qunit.js +0 -1415
- data/vendor/test/cases/arithmetic.color.css +0 -44
- data/vendor/test/cases/arithmetic.color.styl +0 -48
- data/vendor/test/cases/arithmetic.css +0 -23
- data/vendor/test/cases/arithmetic.styl +0 -30
- data/vendor/test/cases/arithmetic.unary.css +0 -16
- data/vendor/test/cases/arithmetic.unary.styl +0 -16
- data/vendor/test/cases/atscope.css +0 -21
- data/vendor/test/cases/atscope.styl +0 -23
- data/vendor/test/cases/bifs.add-property.css +0 -21
- data/vendor/test/cases/bifs.add-property.styl +0 -48
- data/vendor/test/cases/bifs.components.css +0 -9
- data/vendor/test/cases/bifs.components.styl +0 -9
- data/vendor/test/cases/bifs.dark.css +0 -5
- data/vendor/test/cases/bifs.dark.styl +0 -4
- data/vendor/test/cases/bifs.darken.css +0 -8
- data/vendor/test/cases/bifs.darken.styl +0 -9
- data/vendor/test/cases/bifs.fade.css +0 -6
- data/vendor/test/cases/bifs.fade.styl +0 -6
- data/vendor/test/cases/bifs.image-size.css +0 -9
- data/vendor/test/cases/bifs.image-size.styl +0 -16
- data/vendor/test/cases/bifs.join.css +0 -18
- data/vendor/test/cases/bifs.join.styl +0 -21
- data/vendor/test/cases/bifs.keys.css +0 -4
- data/vendor/test/cases/bifs.keys.styl +0 -6
- data/vendor/test/cases/bifs.last.css +0 -5
- data/vendor/test/cases/bifs.last.styl +0 -6
- data/vendor/test/cases/bifs.length.css +0 -10
- data/vendor/test/cases/bifs.length.styl +0 -18
- data/vendor/test/cases/bifs.light.css +0 -5
- data/vendor/test/cases/bifs.light.styl +0 -4
- data/vendor/test/cases/bifs.lighten.css +0 -14
- data/vendor/test/cases/bifs.lighten.styl +0 -14
- data/vendor/test/cases/bifs.lookup.css +0 -3
- data/vendor/test/cases/bifs.lookup.styl +0 -8
- data/vendor/test/cases/bifs.match.css +0 -4
- data/vendor/test/cases/bifs.match.styl +0 -9
- data/vendor/test/cases/bifs.opposite-position.css +0 -8
- data/vendor/test/cases/bifs.opposite-position.styl +0 -9
- data/vendor/test/cases/bifs.push.css +0 -25
- data/vendor/test/cases/bifs.push.styl +0 -48
- data/vendor/test/cases/bifs.rgba.css +0 -5
- data/vendor/test/cases/bifs.rgba.styl +0 -4
- data/vendor/test/cases/bifs.s.css +0 -11
- data/vendor/test/cases/bifs.s.styl +0 -12
- data/vendor/test/cases/bifs.type.css +0 -11
- data/vendor/test/cases/bifs.type.styl +0 -12
- data/vendor/test/cases/bifs.unit.css +0 -6
- data/vendor/test/cases/bifs.unit.styl +0 -5
- data/vendor/test/cases/bifs.unquote.css +0 -5
- data/vendor/test/cases/bifs.unquote.styl +0 -8
- data/vendor/test/cases/bifs.url.css +0 -11
- data/vendor/test/cases/bifs.url.styl +0 -15
- data/vendor/test/cases/bifs.values.css +0 -5
- data/vendor/test/cases/bifs.values.styl +0 -6
- data/vendor/test/cases/casting.css +0 -12
- data/vendor/test/cases/casting.styl +0 -14
- data/vendor/test/cases/coercion.css +0 -6
- data/vendor/test/cases/coercion.styl +0 -5
- data/vendor/test/cases/comments.css +0 -18
- data/vendor/test/cases/comments.styl +0 -28
- data/vendor/test/cases/compress.comments.css +0 -2
- data/vendor/test/cases/compress.comments.styl +0 -5
- data/vendor/test/cases/compress.units.css +0 -2
- data/vendor/test/cases/compress.units.styl +0 -18
- data/vendor/test/cases/conditional-assignment.css +0 -4
- data/vendor/test/cases/conditional-assignment.styl +0 -9
- data/vendor/test/cases/control.blueprint.ie.css +0 -126
- data/vendor/test/cases/control.blueprint.ie.styl +0 -36
- data/vendor/test/cases/control.blueprint.screen.css +0 -1103
- data/vendor/test/cases/control.blueprint.screen.styl +0 -265
- data/vendor/test/cases/control.boilerplate.css +0 -473
- data/vendor/test/cases/control.boilerplate.styl +0 -265
- data/vendor/test/cases/css.extend.css +0 -13
- data/vendor/test/cases/css.extend.styl +0 -15
- data/vendor/test/cases/css.functions.single-line.css +0 -9
- data/vendor/test/cases/css.functions.single-line.styl +0 -13
- data/vendor/test/cases/css.if.css +0 -8
- data/vendor/test/cases/css.if.styl +0 -21
- data/vendor/test/cases/css.keyframes.css +0 -57
- data/vendor/test/cases/css.keyframes.styl +0 -48
- data/vendor/test/cases/css.large.css +0 -172
- data/vendor/test/cases/css.large.styl +0 -172
- data/vendor/test/cases/css.media.css +0 -15
- data/vendor/test/cases/css.media.styl +0 -17
- data/vendor/test/cases/css.mixins.braces.css +0 -38
- data/vendor/test/cases/css.mixins.braces.styl +0 -53
- data/vendor/test/cases/css.mixins.css +0 -38
- data/vendor/test/cases/css.mixins.root.css +0 -26
- data/vendor/test/cases/css.mixins.root.styl +0 -25
- data/vendor/test/cases/css.mixins.root.wonky.css +0 -26
- data/vendor/test/cases/css.mixins.root.wonky.styl +0 -17
- data/vendor/test/cases/css.mixins.styl +0 -47
- data/vendor/test/cases/css.selector.interpolation.css +0 -91
- data/vendor/test/cases/css.selector.interpolation.styl +0 -90
- data/vendor/test/cases/css.selectors.css +0 -38
- data/vendor/test/cases/css.selectors.styl +0 -53
- data/vendor/test/cases/css.whitespace.css +0 -37
- data/vendor/test/cases/css.whitespace.styl +0 -38
- data/vendor/test/cases/dumb.css +0 -10
- data/vendor/test/cases/dumb.styl +0 -11
- data/vendor/test/cases/eol-escape.css +0 -11
- data/vendor/test/cases/eol-escape.styl +0 -27
- data/vendor/test/cases/escape.css +0 -4
- data/vendor/test/cases/escape.styl +0 -4
- data/vendor/test/cases/extend.complex.css +0 -16
- data/vendor/test/cases/extend.complex.styl +0 -15
- data/vendor/test/cases/extend.css +0 -22
- data/vendor/test/cases/extend.multiple-definitions.css +0 -11
- data/vendor/test/cases/extend.multiple-definitions.styl +0 -9
- data/vendor/test/cases/extend.styl +0 -22
- data/vendor/test/cases/fontface.css +0 -4
- data/vendor/test/cases/fontface.styl +0 -5
- data/vendor/test/cases/for.complex.css +0 -44
- data/vendor/test/cases/for.complex.styl +0 -28
- data/vendor/test/cases/for.css +0 -52
- data/vendor/test/cases/for.function.css +0 -20
- data/vendor/test/cases/for.function.styl +0 -51
- data/vendor/test/cases/for.styl +0 -44
- data/vendor/test/cases/function.arguments.css +0 -4
- data/vendor/test/cases/function.arguments.styl +0 -14
- data/vendor/test/cases/function.literals.css +0 -6
- data/vendor/test/cases/function.literals.styl +0 -12
- data/vendor/test/cases/functions.arg-calls.css +0 -3
- data/vendor/test/cases/functions.arg-calls.styl +0 -9
- data/vendor/test/cases/functions.call.css +0 -4
- data/vendor/test/cases/functions.call.styl +0 -7
- data/vendor/test/cases/functions.css +0 -11
- data/vendor/test/cases/functions.defaults.css +0 -15
- data/vendor/test/cases/functions.defaults.styl +0 -30
- data/vendor/test/cases/functions.multi-line.css +0 -9
- data/vendor/test/cases/functions.multi-line.styl +0 -25
- data/vendor/test/cases/functions.multiple-calls.css +0 -13
- data/vendor/test/cases/functions.multiple-calls.styl +0 -26
- data/vendor/test/cases/functions.nested-calls.css +0 -3
- data/vendor/test/cases/functions.nested-calls.styl +0 -9
- data/vendor/test/cases/functions.nested.css +0 -10
- data/vendor/test/cases/functions.nested.styl +0 -37
- data/vendor/test/cases/functions.property.css +0 -10
- data/vendor/test/cases/functions.property.styl +0 -11
- data/vendor/test/cases/functions.return.css +0 -15
- data/vendor/test/cases/functions.return.each.css +0 -10
- data/vendor/test/cases/functions.return.each.styl +0 -23
- data/vendor/test/cases/functions.return.styl +0 -86
- data/vendor/test/cases/functions.styl +0 -34
- data/vendor/test/cases/functions.variable.css +0 -9
- data/vendor/test/cases/functions.variable.ident.css +0 -3
- data/vendor/test/cases/functions.variable.ident.styl +0 -11
- data/vendor/test/cases/functions.variable.styl +0 -27
- data/vendor/test/cases/hack.star.css +0 -27
- data/vendor/test/cases/hack.star.styl +0 -37
- data/vendor/test/cases/if.css +0 -43
- data/vendor/test/cases/if.else.css +0 -6
- data/vendor/test/cases/if.else.styl +0 -16
- data/vendor/test/cases/if.mixin.css +0 -7
- data/vendor/test/cases/if.mixin.styl +0 -24
- data/vendor/test/cases/if.postfix.css +0 -61
- data/vendor/test/cases/if.postfix.styl +0 -110
- data/vendor/test/cases/if.selectors.css +0 -16
- data/vendor/test/cases/if.selectors.styl +0 -22
- data/vendor/test/cases/if.styl +0 -99
- data/vendor/test/cases/import.basic/a.styl +0 -5
- data/vendor/test/cases/import.basic/b.styl +0 -5
- data/vendor/test/cases/import.basic/c.styl +0 -3
- data/vendor/test/cases/import.basic.css +0 -11
- data/vendor/test/cases/import.basic.styl +0 -4
- data/vendor/test/cases/import.complex/a.styl +0 -4
- data/vendor/test/cases/import.complex/c.styl +0 -2
- data/vendor/test/cases/import.complex/nested/b.styl +0 -4
- data/vendor/test/cases/import.complex.css +0 -9
- data/vendor/test/cases/import.complex.styl +0 -1
- data/vendor/test/cases/import.index/vendor/a.styl +0 -2
- data/vendor/test/cases/import.index/vendor/b.styl +0 -2
- data/vendor/test/cases/import.index/vendor/c.styl +0 -2
- data/vendor/test/cases/import.index/vendor/index.styl +0 -4
- data/vendor/test/cases/import.index.css +0 -9
- data/vendor/test/cases/import.index.styl +0 -2
- data/vendor/test/cases/import.literal.css +0 -2
- data/vendor/test/cases/import.literal.styl +0 -3
- data/vendor/test/cases/import.mixins.css +0 -7
- data/vendor/test/cases/import.mixins.styl +0 -9
- data/vendor/test/cases/import.ordering/five.styl +0 -2
- data/vendor/test/cases/import.ordering/four.styl +0 -4
- data/vendor/test/cases/import.ordering/two.styl +0 -2
- data/vendor/test/cases/import.ordering.css +0 -15
- data/vendor/test/cases/import.ordering.styl +0 -12
- data/vendor/test/cases/important.css +0 -6
- data/vendor/test/cases/important.styl +0 -6
- data/vendor/test/cases/interpolation.properties.css +0 -40
- data/vendor/test/cases/interpolation.properties.styl +0 -56
- data/vendor/test/cases/introspection.css +0 -7
- data/vendor/test/cases/introspection.styl +0 -14
- data/vendor/test/cases/jquery.css +0 -3
- data/vendor/test/cases/jquery.styl +0 -5
- data/vendor/test/cases/keyframes.css +0 -9
- data/vendor/test/cases/keyframes.fabrication.css +0 -18
- data/vendor/test/cases/keyframes.fabrication.defaults.css +0 -45
- data/vendor/test/cases/keyframes.fabrication.defaults.styl +0 -9
- data/vendor/test/cases/keyframes.fabrication.styl +0 -11
- data/vendor/test/cases/keyframes.newlines.css +0 -45
- data/vendor/test/cases/keyframes.newlines.styl +0 -7
- data/vendor/test/cases/keyframes.styl +0 -6
- data/vendor/test/cases/kwargs.css +0 -63
- data/vendor/test/cases/kwargs.styl +0 -74
- data/vendor/test/cases/list.css +0 -3
- data/vendor/test/cases/list.styl +0 -3
- data/vendor/test/cases/literal.color.css +0 -10
- data/vendor/test/cases/literal.color.styl +0 -9
- data/vendor/test/cases/literal.css +0 -10
- data/vendor/test/cases/literal.styl +0 -18
- data/vendor/test/cases/media.css +0 -14
- data/vendor/test/cases/media.styl +0 -11
- data/vendor/test/cases/mixin.conditional.css +0 -19
- data/vendor/test/cases/mixin.conditional.styl +0 -36
- data/vendor/test/cases/mixin.order.conditional.css +0 -11
- data/vendor/test/cases/mixin.order.conditional.styl +0 -20
- data/vendor/test/cases/mixin.order.css +0 -9
- data/vendor/test/cases/mixin.order.nested.css +0 -9
- data/vendor/test/cases/mixin.order.nested.styl +0 -21
- data/vendor/test/cases/mixin.order.styl +0 -20
- data/vendor/test/cases/mixins/box.styl +0 -11
- data/vendor/test/cases/mixins.complex.css +0 -30
- data/vendor/test/cases/mixins.complex.fix-to.css +0 -15
- data/vendor/test/cases/mixins.complex.fix-to.styl +0 -28
- data/vendor/test/cases/mixins.complex.styl +0 -41
- data/vendor/test/cases/mixins.conditional.css +0 -3
- data/vendor/test/cases/mixins.conditional.styl +0 -8
- data/vendor/test/cases/mixins.nested.css +0 -7
- data/vendor/test/cases/mixins.nested.selectors.css +0 -21
- data/vendor/test/cases/mixins.nested.selectors.styl +0 -31
- data/vendor/test/cases/mixins.nested.styl +0 -14
- data/vendor/test/cases/mixins.order.2.css +0 -11
- data/vendor/test/cases/mixins.order.2.styl +0 -16
- data/vendor/test/cases/mixins.reset.css +0 -75
- data/vendor/test/cases/mixins.reset.styl +0 -27
- data/vendor/test/cases/mixins.return.css +0 -4
- data/vendor/test/cases/mixins.return.styl +0 -8
- data/vendor/test/cases/mixins.root.css +0 -3
- data/vendor/test/cases/mixins.root.styl +0 -5
- data/vendor/test/cases/operator.range.css +0 -15
- data/vendor/test/cases/operator.range.styl +0 -23
- data/vendor/test/cases/operators.assignment.function.css +0 -15
- data/vendor/test/cases/operators.assignment.function.styl +0 -34
- data/vendor/test/cases/operators.assignment.mixin.css +0 -15
- data/vendor/test/cases/operators.assignment.mixin.styl +0 -39
- data/vendor/test/cases/operators.assignment.root.css +0 -25
- data/vendor/test/cases/operators.assignment.root.styl +0 -55
- data/vendor/test/cases/operators.complex.css +0 -9
- data/vendor/test/cases/operators.complex.styl +0 -32
- data/vendor/test/cases/operators.css +0 -40
- data/vendor/test/cases/operators.equality.css +0 -55
- data/vendor/test/cases/operators.equality.styl +0 -55
- data/vendor/test/cases/operators.in.css +0 -37
- data/vendor/test/cases/operators.in.styl +0 -51
- data/vendor/test/cases/operators.mixins.css +0 -10
- data/vendor/test/cases/operators.mixins.styl +0 -25
- data/vendor/test/cases/operators.precedence.css +0 -51
- data/vendor/test/cases/operators.precedence.styl +0 -82
- data/vendor/test/cases/operators.styl +0 -96
- data/vendor/test/cases/operators.subscript.assign.css +0 -21
- data/vendor/test/cases/operators.subscript.assign.styl +0 -45
- data/vendor/test/cases/operators.subscript.css +0 -59
- data/vendor/test/cases/operators.subscript.range.css +0 -14
- data/vendor/test/cases/operators.subscript.range.styl +0 -15
- data/vendor/test/cases/operators.subscript.styl +0 -81
- data/vendor/test/cases/page.css +0 -16
- data/vendor/test/cases/page.styl +0 -17
- data/vendor/test/cases/parent.css +0 -32
- data/vendor/test/cases/parent.styl +0 -33
- data/vendor/test/cases/properties.colons.css +0 -8
- data/vendor/test/cases/properties.colons.styl +0 -10
- data/vendor/test/cases/properties.css +0 -4
- data/vendor/test/cases/properties.one-line.css +0 -10
- data/vendor/test/cases/properties.one-line.styl +0 -11
- data/vendor/test/cases/properties.styl +0 -4
- data/vendor/test/cases/property-access.bubble.css +0 -38
- data/vendor/test/cases/property-access.bubble.styl +0 -46
- data/vendor/test/cases/property-access.css +0 -48
- data/vendor/test/cases/property-access.siblings.css +0 -19
- data/vendor/test/cases/property-access.siblings.styl +0 -20
- data/vendor/test/cases/property-access.styl +0 -62
- data/vendor/test/cases/regression.107.lookup-failure.css +0 -12
- data/vendor/test/cases/regression.107.lookup-failure.styl +0 -13
- data/vendor/test/cases/regression.127.css +0 -3
- data/vendor/test/cases/regression.127.styl +0 -2
- data/vendor/test/cases/regression.130.css +0 -16
- data/vendor/test/cases/regression.130.styl +0 -6
- data/vendor/test/cases/regression.131.css +0 -7
- data/vendor/test/cases/regression.131.styl +0 -2
- data/vendor/test/cases/regression.137.css +0 -7
- data/vendor/test/cases/regression.137.styl +0 -7
- data/vendor/test/cases/regression.139.css +0 -5
- data/vendor/test/cases/regression.139.styl +0 -21
- data/vendor/test/cases/regression.142.css +0 -39
- data/vendor/test/cases/regression.142.styl +0 -54
- data/vendor/test/cases/regression.146.css +0 -30
- data/vendor/test/cases/regression.146.styl +0 -31
- data/vendor/test/cases/regression.153.css +0 -8
- data/vendor/test/cases/regression.153.styl +0 -9
- data/vendor/test/cases/regression.154.css +0 -8
- data/vendor/test/cases/regression.154.styl +0 -14
- data/vendor/test/cases/regression.156.css +0 -4
- data/vendor/test/cases/regression.156.styl +0 -6
- data/vendor/test/cases/regression.212.css +0 -15
- data/vendor/test/cases/regression.212.styl +0 -14
- data/vendor/test/cases/regression.216.css +0 -10
- data/vendor/test/cases/regression.216.styl +0 -8
- data/vendor/test/cases/regression.220.css +0 -5
- data/vendor/test/cases/regression.220.styl +0 -5
- data/vendor/test/cases/regression.229.css +0 -12
- data/vendor/test/cases/regression.229.styl +0 -9
- data/vendor/test/cases/regression.233.css +0 -6
- data/vendor/test/cases/regression.233.styl +0 -7
- data/vendor/test/cases/regression.235.css +0 -11
- data/vendor/test/cases/regression.235.styl +0 -13
- data/vendor/test/cases/regression.243.css +0 -3
- data/vendor/test/cases/regression.243.styl +0 -4
- data/vendor/test/cases/regression.244.css +0 -3
- data/vendor/test/cases/regression.244.styl +0 -3
- data/vendor/test/cases/regression.247.css +0 -6
- data/vendor/test/cases/regression.247.styl +0 -6
- data/vendor/test/cases/regression.248.compressed.css +0 -4
- data/vendor/test/cases/regression.248.compressed.styl +0 -10
- data/vendor/test/cases/regression.252.css +0 -13
- data/vendor/test/cases/regression.252.styl +0 -13
- data/vendor/test/cases/regression.260.css +0 -6
- data/vendor/test/cases/regression.260.styl +0 -6
- data/vendor/test/cases/regression.267.css +0 -3
- data/vendor/test/cases/regression.267.styl +0 -3
- data/vendor/test/cases/regression.270.css +0 -5
- data/vendor/test/cases/regression.270.styl +0 -7
- data/vendor/test/cases/regression.272.css +0 -11
- data/vendor/test/cases/regression.272.styl +0 -17
- data/vendor/test/cases/regression.274.css +0 -14
- data/vendor/test/cases/regression.274.styl +0 -16
- data/vendor/test/cases/regression.292.css +0 -3
- data/vendor/test/cases/regression.292.styl +0 -3
- data/vendor/test/cases/regression.360.css +0 -19
- data/vendor/test/cases/regression.360.styl +0 -1
- data/vendor/test/cases/regression.368.css +0 -4
- data/vendor/test/cases/regression.368.styl +0 -3
- data/vendor/test/cases/regression.379.css +0 -6
- data/vendor/test/cases/regression.379.styl +0 -10
- data/vendor/test/cases/regression.380.css +0 -8
- data/vendor/test/cases/regression.380.styl +0 -14
- data/vendor/test/cases/regression.388.css +0 -2
- data/vendor/test/cases/regression.388.styl +0 -6
- data/vendor/test/cases/regression.415.css +0 -5
- data/vendor/test/cases/regression.415.styl +0 -3
- data/vendor/test/cases/regression.420.css +0 -21
- data/vendor/test/cases/regression.420.styl +0 -29
- data/vendor/test/cases/regression.432.css +0 -5
- data/vendor/test/cases/regression.432.styl +0 -4
- data/vendor/test/cases/regression.440.css +0 -5
- data/vendor/test/cases/regression.440.styl +0 -7
- data/vendor/test/cases/regression.449.css +0 -9
- data/vendor/test/cases/regression.449.styl +0 -10
- data/vendor/test/cases/regression.458.css +0 -3
- data/vendor/test/cases/regression.458.styl +0 -3
- data/vendor/test/cases/regression.460.css +0 -13
- data/vendor/test/cases/regression.460.styl +0 -18
- data/vendor/test/cases/regression.469.css +0 -4
- data/vendor/test/cases/regression.469.styl +0 -6
- data/vendor/test/cases/regression.472.css +0 -10
- data/vendor/test/cases/regression.472.styl +0 -23
- data/vendor/test/cases/regression.475.css +0 -6
- data/vendor/test/cases/regression.475.styl +0 -7
- data/vendor/test/cases/regression.480.css +0 -9
- data/vendor/test/cases/regression.480.styl +0 -12
- data/vendor/test/cases/regression.484.css +0 -9
- data/vendor/test/cases/regression.484.styl +0 -8
- data/vendor/test/cases/regression.498.css +0 -8
- data/vendor/test/cases/regression.498.styl +0 -11
- data/vendor/test/cases/regression.499.css +0 -14
- data/vendor/test/cases/regression.499.styl +0 -20
- data/vendor/test/cases/regression.503.css +0 -65
- data/vendor/test/cases/regression.503.styl +0 -7
- data/vendor/test/cases/regression.504.css +0 -65
- data/vendor/test/cases/regression.504.styl +0 -12
- data/vendor/test/cases/regression.524.css +0 -4
- data/vendor/test/cases/regression.524.styl +0 -7
- data/vendor/test/cases/regression.535.css +0 -3
- data/vendor/test/cases/regression.535.styl +0 -9
- data/vendor/test/cases/regression.536.css +0 -3
- data/vendor/test/cases/regression.536.styl +0 -5
- data/vendor/test/cases/reset.css +0 -70
- data/vendor/test/cases/reset.styl +0 -16
- data/vendor/test/cases/rule.charset.css +0 -1
- data/vendor/test/cases/rule.charset.styl +0 -2
- data/vendor/test/cases/rulset.css +0 -4
- data/vendor/test/cases/rulset.newline.css +0 -5
- data/vendor/test/cases/rulset.newline.styl +0 -5
- data/vendor/test/cases/rulset.styl +0 -3
- data/vendor/test/cases/scope.complex.css +0 -10
- data/vendor/test/cases/scope.complex.styl +0 -16
- data/vendor/test/cases/scope.css +0 -5
- data/vendor/test/cases/scope.nested.css +0 -9
- data/vendor/test/cases/scope.nested.styl +0 -10
- data/vendor/test/cases/scope.styl +0 -12
- data/vendor/test/cases/selector.interpolation.css +0 -57
- data/vendor/test/cases/selector.interpolation.styl +0 -45
- data/vendor/test/cases/selectors.complex.css +0 -28
- data/vendor/test/cases/selectors.complex.styl +0 -27
- data/vendor/test/cases/selectors.css +0 -50
- data/vendor/test/cases/selectors.nested.comma.css +0 -9
- data/vendor/test/cases/selectors.nested.comma.styl +0 -8
- data/vendor/test/cases/selectors.nested.css +0 -34
- data/vendor/test/cases/selectors.nested.styl +0 -33
- data/vendor/test/cases/selectors.pseudo.css +0 -27
- data/vendor/test/cases/selectors.pseudo.elements.css +0 -26
- data/vendor/test/cases/selectors.pseudo.elements.styl +0 -29
- data/vendor/test/cases/selectors.pseudo.styl +0 -24
- data/vendor/test/cases/selectors.styl +0 -46
- data/vendor/test/cases/self-assignment.css +0 -3
- data/vendor/test/cases/self-assignment.styl +0 -4
- data/vendor/test/cases/vargs.call.css +0 -24
- data/vendor/test/cases/vargs.call.styl +0 -40
- data/vendor/test/cases/vargs.css +0 -30
- data/vendor/test/cases/vargs.styl +0 -49
- data/vendor/test/cases/variable.css +0 -3
- data/vendor/test/cases/variable.styl +0 -4
- data/vendor/test/cases/variables.css +0 -12
- data/vendor/test/cases/variables.styl +0 -17
- data/vendor/test/images/gif +0 -0
- data/vendor/test/images/squirrel.jpeg +0 -0
- data/vendor/test/images/tux.png +0 -0
- data/vendor/test/run.js +0 -169
data/Rakefile
CHANGED
@@ -20,18 +20,18 @@ end
|
|
20
20
|
|
21
21
|
desc "Downloads stylus into './vendor' and checks the latest released tag"
|
22
22
|
task :update do
|
23
|
-
raw
|
24
|
-
metadata
|
23
|
+
raw = open('http://registry.npmjs.org/stylus') { |io| io.binmode.read }
|
24
|
+
metadata = MultiJson.decode(raw)
|
25
25
|
current_version = File.read('VERSION')
|
26
|
-
version
|
27
|
-
tarball
|
26
|
+
version = ENV['VERSION'] || metadata['dist-tags']['latest']
|
27
|
+
tarball = metadata['versions'][version]['dist']['tarball']
|
28
28
|
|
29
29
|
say "Updating stylus source from #{current_version} to #{version}"
|
30
30
|
|
31
31
|
execute 'cleaning up old files', 'rm -rf vendor'
|
32
32
|
execute "download stylus #{version}", "wget #{tarball} -O stylus.tgz"
|
33
33
|
execute "upacking stylus #{version}", 'tar -zxvf stylus.tgz'
|
34
|
-
execute 'cleaning up', 'rm stylus.tgz package/.npmignore'
|
34
|
+
execute 'cleaning up', 'rm -rf stylus.tgz package/.npmignore'
|
35
35
|
execute 'updating stylus dependencies', 'mv package vendor && cd vendor && npm install .'
|
36
36
|
say 'updating VERSION file'
|
37
37
|
File.open('VERSION', 'w') { |file| file.write(version) }
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.24.0
|
@@ -150,7 +150,7 @@ exports.type =
|
|
150
150
|
exports.typeof =
|
151
151
|
exports['type-of'] = function type(node){
|
152
152
|
utils.assertPresent(node, 'expression');
|
153
|
-
return
|
153
|
+
return node.nodeName;
|
154
154
|
};
|
155
155
|
|
156
156
|
/**
|
@@ -356,7 +356,7 @@ exports.unit = function unit(unit, type){
|
|
356
356
|
utils.assertString(type, 'type');
|
357
357
|
return new nodes.Unit(unit.val, type.string);
|
358
358
|
} else {
|
359
|
-
return
|
359
|
+
return unit.type || '';
|
360
360
|
}
|
361
361
|
};
|
362
362
|
|
@@ -429,13 +429,11 @@ exports.match = function match(pattern, val){
|
|
429
429
|
|
430
430
|
(exports.length = function length(expr){
|
431
431
|
if (expr) {
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
return new nodes.Unit(1);
|
436
|
-
}
|
432
|
+
return expr.nodes
|
433
|
+
? utils.unwrap(expr).nodes.length
|
434
|
+
: 1;
|
437
435
|
}
|
438
|
-
return
|
436
|
+
return 0;
|
439
437
|
}).raw = true;
|
440
438
|
|
441
439
|
/**
|
@@ -502,7 +500,7 @@ exports.trace = function trace(){
|
|
502
500
|
for (var i = 1, len = arguments.length; i < len; ++i) {
|
503
501
|
expr.nodes.push(utils.unwrap(arguments[i]));
|
504
502
|
}
|
505
|
-
return
|
503
|
+
return expr.nodes.length;
|
506
504
|
}).raw = true;
|
507
505
|
|
508
506
|
/**
|
@@ -519,7 +517,7 @@ exports.trace = function trace(){
|
|
519
517
|
for (var i = 1, len = arguments.length; i < len; ++i) {
|
520
518
|
expr.nodes.unshift(utils.unwrap(arguments[i]));
|
521
519
|
}
|
522
|
-
return
|
520
|
+
return expr.nodes.length;
|
523
521
|
}).raw = true;
|
524
522
|
|
525
523
|
/**
|
@@ -570,7 +568,7 @@ exports.trace = function trace(){
|
|
570
568
|
*/
|
571
569
|
|
572
570
|
(exports['opposite-position'] = function oppositePosition(positions){
|
573
|
-
var expr =
|
571
|
+
var expr = [];
|
574
572
|
utils.unwrap(positions).nodes.forEach(function(pos, i){
|
575
573
|
utils.assertString(pos, 'position ' + i);
|
576
574
|
pos = (function(){ switch (pos.string) {
|
@@ -578,6 +576,7 @@ exports.trace = function trace(){
|
|
578
576
|
case 'bottom': return 'top';
|
579
577
|
case 'left': return 'right';
|
580
578
|
case 'right': return 'left';
|
579
|
+
case 'center': return 'center';
|
581
580
|
default: throw new Error('invalid position ' + pos);
|
582
581
|
}})();
|
583
582
|
expr.push(new nodes.Literal(pos));
|
@@ -614,7 +613,7 @@ exports['image-size'] = function imageSize(img) {
|
|
614
613
|
img.close();
|
615
614
|
|
616
615
|
// Return (w h)
|
617
|
-
var expr =
|
616
|
+
var expr = [];
|
618
617
|
expr.push(new nodes.Unit(size[0], 'px'));
|
619
618
|
expr.push(new nodes.Unit(size[1], 'px'));
|
620
619
|
|
@@ -123,6 +123,51 @@ fade-in(color, amount)
|
|
123
123
|
spin(color, amount)
|
124
124
|
color + unit(amount, deg)
|
125
125
|
|
126
|
+
// mix two colors by a given amount
|
127
|
+
|
128
|
+
mix(color1, color2, weight = 50%)
|
129
|
+
unless weight in 0..100
|
130
|
+
error("Weight must be between 0% and 100%")
|
131
|
+
|
132
|
+
if length(color1) == 2
|
133
|
+
weight = color1[0]
|
134
|
+
color1 = color1[1]
|
135
|
+
|
136
|
+
else if length(color2) == 2
|
137
|
+
weight = 100 - color2[0]
|
138
|
+
color2 = color2[1]
|
139
|
+
|
140
|
+
require-color(color1)
|
141
|
+
require-color(color2)
|
142
|
+
|
143
|
+
p = unit(weight / 100, '')
|
144
|
+
w = p * 2 - 1
|
145
|
+
|
146
|
+
a = alpha(color1) - alpha(color2)
|
147
|
+
|
148
|
+
w1 = (((w * a == -1) ? w : (w + a) / (1 + w * a)) + 1) / 2
|
149
|
+
w2 = 1 - w1
|
150
|
+
|
151
|
+
channels = (red(color1) red(color2)) (green(color1) green(color2)) (blue(color1) blue(color2))
|
152
|
+
rgb = ()
|
153
|
+
|
154
|
+
for pair in channels
|
155
|
+
push(rgb, floor(pair[0] * w1 + pair[1] * w2))
|
156
|
+
|
157
|
+
a1 = alpha(color1) * p
|
158
|
+
a2 = alpha(color1) * (1 - p)
|
159
|
+
alpha = a1 + a2
|
160
|
+
|
161
|
+
rgba(rgb[0], rgb[1], rgb[2], alpha)
|
162
|
+
|
163
|
+
// invert colors, leave alpha intact
|
164
|
+
|
165
|
+
invert(color)
|
166
|
+
r = 255 - red(color)
|
167
|
+
g = 255 - green(color)
|
168
|
+
b = 255 - blue(color)
|
169
|
+
rgba(r,g,b,alpha(color))
|
170
|
+
|
126
171
|
// return the last value in the given expr
|
127
172
|
|
128
173
|
last(expr)
|
data/vendor/lib/parser.js
CHANGED
@@ -15,6 +15,13 @@ var Lexer = require('./lexer')
|
|
15
15
|
, inspect = require('util').inspect
|
16
16
|
, errors = require('./errors');
|
17
17
|
|
18
|
+
// debuggers
|
19
|
+
|
20
|
+
var debug = {
|
21
|
+
lexer: require('debug')('stylus:lexer')
|
22
|
+
, selector: require('debug')('stylus:parser:selector')
|
23
|
+
};
|
24
|
+
|
18
25
|
/**
|
19
26
|
* Selector composite tokens.
|
20
27
|
*/
|
@@ -201,6 +208,7 @@ Parser.prototype = {
|
|
201
208
|
? this.stash.pop()
|
202
209
|
: this.lexer.next();
|
203
210
|
nodes.lineno = tok.lineno;
|
211
|
+
debug.lexer('%s %s', tok.type, tok.val || '');
|
204
212
|
return tok;
|
205
213
|
},
|
206
214
|
|
@@ -934,6 +942,10 @@ Parser.prototype = {
|
|
934
942
|
case 'media':
|
935
943
|
case 'font-face':
|
936
944
|
return this.selector();
|
945
|
+
case 'function':
|
946
|
+
return this.looksLikeSelector()
|
947
|
+
? this.selector()
|
948
|
+
: this.expression();
|
937
949
|
// Do not disrupt the ident when an operand
|
938
950
|
default:
|
939
951
|
return this.operand
|
@@ -1045,6 +1057,7 @@ Parser.prototype = {
|
|
1045
1057
|
// stitched together to
|
1046
1058
|
// form a selector.
|
1047
1059
|
while (tok = this.selectorToken()) {
|
1060
|
+
debug.selector('%s', tok);
|
1048
1061
|
// Selector component
|
1049
1062
|
switch (tok.type) {
|
1050
1063
|
case '{':
|
data/vendor/lib/stylus.js
CHANGED
@@ -20,6 +20,7 @@ var Visitor = require('./')
|
|
20
20
|
, dirname = require('path').dirname
|
21
21
|
, join = require('path').join
|
22
22
|
, colors = require('../colors')
|
23
|
+
, debug = require('debug')('stylus:evaluator')
|
23
24
|
, fs = require('fs');
|
24
25
|
|
25
26
|
/**
|
@@ -139,6 +140,7 @@ Evaluator.prototype.populateGlobalScope = function(){
|
|
139
140
|
*/
|
140
141
|
|
141
142
|
Evaluator.prototype.evaluate = function(){
|
143
|
+
debug('eval %s', this.filename);
|
142
144
|
this.setup();
|
143
145
|
return this.visit(this.root);
|
144
146
|
};
|
@@ -152,6 +154,7 @@ Evaluator.prototype.visitGroup = function(group){
|
|
152
154
|
|
153
155
|
group.nodes = group.nodes.map(function(selector){
|
154
156
|
selector.val = this.interpolate(selector);
|
157
|
+
debug('ruleset %s', selector.val);
|
155
158
|
return selector;
|
156
159
|
}, this);
|
157
160
|
|
@@ -283,6 +286,7 @@ Evaluator.prototype.visitEach = function(each){
|
|
283
286
|
*/
|
284
287
|
|
285
288
|
Evaluator.prototype.visitCall = function(call){
|
289
|
+
debug('call %s', call);
|
286
290
|
var fn = this.lookup(call.name)
|
287
291
|
, ret;
|
288
292
|
|
@@ -301,6 +305,7 @@ Evaluator.prototype.visitCall = function(call){
|
|
301
305
|
|
302
306
|
// Undefined function, render literal css
|
303
307
|
if (!fn || fn.nodeName != 'function') {
|
308
|
+
debug('%s is undefined', call);
|
304
309
|
var ret = this.literalCall(call);
|
305
310
|
this.ignoreColors = false;
|
306
311
|
return ret;
|
@@ -326,9 +331,11 @@ Evaluator.prototype.visitCall = function(call){
|
|
326
331
|
|
327
332
|
// Built-in
|
328
333
|
if (fn.fn) {
|
334
|
+
debug('%s is built-in', call);
|
329
335
|
ret = this.invokeBuiltin(fn.fn, args);
|
330
336
|
// User-defined
|
331
337
|
} else if ('function' == fn.nodeName) {
|
338
|
+
debug('%s is user-defined', call);
|
332
339
|
ret = this.invokeFunction(fn, args);
|
333
340
|
}
|
334
341
|
|
@@ -608,6 +615,7 @@ Evaluator.prototype.visitImport = function(imported){
|
|
608
615
|
, literal;
|
609
616
|
|
610
617
|
this.return--;
|
618
|
+
debug('import %s', path);
|
611
619
|
|
612
620
|
// url() passed
|
613
621
|
if ('url' == path.name) return imported;
|
@@ -0,0 +1,35 @@
|
|
1
|
+
var PATH = require("path");
|
2
|
+
var FS = require("fs");
|
3
|
+
|
4
|
+
function readFile(path) {
|
5
|
+
var abs_path = PATH.join(__dirname, path);
|
6
|
+
return FS.readFileSync(abs_path, "utf8");
|
7
|
+
}
|
8
|
+
|
9
|
+
function stripCommonJS(text) {
|
10
|
+
return text.replace(/\/\/\.CommonJS(?:.|\n)*?\/\/\/CommonJS/g, "");
|
11
|
+
}
|
12
|
+
|
13
|
+
desc("Packages lib files into the one huge");
|
14
|
+
task("default", ["build/CSSOM.js"]);
|
15
|
+
|
16
|
+
directory("build");
|
17
|
+
|
18
|
+
file("build/CSSOM.js", ["src/files.js", "src/CSSOM.js", "build"], function() {
|
19
|
+
var parts = [readFile("src/CSSOM.js")];
|
20
|
+
require("./src/files").files.forEach(function(path) {
|
21
|
+
var text = readFile("lib/" + path + ".js");
|
22
|
+
parts.push(stripCommonJS(text).trimLeft());
|
23
|
+
});
|
24
|
+
FS.writeFileSync("build/CSSOM.js", parts.join(""));
|
25
|
+
process.stdout.write("build/CSSOM.js is done\n");
|
26
|
+
});
|
27
|
+
|
28
|
+
desc("Creates index file for npm package");
|
29
|
+
task("lib", ["lib/index.js"]);
|
30
|
+
|
31
|
+
file("lib/index.js", ["src/files.js"], function() {
|
32
|
+
FS.writeFileSync("lib/index.js", "'use strict';\n\n" + require('./src/files').files.map(function(fileName) {
|
33
|
+
return "exports." + fileName + " = require('./" + fileName + "')." + fileName + ";\n";
|
34
|
+
}).join(""));
|
35
|
+
});
|
@@ -13,6 +13,7 @@ var CSSOM = {
|
|
13
13
|
* @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSImportRule
|
14
14
|
*/
|
15
15
|
CSSOM.CSSImportRule = function CSSImportRule() {
|
16
|
+
CSSOM.CSSRule.call(this);
|
16
17
|
this.href = "";
|
17
18
|
this.media = new CSSOM.MediaList;
|
18
19
|
this.styleSheet = new CSSOM.CSSStyleSheet;
|
@@ -49,7 +50,7 @@ CSSOM.CSSImportRule.prototype.__defineSetter__("cssText", function(cssText) {
|
|
49
50
|
case '\r':
|
50
51
|
case '\n':
|
51
52
|
case '\f':
|
52
|
-
if (state
|
53
|
+
if (state === 'after-import') {
|
53
54
|
state = 'url';
|
54
55
|
} else {
|
55
56
|
buffer += character;
|
@@ -57,7 +58,7 @@ CSSOM.CSSImportRule.prototype.__defineSetter__("cssText", function(cssText) {
|
|
57
58
|
break;
|
58
59
|
|
59
60
|
case '@':
|
60
|
-
if (!state && cssText.indexOf('@import', i)
|
61
|
+
if (!state && cssText.indexOf('@import', i) === i) {
|
61
62
|
state = 'after-import';
|
62
63
|
i += 'import'.length;
|
63
64
|
buffer = '';
|
@@ -65,15 +66,15 @@ CSSOM.CSSImportRule.prototype.__defineSetter__("cssText", function(cssText) {
|
|
65
66
|
break;
|
66
67
|
|
67
68
|
case 'u':
|
68
|
-
if (state
|
69
|
+
if (state === 'url' && cssText.indexOf('url(', i) === i) {
|
69
70
|
index = cssText.indexOf(')', i + 1);
|
70
|
-
if (index
|
71
|
+
if (index === -1) {
|
71
72
|
throw i + ': ")" not found';
|
72
73
|
}
|
73
74
|
i += 'url('.length;
|
74
75
|
var url = cssText.slice(i, index);
|
75
76
|
if (url[0] === url[url.length - 1]) {
|
76
|
-
if (url[0]
|
77
|
+
if (url[0] === '"' || url[0] === "'") {
|
77
78
|
url = url.slice(1, -1);
|
78
79
|
}
|
79
80
|
}
|
@@ -84,7 +85,7 @@ CSSOM.CSSImportRule.prototype.__defineSetter__("cssText", function(cssText) {
|
|
84
85
|
break;
|
85
86
|
|
86
87
|
case '"':
|
87
|
-
if (state
|
88
|
+
if (state === 'url') {
|
88
89
|
index = cssText.indexOf('"', i + 1);
|
89
90
|
if (!index) {
|
90
91
|
throw i + ": '\"' not found";
|
@@ -96,7 +97,7 @@ CSSOM.CSSImportRule.prototype.__defineSetter__("cssText", function(cssText) {
|
|
96
97
|
break;
|
97
98
|
|
98
99
|
case "'":
|
99
|
-
if (state
|
100
|
+
if (state === 'url') {
|
100
101
|
index = cssText.indexOf("'", i + 1);
|
101
102
|
if (!index) {
|
102
103
|
throw i + ': "\'" not found';
|
@@ -108,7 +109,7 @@ CSSOM.CSSImportRule.prototype.__defineSetter__("cssText", function(cssText) {
|
|
108
109
|
break;
|
109
110
|
|
110
111
|
case ';':
|
111
|
-
if (state
|
112
|
+
if (state === 'media') {
|
112
113
|
if (buffer) {
|
113
114
|
this.media.mediaText = buffer.trim();
|
114
115
|
}
|
@@ -116,7 +117,7 @@ CSSOM.CSSImportRule.prototype.__defineSetter__("cssText", function(cssText) {
|
|
116
117
|
break;
|
117
118
|
|
118
119
|
default:
|
119
|
-
if (state
|
120
|
+
if (state === 'media') {
|
120
121
|
buffer += character;
|
121
122
|
}
|
122
123
|
break;
|
@@ -11,8 +11,10 @@ var CSSOM = {
|
|
11
11
|
* @see http://www.w3.org/TR/css3-animations/#DOM-CSSKeyframeRule
|
12
12
|
*/
|
13
13
|
CSSOM.CSSKeyframeRule = function CSSKeyframeRule() {
|
14
|
+
CSSOM.CSSRule.call(this);
|
14
15
|
this.keyText = '';
|
15
16
|
this.style = new CSSOM.CSSStyleDeclaration;
|
17
|
+
this.style.parentRule = this;
|
16
18
|
};
|
17
19
|
|
18
20
|
CSSOM.CSSKeyframeRule.prototype = new CSSOM.CSSRule;
|
@@ -10,6 +10,7 @@ var CSSOM = {
|
|
10
10
|
* @see http://www.w3.org/TR/css3-animations/#DOM-CSSKeyframesRule
|
11
11
|
*/
|
12
12
|
CSSOM.CSSKeyframesRule = function CSSKeyframesRule() {
|
13
|
+
CSSOM.CSSRule.call(this);
|
13
14
|
this.name = '';
|
14
15
|
this.cssRules = [];
|
15
16
|
};
|
@@ -27,7 +28,7 @@ CSSOM.CSSKeyframesRule.prototype.__defineGetter__("cssText", function() {
|
|
27
28
|
for (var i=0, length=this.cssRules.length; i < length; i++) {
|
28
29
|
cssTexts.push(" " + this.cssRules[i].cssText);
|
29
30
|
}
|
30
|
-
return "@-webkit-keyframes " + this.name + " { \n" + cssTexts.join("\n") + "\n}"
|
31
|
+
return "@-webkit-keyframes " + this.name + " { \n" + cssTexts.join("\n") + "\n}";
|
31
32
|
});
|
32
33
|
|
33
34
|
|
@@ -12,6 +12,7 @@ var CSSOM = {
|
|
12
12
|
* @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSMediaRule
|
13
13
|
*/
|
14
14
|
CSSOM.CSSMediaRule = function CSSMediaRule() {
|
15
|
+
CSSOM.CSSRule.call(this);
|
15
16
|
this.media = new CSSOM.MediaList;
|
16
17
|
this.cssRules = [];
|
17
18
|
};
|
@@ -29,7 +30,7 @@ CSSOM.CSSMediaRule.prototype.__defineGetter__("cssText", function() {
|
|
29
30
|
for (var i=0, length=this.cssRules.length; i < length; i++) {
|
30
31
|
cssTexts.push(this.cssRules[i].cssText);
|
31
32
|
}
|
32
|
-
return "@media " + this.media.mediaText + " {" + cssTexts.join("") + "}"
|
33
|
+
return "@media " + this.media.mediaText + " {" + cssTexts.join("") + "}";
|
33
34
|
});
|
34
35
|
|
35
36
|
|
@@ -9,6 +9,7 @@ var CSSOM = {};
|
|
9
9
|
*/
|
10
10
|
CSSOM.CSSStyleDeclaration = function CSSStyleDeclaration(){
|
11
11
|
this.length = 0;
|
12
|
+
this.parentRule = null;
|
12
13
|
|
13
14
|
// NON-STANDARD
|
14
15
|
this._importants = {};
|
@@ -27,7 +28,7 @@ CSSOM.CSSStyleDeclaration.prototype = {
|
|
27
28
|
* Returns the empty string if the property has not been set.
|
28
29
|
*/
|
29
30
|
getPropertyValue: function(name) {
|
30
|
-
return this[name] || ""
|
31
|
+
return this[name] || "";
|
31
32
|
},
|
32
33
|
|
33
34
|
/**
|
@@ -63,11 +64,11 @@ CSSOM.CSSStyleDeclaration.prototype = {
|
|
63
64
|
*/
|
64
65
|
removeProperty: function(name) {
|
65
66
|
if (!(name in this)) {
|
66
|
-
return ""
|
67
|
+
return "";
|
67
68
|
}
|
68
69
|
var index = Array.prototype.indexOf.call(this, name);
|
69
70
|
if (index < 0) {
|
70
|
-
return ""
|
71
|
+
return "";
|
71
72
|
}
|
72
73
|
var prevValue = this[name];
|
73
74
|
this[name] = "";
|
@@ -78,7 +79,7 @@ CSSOM.CSSStyleDeclaration.prototype = {
|
|
78
79
|
// That's what Firefox does
|
79
80
|
//this[index] = ""
|
80
81
|
|
81
|
-
return prevValue
|
82
|
+
return prevValue;
|
82
83
|
},
|
83
84
|
|
84
85
|
getPropertyCSSValue: function() {
|
@@ -119,7 +120,7 @@ CSSOM.CSSStyleDeclaration.prototype = {
|
|
119
120
|
}
|
120
121
|
properties[i] = name + ": " + value + priority + ";";
|
121
122
|
}
|
122
|
-
return properties.join(" ")
|
123
|
+
return properties.join(" ");
|
123
124
|
},
|
124
125
|
|
125
126
|
set cssText(cssText){
|
@@ -129,6 +130,7 @@ CSSOM.CSSStyleDeclaration.prototype = {
|
|
129
130
|
this[name] = "";
|
130
131
|
}
|
131
132
|
Array.prototype.splice.call(this, 0, this.length);
|
133
|
+
this._importants = {};
|
132
134
|
|
133
135
|
var dummyRule = CSSOM.parse('#bogus{' + cssText + '}').cssRules[0].style;
|
134
136
|
var length = dummyRule.length;
|
@@ -12,8 +12,10 @@ var CSSOM = {
|
|
12
12
|
* @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleRule
|
13
13
|
*/
|
14
14
|
CSSOM.CSSStyleRule = function CSSStyleRule() {
|
15
|
+
CSSOM.CSSRule.call(this);
|
15
16
|
this.selectorText = "";
|
16
17
|
this.style = new CSSOM.CSSStyleDeclaration;
|
18
|
+
this.style.parentRule = this;
|
17
19
|
};
|
18
20
|
|
19
21
|
CSSOM.CSSStyleRule.prototype = new CSSOM.CSSRule;
|
@@ -106,11 +108,11 @@ CSSOM.CSSStyleRule.parse = function(ruleText) {
|
|
106
108
|
|
107
109
|
// Comment
|
108
110
|
case "/":
|
109
|
-
if (ruleText.charAt(i + 1)
|
111
|
+
if (ruleText.charAt(i + 1) === "*") {
|
110
112
|
i += 2;
|
111
113
|
index = ruleText.indexOf("*/", i);
|
112
|
-
if (index
|
113
|
-
throw SyntaxError("Missing */");
|
114
|
+
if (index === -1) {
|
115
|
+
throw new SyntaxError("Missing */");
|
114
116
|
} else {
|
115
117
|
i = index + 1;
|
116
118
|
}
|
@@ -120,7 +122,7 @@ CSSOM.CSSStyleRule.parse = function(ruleText) {
|
|
120
122
|
break;
|
121
123
|
|
122
124
|
case "{":
|
123
|
-
if (state
|
125
|
+
if (state === "selector") {
|
124
126
|
styleRule.selectorText = buffer.trim();
|
125
127
|
buffer = "";
|
126
128
|
state = "name";
|
@@ -128,7 +130,7 @@ CSSOM.CSSStyleRule.parse = function(ruleText) {
|
|
128
130
|
break;
|
129
131
|
|
130
132
|
case ":":
|
131
|
-
if (state
|
133
|
+
if (state === "name") {
|
132
134
|
name = buffer.trim();
|
133
135
|
buffer = "";
|
134
136
|
state = "value";
|
@@ -138,7 +140,7 @@ CSSOM.CSSStyleRule.parse = function(ruleText) {
|
|
138
140
|
break;
|
139
141
|
|
140
142
|
case "!":
|
141
|
-
if (state
|
143
|
+
if (state === "value" && ruleText.indexOf("!important", i) === i) {
|
142
144
|
priority = "important";
|
143
145
|
i += "important".length;
|
144
146
|
} else {
|
@@ -147,7 +149,7 @@ CSSOM.CSSStyleRule.parse = function(ruleText) {
|
|
147
149
|
break;
|
148
150
|
|
149
151
|
case ";":
|
150
|
-
if (state
|
152
|
+
if (state === "value") {
|
151
153
|
styleRule.style.setProperty(name, buffer.trim(), priority);
|
152
154
|
priority = "";
|
153
155
|
buffer = "";
|
@@ -158,11 +160,11 @@ CSSOM.CSSStyleRule.parse = function(ruleText) {
|
|
158
160
|
break;
|
159
161
|
|
160
162
|
case "}":
|
161
|
-
if (state
|
163
|
+
if (state === "value") {
|
162
164
|
styleRule.style.setProperty(name, buffer.trim(), priority);
|
163
165
|
priority = "";
|
164
166
|
buffer = "";
|
165
|
-
} else if (state
|
167
|
+
} else if (state === "name") {
|
166
168
|
break;
|
167
169
|
} else {
|
168
170
|
buffer += character;
|
@@ -11,6 +11,7 @@ var CSSOM = {
|
|
11
11
|
* @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet
|
12
12
|
*/
|
13
13
|
CSSOM.CSSStyleSheet = function CSSStyleSheet() {
|
14
|
+
CSSOM.StyleSheet.call(this);
|
14
15
|
this.cssRules = [];
|
15
16
|
};
|
16
17
|
|
@@ -37,10 +38,10 @@ CSSOM.CSSStyleSheet.prototype.constructor = CSSOM.CSSStyleSheet;
|
|
37
38
|
*/
|
38
39
|
CSSOM.CSSStyleSheet.prototype.insertRule = function(rule, index) {
|
39
40
|
if (index < 0 || index > this.cssRules.length) {
|
40
|
-
throw new RangeError("INDEX_SIZE_ERR")
|
41
|
+
throw new RangeError("INDEX_SIZE_ERR");
|
41
42
|
}
|
42
43
|
this.cssRules.splice(index, 0, CSSOM.CSSStyleRule.parse(rule));
|
43
|
-
return index
|
44
|
+
return index;
|
44
45
|
};
|
45
46
|
|
46
47
|
|
@@ -54,9 +55,8 @@ CSSOM.CSSStyleSheet.prototype.insertRule = function(rule, index) {
|
|
54
55
|
* sheet.toString()
|
55
56
|
* -> "body{margin:0;}"
|
56
57
|
*
|
57
|
-
* @param {number} index
|
58
|
+
* @param {number} index within the style sheet's rule list of the rule to remove.
|
58
59
|
* @see http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleSheet-deleteRule
|
59
|
-
* @return {number} The index within the style sheet's rule list of the rule to remove.
|
60
60
|
*/
|
61
61
|
CSSOM.CSSStyleSheet.prototype.deleteRule = function(index) {
|
62
62
|
if (index < 0 || index >= this.cssRules.length) {
|
@@ -37,7 +37,7 @@ CSSOM.MediaList.prototype = {
|
|
37
37
|
* @param {string} medium
|
38
38
|
*/
|
39
39
|
appendMedium: function(medium) {
|
40
|
-
if (Array.prototype.indexOf.call(this, medium)
|
40
|
+
if (Array.prototype.indexOf.call(this, medium) === -1) {
|
41
41
|
this[this.length] = medium;
|
42
42
|
this.length++;
|
43
43
|
}
|
@@ -48,11 +48,11 @@ CSSOM.MediaList.prototype = {
|
|
48
48
|
*/
|
49
49
|
deleteMedium: function(medium) {
|
50
50
|
var index = Array.prototype.indexOf.call(this, medium);
|
51
|
-
if (index
|
51
|
+
if (index !== -1) {
|
52
52
|
Array.prototype.splice.call(this, index, 1);
|
53
53
|
}
|
54
54
|
}
|
55
|
-
|
55
|
+
|
56
56
|
};
|
57
57
|
|
58
58
|
|
@@ -50,20 +50,20 @@ CSSOM.clone = function clone(stylesheet) {
|
|
50
50
|
styleClone.length = style.length;
|
51
51
|
}
|
52
52
|
|
53
|
-
if (
|
53
|
+
if (rule.hasOwnProperty('keyText')) {
|
54
54
|
ruleClone.keyText = rule.keyText;
|
55
55
|
}
|
56
56
|
|
57
|
-
if (
|
57
|
+
if (rule.hasOwnProperty('selectorText')) {
|
58
58
|
ruleClone.selectorText = rule.selectorText;
|
59
59
|
}
|
60
60
|
|
61
|
-
if (
|
61
|
+
if (rule.hasOwnProperty('mediaText')) {
|
62
62
|
ruleClone.mediaText = rule.mediaText;
|
63
63
|
}
|
64
64
|
|
65
|
-
if (
|
66
|
-
|
65
|
+
if (rule.hasOwnProperty('cssRules')) {
|
66
|
+
ruleClone.cssRules = clone(rule).cssRules;
|
67
67
|
}
|
68
68
|
}
|
69
69
|
|