stylus-source 0.27.2 → 0.28.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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.27.2
1
+ 0.28.0
@@ -12,7 +12,8 @@
12
12
  var Compiler = require('../visitor/compiler')
13
13
  , nodes = require('../nodes')
14
14
  , utils = require('../utils')
15
- , Image = require('./image');
15
+ , Image = require('./image')
16
+ , path = require('path');
16
17
 
17
18
  /**
18
19
  * Color component name map.
@@ -174,6 +175,60 @@ exports.component = function component(color, name) {
174
175
  return new nodes.Unit(color[type][name], unit);
175
176
  };
176
177
 
178
+ /**
179
+ * Return the basename of `path`.
180
+ *
181
+ * @param {String} path
182
+ * @return {String}
183
+ * @api public
184
+ */
185
+
186
+ exports.basename = function basename(p, ext){
187
+ utils.assertString(p, 'path');
188
+ return path.basename(p.val, ext && ext.val);
189
+ };
190
+
191
+ /**
192
+ * Return the dirname of `path`.
193
+ *
194
+ * @param {String} path
195
+ * @return {String}
196
+ * @api public
197
+ */
198
+
199
+ exports.dirname = function dirname(p){
200
+ utils.assertString(p, 'path');
201
+ return path.dirname(p.val);
202
+ };
203
+
204
+ /**
205
+ * Return the extname of `path`.
206
+ *
207
+ * @param {String} path
208
+ * @return {String}
209
+ * @api public
210
+ */
211
+
212
+ exports.extname = function extname(p){
213
+ utils.assertString(p, 'path');
214
+ return path.extname(p.val);
215
+ };
216
+
217
+ /**
218
+ * Peform a path join.
219
+ *
220
+ * @param {String} path
221
+ * @return {String}
222
+ * @api public
223
+ */
224
+
225
+ (exports.pathjoin = function pathjoin(){
226
+ var paths = [].slice.call(arguments).map(function(path){
227
+ return path.first.string;
228
+ });
229
+ return path.join.apply(null, paths);
230
+ }).raw = true;
231
+
177
232
  /**
178
233
  * Return the red component of the given `color`.
179
234
  *
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.27.2';
27
+ exports.version = '0.28.0';
28
28
 
29
29
  /**
30
30
  * Expose nodes.
@@ -607,7 +607,8 @@ Evaluator.prototype.visitIf = function(node){
607
607
 
608
608
  Evaluator.prototype.visitExtend = function(extend){
609
609
  var selector = extend.selector;
610
- this.currentBlock.node.extends.push(selector);
610
+ var block = this.targetBlock || this.currentBlock;
611
+ block.node.extends.push(selector);
611
612
  return nodes.null;
612
613
  };
613
614
 
@@ -46,8 +46,5 @@
46
46
  "_npmVersion": "1.1.21",
47
47
  "_nodeVersion": "v0.6.19",
48
48
  "_defaultsLoaded": true,
49
- "dist": {
50
- "shasum": "3d989f0ef82910df370ee03d97f5d546759c8b5f"
51
- },
52
49
  "_from": "cssom@0.2.x"
53
50
  }
@@ -34,8 +34,5 @@
34
34
  "_npmVersion": "1.1.21",
35
35
  "_nodeVersion": "v0.6.19",
36
36
  "_defaultsLoaded": true,
37
- "dist": {
38
- "shasum": "23256d7136c633295062196d996b0fdd21153baf"
39
- },
40
37
  "_from": "commander@0.6.1"
41
38
  }
@@ -42,8 +42,5 @@
42
42
  "_npmVersion": "1.1.21",
43
43
  "_nodeVersion": "v0.6.19",
44
44
  "_defaultsLoaded": true,
45
- "dist": {
46
- "shasum": "a83d26247f6b41ddfb6cda3f77332af2ae8e4fba"
47
- },
48
45
  "_from": "diff@1.0.2"
49
46
  }
@@ -33,8 +33,5 @@
33
33
  "_npmVersion": "1.1.21",
34
34
  "_nodeVersion": "v0.6.19",
35
35
  "_defaultsLoaded": true,
36
- "dist": {
37
- "shasum": "547f4175cbaef0dcd9a3f54d0006d634b2ec1d90"
38
- },
39
36
  "_from": "mkdirp@0.3.0"
40
37
  }
@@ -47,8 +47,5 @@
47
47
  "_npmVersion": "1.1.21",
48
48
  "_nodeVersion": "v0.6.19",
49
49
  "_defaultsLoaded": true,
50
- "dist": {
51
- "shasum": "8f10d7977d8d79f2f6ff862a81b0513ccb25686c"
52
- },
53
50
  "_from": "jade@0.26.3"
54
51
  }
@@ -44,8 +44,5 @@
44
44
  "_npmVersion": "1.1.21",
45
45
  "_nodeVersion": "v0.6.19",
46
46
  "_defaultsLoaded": true,
47
- "dist": {
48
- "shasum": "3a92b4c9a9280f31597bbb5c1f3b58632ac69b37"
49
- },
50
47
  "_from": "mocha@*"
51
48
  }
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.27.2"
3
+ , "version": "0.28.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"
@@ -1,23 +1,11 @@
1
1
 
2
- foo-bar-baz-background-color = red
3
-
4
- id = foo-bar-baz
5
- bg-color = id + '-background-color'
6
-
7
- #items_{id}
8
- .item
9
- background-color: bg-color
10
-
11
- // body
12
- // foo: n for n in 1..3
13
- //
14
- // body
15
- // val = n for n in 1..3
16
- // foo: val
17
-
18
- //
19
- // body
20
- // foo: foo bar (1)px
21
- // foo: foo bar (2 * 5)px
22
- // foo: foo (2 * 5)px bar
23
- // foo: foo (2 * 5)em bar
2
+ image(path, width = auto, height = auto)
3
+ background-image: url(path)
4
+ @media all and (-webkit-min-device-pixel-ratio: 1.5)
5
+ ext = extname(path)
6
+ path = pathjoin(dirname(path), basename(path, ext) + '@2x' + ext)
7
+ background-image: url(path)
8
+ background-size: width height
9
+
10
+ #logo
11
+ image: '/images/logo.main.png' 50px 100px
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.27.2
4
+ version: 0.28.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: