stylus-source 0.22.6 → 0.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -56,7 +56,7 @@ The logical `not` operator has low precedence, therefore the following example c
56
56
  // => false
57
57
  // pased as: (!a) and (!b)
58
58
 
59
- with:
59
+ With:
60
60
 
61
61
  not a or b
62
62
  // => false
@@ -66,9 +66,9 @@ with:
66
66
 
67
67
  ### Subscript []
68
68
 
69
- The subscript operator allows us to grab a value in an expression via index. Parenthesized expressions may act as tuples, so for example `(15px 5px)`, `(1 2 3)`.
69
+ The subscript operator allows us to grab a value inside an expression via index. Parenthesized expressions may act as tuples (e.g. `(15px 5px)`, `(1 2 3)`).
70
70
 
71
- Below is an example where we utilize tuples for error handling, showing the versatility of such a construct. As
71
+ Below is an example that uses tuples for error handling (and showcasing the versatility of this construct):
72
72
 
73
73
  add(a, b)
74
74
  if a is a 'unit' and b is a 'unit'
@@ -89,7 +89,7 @@ with:
89
89
  padding add(1,'5')[1]
90
90
  // => padding: "a and b must be units";
91
91
 
92
- A more complex example, invoking the `error()` built-in function with the error message returned, when the ident (the first value) equals `error`.
92
+ Here's a more complex example. Now we're invoking the built-in `error()` function with the return error message, whenever the ident (the first value) equals `error`.
93
93
 
94
94
 
95
95
  if (val = add(1,'5'))[0] == error
@@ -107,7 +107,7 @@ with:
107
107
 
108
108
  ### Additive: + -
109
109
 
110
- multiplicative and additive binary operators work as expected, and type conversion is applied within unit type classes, or default to the literal value. For example if we perform `5s - 2px` we will get `3s`.
110
+ Multiplicative and additive binary operators work as expected. Type conversion is applied within unit type classes, or default to the literal value. For example `5s - 2px` results in `3s`.
111
111
 
112
112
  15px - 5px
113
113
  // => 10px
@@ -141,15 +141,15 @@ multiplicative and additive binary operators work as expected, and type conversi
141
141
  4 % 2
142
142
  // => 0
143
143
 
144
- When using `/` within a property value you must wrap with parens. The following for example is taken literally, to support css line-height:
144
+ When using `/` within a property value, you **must** wrap with parens. Otherwise the `/` is taken literally (to support CSS `line-height`):
145
145
 
146
146
  font: 14px/1.5;
147
147
 
148
- whereas the following is evaluated, dividing `14px` by `1.5`:
148
+ But the following is evaluated as `14px` ÷ `1.5`:
149
149
 
150
150
  font: (14px/1.5);
151
151
 
152
- this exception is _only_ required for the `/` operator.
152
+ This is _only_ required for the `/` operator.
153
153
 
154
154
  ### Exponent: **
155
155
 
@@ -160,7 +160,7 @@ The Exponent operator:
160
160
 
161
161
  ### Equality & Relational: == != >= <= > <
162
162
 
163
- Equality operators can be used to equate units, colors, strings, and even identifiers. This is a powerful concept, as even arbitrary identifiers such as as `wahoo` can be utilized as atoms, a function could return `yes` or `no` instead of `true` or `false` (although not advised).
163
+ Equality operators can be used to equate units, colors, strings, and even identifiers. This is a powerful concept, as even arbitrary identifiers (such as as `wahoo`) can be utilized as atoms. A function could return `yes` or `no` instead of `true` or `false` (although not advised).
164
164
 
165
165
  5 == 5
166
166
  // => true
@@ -201,7 +201,7 @@ Equality operators can be used to equate units, colors, strings, and even identi
201
201
  (1 2 3) == (1 1 3)
202
202
  // => false
203
203
 
204
- Only exact values match, for example `0 == false`, and `null == false` are both `false`.
204
+ Only exact values match. For example, `0 == false` and `null == false` are both `false`.
205
205
 
206
206
  Aliases:
207
207
 
@@ -211,7 +211,11 @@ Aliases:
211
211
 
212
212
  ## Truthfulness
213
213
 
214
- Nearly everything within Stylus resolves to `true`, including units with a suffix, for example even `0%`, `0px`, etc will resolve to `true`, since commonly in Stylus a mixin or function may accept such units as valid, however `0` itself is `false` in terms of arithmetic. Expressions or "lists" with a length greater than 1 are considered truthy.
214
+ Nearly everything within Stylus resolves to `true`, including units with a suffix. Even `0%`, `0px`, etc. will resolve to `true` (because it's common in Stylus for mixins or functions to accept units as valid).
215
+
216
+ However, `0` itself is `false` in terms of arithmetic.
217
+
218
+ Expressions (or "lists") with a length greater than 1 are considered truthy.
215
219
 
216
220
  `true` examples:
217
221
 
@@ -302,7 +306,7 @@ Example usage in mixin:
302
306
  body
303
307
  pad(padding margin, 10px)
304
308
 
305
- yielding:
309
+ Yielding:
306
310
 
307
311
  body {
308
312
  padding: 5px;
@@ -317,13 +321,15 @@ yielding:
317
321
 
318
322
  ### Conditional Assignment: ?= :=
319
323
 
320
- The conditional assignment operator `?=` (aliased as `:=`) lets us define variables without clobbering old values (when present). This operator expands to an `is defined` binary operation within a ternary, for example the following are equivalent:
324
+ The conditional assignment operator `?=` (aliased as `:=`) lets us define variables without clobbering old values (if present). This operator expands to an `is defined` binary operation within a ternary.
325
+
326
+ For example, the following are equivalent:
321
327
 
322
328
  color := white
323
329
  color ?= white
324
330
  color = color is defined ? color : white
325
331
 
326
- For example when using `=` we simply re-assign:
332
+ When using plain `=`, we simply reassign:
327
333
 
328
334
  color = white
329
335
  color = black
@@ -331,7 +337,7 @@ For example when using `=` we simply re-assign:
331
337
  color
332
338
  // => black
333
339
 
334
- However when using `?=` our second attempt fails since the variable is already defined:
340
+ But when using `?=`, our second attempt fails (since the variable is already defined):
335
341
 
336
342
  color = white
337
343
  color ?= black
@@ -352,12 +358,12 @@ Stylus provides a binary operator named `is a` used to type check.
352
358
  15 is a 'rgba'
353
359
  // => false
354
360
 
355
- Alternatively we could use the `type()` BIF:
361
+ Alternatively, we could use the `type()` BIF:
356
362
 
357
363
  type(#fff) == 'rgba'
358
364
  // => true
359
365
 
360
- 'color' is the one special-case, evaluating to true when the
366
+ **Note:** `color` is the only special-case, evaluating to `true` when the
361
367
  left-hand operand is an `RGBA` or `HSLA` node.
362
368
 
363
369
  ### Variable Definition: is defined
@@ -374,7 +380,7 @@ This pseudo binary operator does not accept a right-hand operator, and does _not
374
380
  #fff is defined
375
381
  // => 'invalid "is defined" check on non-variable #fff'
376
382
 
377
- Alternatively one can use the `lookup(name)` built-in function to do this, or to perform dynamic lookups:
383
+ Alternatively, one can use the `lookup(name)` built-in function to do thisor to perform dynamic lookups:
378
384
 
379
385
  name = 'blue'
380
386
  lookup('light-' + name)
@@ -390,13 +396,13 @@ This operator is essential, as an undefined identifier is still a truthy value.
390
396
  if ohnoes
391
397
  padding 5px
392
398
 
393
- _will_ yield the following css when undefined:
399
+ _Will_ yield the following CSS when undefined:
394
400
 
395
401
  body {
396
402
  padding: 5px;
397
403
  }
398
404
 
399
- however this will be safe:
405
+ However this will be safe:
400
406
 
401
407
  body
402
408
  if ohnoes is defined
@@ -404,7 +410,7 @@ however this will be safe:
404
410
 
405
411
  ## Ternary
406
412
 
407
- The ternary operator works as we would expect in most languages, being the only operator with three operands, the _condition_ expression, the _truth_ expression and the _false_ expression.
413
+ The ternary operator works as we would expect in most languages. It's the only operator with three operands (the _condition_ expression, the _truth_ expression, and the _false_ expression).
408
414
 
409
415
  num = 15
410
416
  num ? unit(num, 'px') : 20px
@@ -425,12 +431,12 @@ The ternary operator works as we would expect in most languages, being the only
425
431
 
426
432
  ## Color Operations
427
433
 
428
- Operations on colors provide a terse, expressive way to alter components. For example we can operate on each RGB:
434
+ Operations on colors provide a terse, expressive way to alter components. For example, we can operate on each RGB:
429
435
 
430
436
  #0e0 + #0e0
431
437
  // => #0f0
432
438
 
433
- Another example is adjust the lightness value by adding or subtracting a percentage. To lighten a color we add, to darken we subtract.
439
+ Another example is adjust the lightness value by adding or subtracting a percentage. To lighten a color, add; to darken, subtract.
434
440
 
435
441
  #888 + 50%
436
442
  // => #c3c3c3
@@ -438,14 +444,14 @@ The ternary operator works as we would expect in most languages, being the only
438
444
  #888 - 50%
439
445
  // => #444
440
446
 
441
- Adjust the hue is also possible by adding or subtracting with degrees, for example adding `50deg` to this red value, resulting in a yellow:
447
+ Adjust the hue is also possible by adding or subtracting with degrees. For example, adding `50deg` to this red value results in a yellow:
442
448
 
443
449
  #f00 + 50deg
444
450
  // => #ffd500
445
451
 
446
- Values clamp appropriately, for example we can "spin" the hue 180 degrees, and if the current value is `320deg`, it will resolve to `140deg`.
452
+ Values clamp appropriately. For example, we can "spin" the hue 180 degrees, and if the current value is `320deg`, it will resolve to `140deg`.
447
453
 
448
- We may also tweak several values at once, including the alpha by using `rgb()`, `rgba()`, `hsl()`, or `hsla()`:
454
+ We may also tweak several values at once (including the alpha) by using `rgb()`, `rgba()`, `hsl()`, or `hsla()`:
449
455
 
450
456
  #f00 - rgba(100,0,0,0.5)
451
457
  // => rgba(155,0,0,0.5)
@@ -2,25 +2,25 @@
2
2
 
3
3
  ### Indentation
4
4
 
5
- Stylus is "pythonic" aka indentation-based. Whitespace is significant, so we substitute { and } with an _indent_, and an _outdent_ as shown below:
5
+ Stylus is "pythonic" (i.e. indentation-based). Whitespace is significant, so we substitute `{` and `}` with an _indent_, and an _outdent_ as shown below:
6
6
 
7
7
  body
8
8
  color white
9
9
 
10
- which compiles to:
10
+ Which compiles to:
11
11
 
12
12
  body {
13
13
  color: #fff;
14
14
  }
15
15
 
16
- Optionally if preferred we may utilize colons to separate properties and their values:
16
+ If preferred, you can use colons to separate properties and values:
17
17
 
18
18
  body
19
19
  color: white
20
20
 
21
21
  ### Rule Sets
22
22
 
23
- Stylus, just like css allows you to define properties for several selectors at once through comma separation.
23
+ Stylus, just like CSS, allows you to define properties for several selectors at once through comma separation.
24
24
 
25
25
  textarea, input
26
26
  border 1px solid #eee
@@ -31,20 +31,20 @@ The same can be done with a newline:
31
31
  input
32
32
  border 1px solid #eee
33
33
 
34
- both compiling to:
34
+ Both compile to:
35
35
 
36
36
  textarea,
37
37
  input {
38
38
  border: 1px solid #eee;
39
39
  }
40
40
 
41
- The one exception to this rule, are selectors that look like properties, for example `foo bar baz` in the following may be a property, or a selector:
41
+ **The only exception to this rule** are selectors that look like properties. For example, the following `foo bar baz` might be a property **or** a selector:
42
42
 
43
43
  foo bar baz
44
44
  > input
45
45
  border 1px solid
46
46
 
47
- so for this reason, or if simply preferred we may trail with a comma:
47
+ So for this reason (or simply if preferred), we may trail with a comma:
48
48
 
49
49
  foo bar baz,
50
50
  form input,
@@ -53,7 +53,7 @@ so for this reason, or if simply preferred we may trail with a comma:
53
53
 
54
54
  ### Parent Reference
55
55
 
56
- The `&` character references the parent selector(s). In the example below our two selectors `textarea`, and `input` both alter the `color` on the `:hover` pseudo selector.
56
+ The `&` character references the parent selector(s). In the example below our two selectors (`textarea` and `input`) both alter the `color` on the `:hover` pseudo selector.
57
57
 
58
58
  textarea
59
59
  input
@@ -61,7 +61,7 @@ The `&` character references the parent selector(s). In the example below our tw
61
61
  &:hover
62
62
  color #000
63
63
 
64
- compiles to:
64
+ Compiles to:
65
65
 
66
66
  textarea,
67
67
  input {
@@ -72,7 +72,7 @@ compiles to:
72
72
  color: #000;
73
73
  }
74
74
 
75
- below is an example providing a simple `2px` border for internet exploder utilizing the parent reference within a mixin:
75
+ Below is an example providing a simple `2px` border for Internet Exploder utilizing the parent reference within a mixin:
76
76
 
77
77
  box-shadow()
78
78
  -webkit-box-shadow arguments
@@ -87,7 +87,7 @@ below is an example providing a simple `2px` border for internet exploder utiliz
87
87
  #login
88
88
  box-shadow 1px 1px 3px #eee
89
89
 
90
- yielding:
90
+ Yielding:
91
91
 
92
92
  body #login {
93
93
  -webkit-box-shadow: 1px 1px 3px #eee;
@@ -102,7 +102,7 @@ yielding:
102
102
 
103
103
  ### Disambiguation
104
104
 
105
- Expressions such as `padding - n` could be interpreted both as a subtraction operation, as well as a property with an unary minus. To disambiguate we can wrap the expression with parens:
105
+ Expressions such as `padding - n` could be interpreted both as a subtraction operation, as well as a property with an unary minus. To disambiguate, wrap the expression with parens:
106
106
 
107
107
  pad(n)
108
108
  padding (- n)
@@ -110,22 +110,24 @@ Expressions such as `padding - n` could be interpreted both as a subtraction ope
110
110
  body
111
111
  pad(5px)
112
112
 
113
- compiles to:
113
+ Compiles to:
114
114
 
115
115
  body {
116
116
  padding: -5px;
117
117
  }
118
118
 
119
- however this is only true in functions, since functions act both as mixins, or calls with return values. For example this is fine, and will yield the same results as above:
119
+ However, this is only true in functions (since functions act both as mixins, or calls with return values).
120
+
121
+ For example, the following is fine (and yields the same results as above):
120
122
 
121
123
  body
122
124
  padding -5px
123
125
 
124
- Have weird property values that Stylus cannot process? `unquote()` can help you out:
126
+ Have weird property values that Stylus can't process? `unquote()` can help you out:
125
127
 
126
128
  filter unquote('progid:DXImageTransform.Microsoft.BasicImage(rotation=1)')
127
129
 
128
- yields:
130
+ Yields:
129
131
 
130
132
  filter progid:DXImageTransform.Microsoft.BasicImage(rotation=1)
131
133
 
@@ -1,4 +1,4 @@
1
1
 
2
2
  ## TextMate Bundle
3
3
 
4
- Stylus ships with a TextMate bundle, located within `./editors`. To install simply execute `make install-bundle`, or place `./editors/Stylus.tmbundle` in the appropriate location.
4
+ Stylus ships with a TextMate bundle, located within `./editors`. To install, simply execute `make install-bundle`, or place `./editors/Stylus.tmbundle` in the appropriate location.
data/vendor/docs/vargs.md CHANGED
@@ -1,10 +1,10 @@
1
1
 
2
2
  ## Rest Parameters
3
3
 
4
- Stylus supports rest parameters in the form of `name...`. These params consume the remaining arguments passed to a mixin or function. This is useful for example when utilizing the implicit function call support to apply vendor prefixes like `-webkit` or `-moz`.
4
+ Stylus supports rest parameters in the form of `name...`. These params consume the remaining arguments passed to a mixin or function. This is useful when utilizing (for example) the implicit function call support to apply vendor prefixes like `-webkit` or `-moz`.
5
5
 
6
6
 
7
- In the example below we consume all the arguments passed and simply apply them to multiple properties.
7
+ In the example below, we consume all the arguments passed, and simply apply them to multiple properties.
8
8
 
9
9
  box-shadow(args...)
10
10
  -webkit-box-shadow args
@@ -14,7 +14,7 @@ In the example below we consume all the arguments passed and simply apply them t
14
14
  #login
15
15
  box-shadow 1px 2px 5px #eee
16
16
 
17
- yielding:
17
+ Yielding:
18
18
 
19
19
  #login {
20
20
  -webkit-box-shadow: 1px 2px 5px #eee;
@@ -22,7 +22,7 @@ yielding:
22
22
  box-shadow: 1px 2px 5px #eee;
23
23
  }
24
24
 
25
- If we wanted to peek at a specific argument, for example the x-offset we could simply use `args[0]`, or for example we may wish to re-define the mixin:
25
+ If we wanted to peek at a specific argument—say, `x-offset`—we could simply use `args[0]`. Or, we may wish to redefine the mixin:
26
26
 
27
27
  box-shadow(offset-x, args...)
28
28
  got-offset-x offset-x
@@ -33,7 +33,7 @@ If we wanted to peek at a specific argument, for example the x-offset we could s
33
33
  #login
34
34
  box-shadow 1px 2px 5px #eee
35
35
 
36
- yielding:
36
+ Yielding:
37
37
 
38
38
  #login {
39
39
  got-offset-x: 1px;
@@ -44,9 +44,9 @@ yielding:
44
44
 
45
45
  ### arguments
46
46
 
47
- The `arguments` variable is injected into mixin and function bodies, containing the exact expression passed. This is useful for several reasons, primarily for vendor support, as you get the _exact_ expression, commas and all.
47
+ The `arguments` variable is injected into mixin and function bodies, containing the exact expression passed. This is useful for several reasons (especially vendor support) as you get the _exact_ expression, commas and all.
48
48
 
49
- For example, if we use a rest param, the comma is simply consumed since it is an expression delimiter:
49
+ For example, if we use a rest param, the comma is consumed (since it is an expression delimiter):
50
50
 
51
51
  box-shadow(args...)
52
52
  -webkit-box-shadow args
@@ -56,7 +56,7 @@ yielding:
56
56
  #login
57
57
  box-shadow #ddd 1px 1px, #eee 2px 2px
58
58
 
59
- yielding slightly unexpected results:
59
+ Yielding undesired results:
60
60
 
61
61
  #login {
62
62
  -webkit-box-shadow: #ddd 1px 1px #eee 2px 2px;
@@ -74,7 +74,7 @@ Let's redefine the mixin using `arguments`:
74
74
  body
75
75
  box-shadow #ddd 1px 1px, #eee 2px 2px
76
76
 
77
- now yielding the desired result:
77
+ Now, yielding the desired result:
78
78
 
79
79
  body {
80
80
  -webkit-box-shadow: #ddd 1px 1px, #eee 2px 2px;
@@ -8,7 +8,7 @@ We may assign expressions to variables and use them throughout our stylesheet:
8
8
  body
9
9
  font font-size Arial, sans-serif
10
10
 
11
- compiles to:
11
+ Compiles to:
12
12
 
13
13
  body {
14
14
  font: 14px Arial, sans-serif;
@@ -22,13 +22,13 @@ Variables can even consist of an expression list:
22
22
  body
23
23
  font font sans-serif
24
24
 
25
- compiles to:
25
+ Compiles to:
26
26
 
27
27
  body {
28
28
  font: 14px "Lucida Grande", Arial sans-serif;
29
29
  }
30
30
 
31
- identifiers (variable names, functions, etc) may also include the `$` character, for example:
31
+ Identifiers (variable names, functions, etc.) may also include the `$` character. For example:
32
32
 
33
33
  $font-size = 14px
34
34
  body {
@@ -38,7 +38,7 @@ identifiers (variable names, functions, etc) may also include the `$` character,
38
38
  ## Property Lookup
39
39
 
40
40
  Another cool feature unique to Stylus is the ability to reference
41
- properties defined _without_ assigning their values to variables. A great example of this is the logic required for vertically and horizontally center an element, which is typically done by using percentages and negative margins as shown:
41
+ properties defined _without_ assigning their values to variables. A great example of this is the logic required for vertically and horizontally center an element (typically done using percentages and negative margins, as follows):
42
42
 
43
43
  #logo
44
44
  position: absolute
@@ -49,7 +49,7 @@ identifiers (variable names, functions, etc) may also include the `$` character,
49
49
  margin-left: -(w / 2)
50
50
  margin-top: -(h / 2)
51
51
 
52
- Instead of assigning the variables `w` and `h` we can simply prepend the `@`
52
+ Instead of assigning the variables `w` and `h`, we can simply prepend the `@`
53
53
  character to the property name to access the value:
54
54
 
55
55
  #logo
@@ -61,7 +61,7 @@ identifiers (variable names, functions, etc) may also include the `$` character,
61
61
  margin-left: -(@width / 2)
62
62
  margin-top: -(@height / 2)
63
63
 
64
- Another useful use-case is conditionally defining properties based on the existence of others within mixins. In the following example we apply a default `z-index` of `1`, but _only_ if `z-index` was not previously specified.
64
+ Another use-case is conditionally defining properties within mixins based on the existence of others . In the following example, we apply a default `z-index` of `1`—but _only_ if `z-index` was not previously specified:
65
65
 
66
66
  position()
67
67
  position: arguments
@@ -74,7 +74,7 @@ identifiers (variable names, functions, etc) may also include the `$` character,
74
74
  #logo2
75
75
  position: absolute
76
76
 
77
- Property lookup will "bubble" up the stack until found, or return `null` if the property cannot be resolved. In the following example `@color` will resolve to `blue`.
77
+ Property lookup will "bubble up" the stack until found, or return `null` if the property cannot be resolved. In the following example, `@color` will resolve to `blue`:
78
78
 
79
79
  body
80
80
  color: red
@@ -29,6 +29,17 @@ var Extend = module.exports = function Extend(selector){
29
29
 
30
30
  Extend.prototype.__proto__ = Node.prototype;
31
31
 
32
+ /**
33
+ * Return a clone of this node.
34
+ *
35
+ * @return {Node}
36
+ * @api public
37
+ */
38
+
39
+ Extend.prototype.clone = function(){
40
+ return new Extend(this.selector);
41
+ };
42
+
32
43
  /**
33
44
  * Return `@extend selector`.
34
45
  *
@@ -10,6 +10,7 @@
10
10
  */
11
11
 
12
12
  var Parser = require('./parser')
13
+ , EventEmitter = require('events').EventEmitter
13
14
  , Compiler = require('./visitor/compiler')
14
15
  , Evaluator = require('./visitor/evaluator')
15
16
  , Normalizer = require('./visitor/normalizer')
@@ -18,6 +19,12 @@ var Parser = require('./parser')
18
19
  , path = require('path')
19
20
  , join = path.join;
20
21
 
22
+ /**
23
+ * Expose `Renderer`.
24
+ */
25
+
26
+ module.exports = Renderer;
27
+
21
28
  /**
22
29
  * Initialize a new `Renderer` with the given `str` and `options`.
23
30
  *
@@ -26,7 +33,7 @@ var Parser = require('./parser')
26
33
  * @api public
27
34
  */
28
35
 
29
- var Renderer = module.exports = function Renderer(str, options) {
36
+ function Renderer(str, options) {
30
37
  options = options || {};
31
38
  options.globals = {};
32
39
  options.functions = {};
@@ -37,6 +44,12 @@ var Renderer = module.exports = function Renderer(str, options) {
37
44
  this.str = str;
38
45
  };
39
46
 
47
+ /**
48
+ * Inherit from `EventEmitter.prototype`.
49
+ */
50
+
51
+ Renderer.prototype.__proto__ = EventEmitter.prototype;
52
+
40
53
  /**
41
54
  * Parse and evaluate AST, then callback `fn(err, css, js)`.
42
55
  *
@@ -61,10 +74,10 @@ Renderer.prototype.render = function(fn){
61
74
 
62
75
  // compile
63
76
  var compiler = new Compiler(ast, this.options)
64
- , css = compiler.compile()
65
- , js = compiler.js;
77
+ , css = compiler.compile();
66
78
 
67
- fn(null, css, js);
79
+ this.emit('end', css);
80
+ fn(null, css);
68
81
  } catch (err) {
69
82
  var options = {};
70
83
  options.input = err.input || this.str;
data/vendor/lib/stylus.js CHANGED
@@ -24,7 +24,7 @@ exports = module.exports = render;
24
24
  * Library version.
25
25
  */
26
26
 
27
- exports.version = '0.22.6';
27
+ exports.version = '0.23.0';
28
28
 
29
29
  /**
30
30
  * Expose nodes.
@@ -772,7 +772,7 @@ Evaluator.prototype.invokeBuiltin = function(fn, args){
772
772
  }
773
773
 
774
774
  // Invoke the BIF
775
- var body = fn.apply(this, args);
775
+ var body = nodes.cast(fn.apply(this, args));
776
776
 
777
777
  // Always wrapping allows js functions
778
778
  // to return several values with a single
data/vendor/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  { "name": "stylus"
2
2
  , "description": "Robust, expressive, and feature-rich CSS superset"
3
- , "version": "0.22.6"
3
+ , "version": "0.23.0"
4
4
  , "author": "TJ Holowaychuk <tj@vision-media.ca>"
5
5
  , "keywords": ["css", "parser", "style", "stylesheets", "jade", "language"]
6
6
  , "repository": "git://github.com/learnboost/stylus"
@@ -0,0 +1,10 @@
1
+ body {
2
+ color: #f00;
3
+ color: #008000;
4
+ color: #00f;
5
+ }
6
+ body {
7
+ color: #f00;
8
+ color: #008000;
9
+ color: #00f;
10
+ }
@@ -0,0 +1,11 @@
1
+ list = red green blue
2
+ no-colors = false
3
+
4
+ body
5
+ color: color for color in list if length(list) > 2 unless no-colors
6
+
7
+ mixin()
8
+ color: color for color in list if length(list) > 2 unless no-colors
9
+
10
+ body
11
+ mixin()
@@ -20,7 +20,11 @@ stylus(str)
20
20
  .define('string', 'some string')
21
21
  .define('number', 15.5)
22
22
  .define('some-bool', true)
23
- .define('list', ['Helvetica Neue', 'Helvetica', 'sans-serif'])
23
+ .define('list', function(){
24
+ return function(){
25
+ return ['Helvetica Neue', 'Helvetica', 'sans-serif']
26
+ }
27
+ })
24
28
  .render(function(err, css, js){
25
29
  if (err) throw err;
26
30
  process.stdout.write(css);
@@ -1,4 +1,6 @@
1
1
 
2
+ val = list()
3
+ p(val)
2
4
 
3
5
  //
4
6
  // obj = {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stylus-source
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.6
4
+ version: 0.23.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-24 00:00:00.000000000 Z
12
+ date: 2012-02-06 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Robust, expressive, and feature-rich CSS superset. This gem packages
15
15
  up stylus for use with the stylus gem.
@@ -328,6 +328,8 @@ files:
328
328
  - vendor/test/cases/css.selectors.styl
329
329
  - vendor/test/cases/css.whitespace.css
330
330
  - vendor/test/cases/css.whitespace.styl
331
+ - vendor/test/cases/dumb.css
332
+ - vendor/test/cases/dumb.styl
331
333
  - vendor/test/cases/eol-escape.css
332
334
  - vendor/test/cases/eol-escape.styl
333
335
  - vendor/test/cases/escape.css