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/vendor/docs/functions.md
DELETED
@@ -1,197 +0,0 @@
|
|
1
|
-
|
2
|
-
## Functions
|
3
|
-
|
4
|
-
Stylus features powerful in-language function definitions. Function definitions appear identical to mixins; however, functions may return a value.
|
5
|
-
|
6
|
-
### Return Values
|
7
|
-
|
8
|
-
Let's try a trivial example: creating a function that adds two numbers.
|
9
|
-
|
10
|
-
add(a, b)
|
11
|
-
a + b
|
12
|
-
|
13
|
-
We can then use this function in conditions, in property values, etc.
|
14
|
-
|
15
|
-
body
|
16
|
-
padding add(10px, 5)
|
17
|
-
|
18
|
-
Rendering:
|
19
|
-
|
20
|
-
body {
|
21
|
-
padding: 15px;
|
22
|
-
}
|
23
|
-
|
24
|
-
### Argument Defaults
|
25
|
-
|
26
|
-
Optional arguments may default to a given expression. With Stylus we may even default arguments to earlier arguments!
|
27
|
-
|
28
|
-
For example:
|
29
|
-
|
30
|
-
|
31
|
-
add(a, b = a)
|
32
|
-
a + b
|
33
|
-
|
34
|
-
add(10, 5)
|
35
|
-
// => 15
|
36
|
-
|
37
|
-
add(10)
|
38
|
-
// => 20
|
39
|
-
|
40
|
-
**Note:** Since argument defaults are assignments, we can also use function calls for defaults:
|
41
|
-
|
42
|
-
add(a, b = unit(a, px))
|
43
|
-
a + b
|
44
|
-
|
45
|
-
### Function Bodies
|
46
|
-
|
47
|
-
We can take our simple `add()` function further. Let's casting all units passed as `px` via the `unit()` built-in. It reassigns each argument, and provides a unit-type string (or identifier), which ignores unit conversion.
|
48
|
-
|
49
|
-
add(a, b = a)
|
50
|
-
a = unit(a, px)
|
51
|
-
b = unit(b, px)
|
52
|
-
a + b
|
53
|
-
|
54
|
-
add(15%, 10deg)
|
55
|
-
// => 25
|
56
|
-
|
57
|
-
### Multiple Return Values
|
58
|
-
|
59
|
-
Stylus functions can return several values—just as you can assign several values to a variable.
|
60
|
-
|
61
|
-
For example, the following is a valid assignment:
|
62
|
-
|
63
|
-
sizes = 15px 10px
|
64
|
-
|
65
|
-
sizes[0]
|
66
|
-
// => 15px
|
67
|
-
|
68
|
-
Similarly, we may return several values:
|
69
|
-
|
70
|
-
sizes()
|
71
|
-
15px 10px
|
72
|
-
|
73
|
-
sizes()[0]
|
74
|
-
// => 15px
|
75
|
-
|
76
|
-
One slight exception is when return values are identifiers. For example, the following looks like a property assignment to Stylus (since no operators are present):
|
77
|
-
|
78
|
-
swap(a, b)
|
79
|
-
b a
|
80
|
-
|
81
|
-
To disambiguate, we can either wrap with parentheses, or use the `return` keyword:
|
82
|
-
|
83
|
-
swap(a, b)
|
84
|
-
(b a)
|
85
|
-
|
86
|
-
swap(a, b)
|
87
|
-
return b a
|
88
|
-
|
89
|
-
### Conditionals
|
90
|
-
|
91
|
-
Let's say we want to create a function named `stringish()` to determine whether the argument can be transformed to a string. We check if `val` is a string, or an ident (which is string-like). Because undefined identifiers yield themselves as the value, we may compare them to themselves as shown below (where `yes` and `no` are used in place of `true` and `false`):
|
92
|
-
|
93
|
-
|
94
|
-
stringish(val)
|
95
|
-
if val is a 'string' or val is a 'ident'
|
96
|
-
yes
|
97
|
-
else
|
98
|
-
no
|
99
|
-
|
100
|
-
Usage:
|
101
|
-
|
102
|
-
stringish('yay') == yes
|
103
|
-
// => true
|
104
|
-
|
105
|
-
stringish(yay) == yes
|
106
|
-
// => true
|
107
|
-
|
108
|
-
stringish(0) == no
|
109
|
-
// => true
|
110
|
-
|
111
|
-
__note__: `yes` and `no` are not boolean literals. They are simply undefined identifiers in this case.
|
112
|
-
|
113
|
-
Another example:
|
114
|
-
|
115
|
-
compare(a, b)
|
116
|
-
if a > b
|
117
|
-
higher
|
118
|
-
else if a < b
|
119
|
-
lower
|
120
|
-
else
|
121
|
-
equal
|
122
|
-
|
123
|
-
Usage:
|
124
|
-
|
125
|
-
compare(5, 2)
|
126
|
-
// => higher
|
127
|
-
|
128
|
-
compare(1, 5)
|
129
|
-
// => lower
|
130
|
-
|
131
|
-
compare(10, 10)
|
132
|
-
// => equal
|
133
|
-
|
134
|
-
### Aliasing
|
135
|
-
|
136
|
-
To alias a function, simply assign a function's name to a new identifier. For example, our `add()` function could be aliased as `plus()`, like so:
|
137
|
-
|
138
|
-
plus = add
|
139
|
-
|
140
|
-
plus(1, 2)
|
141
|
-
// => 3
|
142
|
-
|
143
|
-
### Variable Functions
|
144
|
-
|
145
|
-
In the same way that we can "alias" a function, we can pass a function as well. Here, our `invoke()` function accepts a function, so we can pass it `add()` or `sub()`.
|
146
|
-
|
147
|
-
invoke(a, b, fn)
|
148
|
-
fn(a, b)
|
149
|
-
|
150
|
-
add(a, b)
|
151
|
-
a + b
|
152
|
-
|
153
|
-
body
|
154
|
-
padding invoke(5, 10, add)
|
155
|
-
padding invoke(5, 10, sub)
|
156
|
-
|
157
|
-
Yielding:
|
158
|
-
|
159
|
-
body {
|
160
|
-
padding: 15;
|
161
|
-
padding: -5;
|
162
|
-
}
|
163
|
-
|
164
|
-
### arguments
|
165
|
-
|
166
|
-
The `arguments` local is available to all function bodies, and contains all the arguments passed.
|
167
|
-
|
168
|
-
For example:
|
169
|
-
|
170
|
-
sum()
|
171
|
-
n = 0
|
172
|
-
for num in arguments
|
173
|
-
n = n + num
|
174
|
-
|
175
|
-
sum(1,2,3,4,5)
|
176
|
-
// => 15
|
177
|
-
|
178
|
-
### Hash Example
|
179
|
-
|
180
|
-
Below we define the `get(hash, key)` function, which returns the
|
181
|
-
value of `key` (or `null`). We iterate each `pair` in `hash`, returning the pair's second node when the first (the `key`) matches.
|
182
|
-
|
183
|
-
get(hash, key)
|
184
|
-
return pair[1] if pair[0] == key for pair in hash
|
185
|
-
|
186
|
-
As demonstrated below, in-language functions—paired with robust Stylus expressions—can provide great flexibility:
|
187
|
-
|
188
|
-
hash = (one 1) (two 2) (three 3)
|
189
|
-
|
190
|
-
get(hash, two)
|
191
|
-
// => 2
|
192
|
-
|
193
|
-
get(hash, three)
|
194
|
-
// => 3
|
195
|
-
|
196
|
-
get(hash, something)
|
197
|
-
// => null
|
@@ -1,32 +0,0 @@
|
|
1
|
-
## Data URI Image Inlining
|
2
|
-
|
3
|
-
Stylus is bundled with an optional function named `url()`, which replaces the literal `url()` calls (and conditionally inlines them using base64 [Data URIs](http://en.wikipedia.org/wiki/Data_URI_scheme)).
|
4
|
-
|
5
|
-
### Example
|
6
|
-
|
7
|
-
The function itself is available via `require('stylus').url`. It accepts an `options` object, returning a function that Stylus calls internally when it sees `url()`.
|
8
|
-
|
9
|
-
The `.define(name, callback)` method assigned a JavaScript function that can be called from Stylus source. In this case, since our images are in `./css/images`, we can ignore the `paths` option (by default image lookups are performed relative to the file being rendered). But if desired, this behavior can be altered:
|
10
|
-
|
11
|
-
stylus(str)
|
12
|
-
.set('filename', __dirname + '/css/test.styl')
|
13
|
-
.define('url', stylus.url())
|
14
|
-
.render(function(err, css){
|
15
|
-
|
16
|
-
});
|
17
|
-
|
18
|
-
For example, imagine our images live in `./public/images`. We want to use `url(images/tobi.png)`. We could pass `paths` our public directory, so that it becomes part of the lookup process.
|
19
|
-
|
20
|
-
Likewise, if instead we wanted `url(tobi.png)`, we could pass `paths: [__dirname + '/public/images']`.
|
21
|
-
|
22
|
-
stylus(str)
|
23
|
-
.set('filename', __dirname + '/css/test.styl')
|
24
|
-
.define('url', stylus.url({ paths: [__dirname + '/public'] }))
|
25
|
-
.render(function(err, css){
|
26
|
-
|
27
|
-
});
|
28
|
-
|
29
|
-
### Options
|
30
|
-
|
31
|
-
- `limit` bytesize limit defaulting to 30Kb (30000)
|
32
|
-
- `paths` image resolution path(s)
|
data/vendor/docs/gedit.md
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
## gedit language-spec
|
2
|
-
|
3
|
-
Stylus ships with a temporary version of `styl.lang` for [GtkSourceView](http://live.gnome.org/GtkSourceView), based off [Yanekk](https://github.com/yanekk)'s [work](https://github.com/gmate/gmate/blob/master/lang-specs/scss.lang) on `scss.lang`.
|
4
|
-
|
5
|
-
![Stylus Language Specification for GtkSourceView](http://i.imgur.com/uBppL.png))
|
6
|
-
|
7
|
-
This is a start and provides a basic [language spec](http://live.gnome.org/Gedit/NewLanguage) for GtkSourceView editors such as [gedit](http://projects.gnome.org/gedit/).
|
8
|
-
|
9
|
-
**Installation Steps**
|
10
|
-
|
11
|
-
Download `styl.lang` to your local `language-specs` folder:
|
12
|
-
|
13
|
-
mkdir -p ~/.local/share/gtksourceview-2.0/language-specs/ && wget https://raw.github.com/LearnBoost/stylus/master/editors/gedit/styl.lang -O ~/.local/share/gtksourceview-2.0/language-specs/styl.lang
|
14
|
-
|
15
|
-
Update the MIME database and enjoy Stylus syntax in gedit!
|
16
|
-
|
17
|
-
cd ~/.local/share
|
18
|
-
update-mime-database mime
|
19
|
-
|
20
|
-
This is much more enjoyable than having gedit recognize your `.styl` files as Apache Confs!
|
21
|
-
|
22
|
-
---
|
23
|
-
|
24
|
-
**Have a sweet tooth?** Add more icing to gedit with gedit-icing: [https://github.com/niftylettuce/gedit-icing](https://github.com/niftylettuce/gedit-icing)
|
data/vendor/docs/import.md
DELETED
@@ -1,75 +0,0 @@
|
|
1
|
-
## Import
|
2
|
-
|
3
|
-
Stylus supports both literal __@import__ for CSS, as well as dynamic importing of other Stylus sheets.
|
4
|
-
|
5
|
-
### Literal CSS
|
6
|
-
|
7
|
-
Any filename with the extension `.css` will become a literal. For example:
|
8
|
-
|
9
|
-
@import "reset.css"
|
10
|
-
|
11
|
-
Render the literal CSS __@import__ shown below:
|
12
|
-
|
13
|
-
@import "reset.css"
|
14
|
-
|
15
|
-
### Stylus Import
|
16
|
-
|
17
|
-
When using __@import__ without the `.css` extension, it's assumed to be a Stylus sheet (e.g., `@import "mixins/border-radius"`).
|
18
|
-
|
19
|
-
__@import__ works by iterating an array of directories, and checking if this file lives in any of them (similar to node's `require.paths`). This array defaults to a single path, which is derived from the `filename` option's `dirname`. So, if your filename is `/tmp/testing/stylus/main.styl`, then import will look in `/tmp/testing/stylus/`.
|
20
|
-
|
21
|
-
__@import__ also supports index styles. This means when you `@import blueprint`, it will resolve **either** `blueprint.styl` **or** `blueprint/index.styl`. This is really useful for libraries that want to expose all their features, while still allowing feature subsets to be imported.
|
22
|
-
|
23
|
-
For example, a common lib structure might be:
|
24
|
-
|
25
|
-
./tablet
|
26
|
-
|-- index.styl
|
27
|
-
|-- vendor.styl
|
28
|
-
|-- buttons.styl
|
29
|
-
|-- images.styl
|
30
|
-
|
31
|
-
In the example below, we set the `paths` options to provide additional paths to Stylus. Within `./test.styl`, we could then `@import "mixins/border-radius"`, or `@import "border-radius"` (since `./mixins` is exposed to Stylus).
|
32
|
-
|
33
|
-
/**
|
34
|
-
* Module dependencies.
|
35
|
-
*/
|
36
|
-
|
37
|
-
var stylus = require('../')
|
38
|
-
, str = require('fs').readFileSync(__dirname + '/test.styl', 'utf8');
|
39
|
-
|
40
|
-
var paths = [
|
41
|
-
__dirname
|
42
|
-
, __dirname + '/mixins'
|
43
|
-
];
|
44
|
-
|
45
|
-
stylus(str)
|
46
|
-
.set('filename', __dirname + '/test.styl')
|
47
|
-
.set('paths', paths)
|
48
|
-
.render(function(err, css){
|
49
|
-
if (err) throw err;
|
50
|
-
console.log(css);
|
51
|
-
});
|
52
|
-
|
53
|
-
### JavaScript Import API
|
54
|
-
|
55
|
-
When using the `.import(path)` method, these imports are deferred until evaluation:
|
56
|
-
|
57
|
-
var stylus = require('../')
|
58
|
-
, str = require('fs').readFileSync(__dirname + '/test.styl', 'utf8');
|
59
|
-
|
60
|
-
stylus(str)
|
61
|
-
.set('filename', __dirname + '/test.styl')
|
62
|
-
.import('mixins/vendor')
|
63
|
-
.render(function(err, css){
|
64
|
-
if (err) throw err;
|
65
|
-
console.log(css);
|
66
|
-
});
|
67
|
-
|
68
|
-
The following statement...
|
69
|
-
|
70
|
-
@import 'mixins/vendor'
|
71
|
-
|
72
|
-
...is equivalent to...
|
73
|
-
|
74
|
-
.import('mixins/vendor')
|
75
|
-
|
@@ -1,55 +0,0 @@
|
|
1
|
-
|
2
|
-
## Interpolation
|
3
|
-
|
4
|
-
Stylus supports interpolation by using the `{}` characters to surround an expression, which then becomes part of the identifier. For example, `-webkit-{'border' + '-radius'}` evaluates to `-webkit-border-radius`.
|
5
|
-
|
6
|
-
A great example use-case for this is expanding properties with vendor prefixes.
|
7
|
-
|
8
|
-
vendor(prop, args)
|
9
|
-
-webkit-{prop} args
|
10
|
-
-moz-{prop} args
|
11
|
-
{prop} args
|
12
|
-
|
13
|
-
border-radius()
|
14
|
-
vendor('border-radius', arguments)
|
15
|
-
|
16
|
-
box-shadow()
|
17
|
-
vendor('box-shadow', arguments)
|
18
|
-
|
19
|
-
button
|
20
|
-
border-radius 1px 2px / 3px 4px
|
21
|
-
|
22
|
-
Yields:
|
23
|
-
|
24
|
-
button {
|
25
|
-
-webkit-border-radius: 1px 2px / 3px 4px;
|
26
|
-
-moz-border-radius: 1px 2px / 3px 4px;
|
27
|
-
border-radius: 1px 2px / 3px 4px;
|
28
|
-
}
|
29
|
-
|
30
|
-
## Selector Interpolation
|
31
|
-
|
32
|
-
Interpolation works with selectors as well. For example, we may iterate to assign the `height` property for the first 5 rows in a table, as shown below:
|
33
|
-
|
34
|
-
table
|
35
|
-
for row in 1 2 3 4 5
|
36
|
-
tr:nth-child({row})
|
37
|
-
height: 10px * row
|
38
|
-
|
39
|
-
Yields:
|
40
|
-
|
41
|
-
table tr:nth-child(1) {
|
42
|
-
height: 10px;
|
43
|
-
}
|
44
|
-
table tr:nth-child(2) {
|
45
|
-
height: 20px;
|
46
|
-
}
|
47
|
-
table tr:nth-child(3) {
|
48
|
-
height: 30px;
|
49
|
-
}
|
50
|
-
table tr:nth-child(4) {
|
51
|
-
height: 40px;
|
52
|
-
}
|
53
|
-
table tr:nth-child(5) {
|
54
|
-
height: 50px;
|
55
|
-
}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
|
2
|
-
## Introspection API
|
3
|
-
|
4
|
-
Stylus supports an introspection API. This allows mixins and functions to reflect relative to the caller, etc.
|
5
|
-
|
6
|
-
|
7
|
-
## mixin
|
8
|
-
|
9
|
-
The `mixin` local variable is automatically assigned within function bodies.
|
10
|
-
It contains the string `root` if the function was called at the root
|
11
|
-
level, or `block` indicating otherwise, and finally `false` if the invoked function expects a return value.
|
12
|
-
|
13
|
-
In the following example, we define `reset()` to alter its behaviour depending on whether it's mixed into root, into another block, or into a return value, as used in the `foo` property below:
|
14
|
-
|
15
|
-
reset()
|
16
|
-
if mixin == 'root'
|
17
|
-
got
|
18
|
-
root true
|
19
|
-
else if mixin
|
20
|
-
got 'a mixin'
|
21
|
-
else
|
22
|
-
'not a mixin'
|
23
|
-
|
24
|
-
reset()
|
25
|
-
|
26
|
-
body
|
27
|
-
reset()
|
28
|
-
foo reset()
|
29
|
-
|
30
|
-
Compiles to:
|
31
|
-
|
32
|
-
got {
|
33
|
-
root: true;
|
34
|
-
}
|
35
|
-
body {
|
36
|
-
foo: "not a mixin";
|
37
|
-
got: "a mixin";
|
38
|
-
}
|
data/vendor/docs/iteration.md
DELETED
@@ -1,102 +0,0 @@
|
|
1
|
-
|
2
|
-
## Iteration
|
3
|
-
|
4
|
-
Stylus allows you to iterate expressions via the `for/in` construct, taking the form of:
|
5
|
-
|
6
|
-
for <val-name> [, <key-name>] in <expression>
|
7
|
-
|
8
|
-
For example:
|
9
|
-
|
10
|
-
body
|
11
|
-
for num in 1 2 3
|
12
|
-
foo num
|
13
|
-
|
14
|
-
Yields:
|
15
|
-
|
16
|
-
body {
|
17
|
-
foo: 1;
|
18
|
-
foo: 2;
|
19
|
-
foo: 3;
|
20
|
-
}
|
21
|
-
|
22
|
-
The example below shows how to use the `<key-name>`:
|
23
|
-
|
24
|
-
body
|
25
|
-
fonts = Impact Arial sans-serif
|
26
|
-
for font, i in fonts
|
27
|
-
foo i font
|
28
|
-
|
29
|
-
Yielding:
|
30
|
-
|
31
|
-
body {
|
32
|
-
foo: 0 Impact;
|
33
|
-
foo: 1 Arial;
|
34
|
-
foo: 2 sans-serif;
|
35
|
-
}
|
36
|
-
|
37
|
-
### Mixins
|
38
|
-
|
39
|
-
We can use iteration within mixins to produce powerful functionality. For example, we can apply expression pairs as properties using interpolation and iteration.
|
40
|
-
|
41
|
-
Below we define `apply()`, conditionally utilizing all the `arguments` so that comma-delimited _and_ expression lists are supported:
|
42
|
-
|
43
|
-
apply(props)
|
44
|
-
props = arguments if length(arguments) > 1
|
45
|
-
for prop in props
|
46
|
-
{prop[0]} prop[1]
|
47
|
-
|
48
|
-
body
|
49
|
-
apply(one 1, two 2, three 3)
|
50
|
-
|
51
|
-
body
|
52
|
-
list = (one 1) (two 2) (three 3)
|
53
|
-
apply(list)
|
54
|
-
|
55
|
-
### Functions
|
56
|
-
|
57
|
-
Stylus functions may also contain for-loops. Below are some example use-cases:
|
58
|
-
|
59
|
-
Sum:
|
60
|
-
|
61
|
-
sum(nums)
|
62
|
-
sum = 0
|
63
|
-
for n in nums
|
64
|
-
sum += n
|
65
|
-
|
66
|
-
sum(1 2 3)
|
67
|
-
// => 6
|
68
|
-
|
69
|
-
join:
|
70
|
-
|
71
|
-
join(delim, args)
|
72
|
-
buf = ''
|
73
|
-
for arg, index in args
|
74
|
-
if index
|
75
|
-
buf += delim + arg
|
76
|
-
else
|
77
|
-
buf += arg
|
78
|
-
|
79
|
-
join(', ', foo bar baz)
|
80
|
-
// => "foo, bar, baz"
|
81
|
-
|
82
|
-
### Postfix
|
83
|
-
|
84
|
-
Much like `if` / `unless` may be utilized post-statement, the same can be done with `for`. Below are the same examples as above utilizing the postfix syntax:
|
85
|
-
|
86
|
-
sum(nums)
|
87
|
-
sum = 0
|
88
|
-
sum += n for n in nums
|
89
|
-
|
90
|
-
|
91
|
-
join(delim, args)
|
92
|
-
buf = ''
|
93
|
-
buf += i ? delim + arg : arg for arg, i in args
|
94
|
-
|
95
|
-
We can also __return__ from within a loop, below is an example returning the
|
96
|
-
number when `n % 2 == 0` evaluates to __true__.
|
97
|
-
|
98
|
-
first-even(nums)
|
99
|
-
return n if n % 2 == 0 for n in nums
|
100
|
-
|
101
|
-
first-even(1 3 5 5 6 3 2)
|
102
|
-
// => 6
|
data/vendor/docs/js.md
DELETED
@@ -1,157 +0,0 @@
|
|
1
|
-
## JavaScript API
|
2
|
-
|
3
|
-
Simply `require` the module, and call `render()` with the given string of Stylus code, and (optional) `options` object.
|
4
|
-
|
5
|
-
Frameworks utilizing Stylus should pass the `filename` option to provide better error reporting.
|
6
|
-
|
7
|
-
var stylus = require('stylus');
|
8
|
-
|
9
|
-
stylus.render(str, { filename: 'nesting.css' }, function(err, css){
|
10
|
-
if (err) throw err;
|
11
|
-
console.log(css);
|
12
|
-
});
|
13
|
-
|
14
|
-
We can also do the same thing in a more progressive manner:
|
15
|
-
|
16
|
-
var stylus = require('stylus');
|
17
|
-
|
18
|
-
stylus(str)
|
19
|
-
.set('filename', 'nesting.css')
|
20
|
-
.render(function(err, css){
|
21
|
-
// logic
|
22
|
-
});
|
23
|
-
|
24
|
-
### .set(setting, value)
|
25
|
-
|
26
|
-
Apply a setting such as a `filename`, or import `paths`:
|
27
|
-
|
28
|
-
.set('filename', __dirname + '/test.styl')
|
29
|
-
.set('paths', [__dirname, __dirname + '/mixins'])
|
30
|
-
|
31
|
-
### .include(path)
|
32
|
-
|
33
|
-
A progressive alternative to `.set('paths',...)` is `.include()`. This is ideal when exposing external Stylus libraries which expose a path.
|
34
|
-
|
35
|
-
stylus(str)
|
36
|
-
.include(require('nib').path)
|
37
|
-
.include(process.env.HOME + '/mixins')
|
38
|
-
.render(...)
|
39
|
-
|
40
|
-
### .import(path)
|
41
|
-
|
42
|
-
Defer importing of the given `path` until evaluation is performed. The example below is essentially the same as doing `@import 'mixins/vendor'` within your Stylus sheet.
|
43
|
-
|
44
|
-
var stylus = require('../')
|
45
|
-
, str = require('fs').readFileSync(__dirname + '/test.styl', 'utf8');
|
46
|
-
|
47
|
-
stylus(str)
|
48
|
-
.set('filename', __dirname + '/test.styl')
|
49
|
-
.import('mixins/vendor')
|
50
|
-
.render(function(err, css){
|
51
|
-
if (err) throw err;
|
52
|
-
console.log(css);
|
53
|
-
});
|
54
|
-
|
55
|
-
### .define(name, node)
|
56
|
-
|
57
|
-
By passing a `Node`, we may define a global variable. This is useful when exposing conditional features within your library depending on the availability of another. For example the **Nib** extension library conditionally supports node-canvas, providing image generation.
|
58
|
-
|
59
|
-
However, this is not always available, so Nib may define:
|
60
|
-
|
61
|
-
.define('has-canvas', stylus.nodes.false);
|
62
|
-
.define('some-setting', new stylus.nodes.String('some value'));
|
63
|
-
|
64
|
-
Stylus also casts JavaScript values to their Stylus equivalents when possible. Here are a few examples:
|
65
|
-
|
66
|
-
.define('string', 'some string')
|
67
|
-
.define('number', 15.5)
|
68
|
-
.define('some-bool', true)
|
69
|
-
.define('list', [1,2,3])
|
70
|
-
.define('list', [1,2,[3,4,[5,6]]])
|
71
|
-
.define('list', { foo: 'bar', bar: 'baz' })
|
72
|
-
.define('families', ['Helvetica Neue', 'Helvetica', 'sans-serif'])
|
73
|
-
|
74
|
-
These same rules apply to return values in js functions as well:
|
75
|
-
|
76
|
-
.define('get-list', function(){
|
77
|
-
return ['foo', 'bar', 'baz'];
|
78
|
-
})
|
79
|
-
|
80
|
-
### .define(name, fn)
|
81
|
-
|
82
|
-
This method allows you to provide a JavaScript-defined function to Stylus. Think of these as you would JavaScript-to-C++ bindings. When there's something you cannot do in Stylus, define it in JavaScript!
|
83
|
-
|
84
|
-
In this example, we define four functions: `add()`, `sub()`, `image-width()`, and `image-height()`. These functions must return a `Node`, this constructor and the other nodes are available via `stylus.nodes`.
|
85
|
-
|
86
|
-
var stylus = require('../')
|
87
|
-
, nodes = stylus.nodes
|
88
|
-
, utils = stylus.utils
|
89
|
-
, fs = require('fs');
|
90
|
-
|
91
|
-
function add(a, b) {
|
92
|
-
return a.operate('+', b);
|
93
|
-
}
|
94
|
-
|
95
|
-
function sub(a, b) {
|
96
|
-
return a.operate('-', b);
|
97
|
-
}
|
98
|
-
|
99
|
-
function imageDimensions(img) {
|
100
|
-
// assert that the node (img) is a String node, passing
|
101
|
-
// the param name for error reporting
|
102
|
-
utils.assertType(img, 'string', 'img');
|
103
|
-
var path = img.val;
|
104
|
-
|
105
|
-
// Grab bytes necessary to retrieve dimensions.
|
106
|
-
// if this was real you would do this per format,
|
107
|
-
// instead of reading the entire image :)
|
108
|
-
var data = fs.readFileSync(__dirname + '/' + path);
|
109
|
-
|
110
|
-
// GIF
|
111
|
-
// of course you would support.. more :)
|
112
|
-
if ('GIF' == data.slice(0, 3).toString()) {
|
113
|
-
var w = data.slice(6, 8)
|
114
|
-
, h = data.slice(8, 10);
|
115
|
-
w = w[1] << 8 | w[0];
|
116
|
-
h = h[1] << 8 | h[0];
|
117
|
-
}
|
118
|
-
|
119
|
-
return [w, h];
|
120
|
-
}
|
121
|
-
|
122
|
-
function imageWidth(img) {
|
123
|
-
return new nodes.Unit(imageDimensions(img)[0]);
|
124
|
-
}
|
125
|
-
|
126
|
-
function imageHeight(img) {
|
127
|
-
return new nodes.Unit(imageDimensions(img)[1]);
|
128
|
-
}
|
129
|
-
|
130
|
-
stylus(str)
|
131
|
-
.set('filename', 'js-functions.styl')
|
132
|
-
.define('add', add)
|
133
|
-
.define('sub', sub)
|
134
|
-
.define('image-width', imageWidth)
|
135
|
-
.define('image-height', imageHeight)
|
136
|
-
.render(function(err, css){
|
137
|
-
if (err) throw err;
|
138
|
-
console.log(css);
|
139
|
-
});
|
140
|
-
|
141
|
-
For further reference (until documentation is complete) please see the following files:
|
142
|
-
|
143
|
-
- `lib/nodes/*`
|
144
|
-
- `lib/utils.js`
|
145
|
-
|
146
|
-
### .use(fn)
|
147
|
-
|
148
|
-
When called, the given `fn` is invoked with the renderer, allowing all of the methods above to be used. This allows for plugins to easily expose themselves, defining functions, paths etc.
|
149
|
-
|
150
|
-
var mylib = function(style){
|
151
|
-
style.define('add', add);
|
152
|
-
style.define('sub', sub);
|
153
|
-
};
|
154
|
-
|
155
|
-
stylus(str)
|
156
|
-
.use(mylib)
|
157
|
-
.render(...)
|