stylus-source 0.19.8 → 0.20.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.19.8
1
+ 0.20.0
data/vendor/History.md CHANGED
@@ -1,4 +1,10 @@
1
1
 
2
+ 0.20.0 / 2011-12-11
3
+ ==================
4
+
5
+ * Added `--include-css` to literally include imported CSS. Closes #448
6
+ * Fixed coercion bug with expression. Closes #480
7
+
2
8
  0.19.8 / 2011-12-01
3
9
  ==================
4
10
 
data/vendor/bin/stylus CHANGED
@@ -88,6 +88,12 @@ var plugins = [];
88
88
 
89
89
  var urlFunction = false;
90
90
 
91
+ /**
92
+ * Include css on import.
93
+ */
94
+
95
+ var includeCSS = false;
96
+
91
97
  /**
92
98
  * Usage docs.
93
99
  */
@@ -119,6 +125,7 @@ var usage = [
119
125
  , ' can be used by the FireStylus Firebug plugin'
120
126
  , ' -l, --line-numbers Emits comments in the generated css'
121
127
  , ' indicating the corresponding stylus line'
128
+ , ' --include-css Include regular css on @import'
122
129
  , ' -V, --version Display the version of stylus'
123
130
  , ' -h, --help Display help information'
124
131
  , ''
@@ -179,6 +186,9 @@ while (args.length) {
179
186
  if (!name) throw new Error('help <property> required');
180
187
  help(name);
181
188
  break;
189
+ case '--include-css':
190
+ includeCSS = true;
191
+ break;
182
192
  case '-i':
183
193
  case '--repl':
184
194
  case '--interactive':
@@ -472,6 +482,7 @@ function compileStdio() {
472
482
  process.stdin.on('end', function(){
473
483
  // Compile to css
474
484
  var style = stylus(str, options);
485
+ if (includeCSS) style.set('include css', true);
475
486
  usePlugins(style);
476
487
  style.render(function(err, css){
477
488
  if (err) throw err;
@@ -509,6 +520,7 @@ function compileFile(file) {
509
520
  options.filename = file;
510
521
  options._imports = [];
511
522
  var style = stylus(str, options);
523
+ if (includeCSS) style.set('include css', true);
512
524
  usePlugins(style);
513
525
  style.render(function(err, css){
514
526
  watchImports(file, options._imports);
@@ -83,7 +83,7 @@ Unit.prototype.clone = function(){
83
83
  */
84
84
 
85
85
  Unit.prototype.operate = function(op, right){
86
- var type = this.type || right.type;
86
+ var type = this.type || right.first.type;
87
87
 
88
88
  // swap color
89
89
  if ('rgba' == right.nodeName || 'hsla' == right.nodeName) {
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.19.8';
27
+ exports.version = '0.20.0';
28
28
 
29
29
  /**
30
30
  * Expose nodes.
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.19.8"
3
+ , "version": "0.20.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,9 @@
1
+ body {
2
+ foo: 25px;
3
+ foo: 25px;
4
+ }
5
+ body {
6
+ foo: 10em;
7
+ foo: 10em;
8
+ foo: 10px;
9
+ }
@@ -0,0 +1,12 @@
1
+ n = 5px
2
+
3
+ body
4
+ foo: n * 5
5
+ foo: 5 * n
6
+
7
+ n = 5em 5px 5
8
+
9
+ body
10
+ foo: n * 2
11
+ foo: 2 * n
12
+ foo: 2px * n
@@ -0,0 +1,15 @@
1
+
2
+ /**
3
+ * Module dependencies.
4
+ */
5
+
6
+ var stylus = require('../')
7
+ , fs = require('fs')
8
+ , str = fs.readFileSync('testing/test.styl', 'utf8');
9
+
10
+ stylus(str)
11
+ .set('filename', 'testing/test.styl')
12
+ .render(function(err, css){
13
+ if (err) throw err;
14
+ console.log(css);
15
+ });
@@ -1,14 +1,9 @@
1
1
 
2
- only = webkit
2
+ #example
3
+ width: 400px
3
4
 
4
5
  body
5
- foo: webkit in only
6
- foo: (webkit in only)
7
- foo: true or false
8
- foo: (webkit in only) or false
9
- foo: (foo bar baz) or false
10
- foo: (foo (bar ((baz)))) or false
11
- foo: (foo) or false
12
- foo: ((foo)) or false
13
- foo: (0) or false
14
- foo: (1) or false
6
+ width: 200px
7
+ #prompt
8
+ position: absolute
9
+ width: @width
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.19.8
4
+ version: 0.20.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: 2011-12-01 00:00:00.000000000 Z
12
+ date: 2011-12-12 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.
@@ -567,6 +567,8 @@ files:
567
567
  - vendor/test/cases/regression.472.styl
568
568
  - vendor/test/cases/regression.475.css
569
569
  - vendor/test/cases/regression.475.styl
570
+ - vendor/test/cases/regression.480.css
571
+ - vendor/test/cases/regression.480.styl
570
572
  - vendor/test/cases/reset.css
571
573
  - vendor/test/cases/reset.styl
572
574
  - vendor/test/cases/rule.charset.css
@@ -609,15 +611,8 @@ files:
609
611
  - vendor/test/images/squirrel.jpeg
610
612
  - vendor/test/images/tux.png
611
613
  - vendor/test/run.js
612
- - vendor/testing/foo.css
613
- - vendor/testing/index.html
614
- - vendor/testing/stylus.js
615
- - vendor/testing/test-js.js
616
- - vendor/testing/test.css
617
- - vendor/testing/test.js
614
+ - vendor/testing/index.js
618
615
  - vendor/testing/test.styl
619
- - vendor/testing/utils.styl
620
- - vendor/testing/vendor.styl
621
616
  homepage: https://github.com/railsjedi/ruby-stylus-source
622
617
  licenses: []
623
618
  post_install_message:
@@ -1,4 +0,0 @@
1
-
2
- foo {
3
- bar: 'baz';
4
- }
@@ -1,56 +0,0 @@
1
- <html>
2
- <head>
3
- <!--<link rel="stylesheet/stylus"></link>-->
4
- <style type="text/stylus">
5
- fg = white
6
- body {
7
- color: fg;
8
- background: black;
9
- }
10
- </style>
11
- <script src="../stylus.js"></script>
12
- <script>
13
-
14
- function createStylesheet(css) {
15
- var el = document.createElement('style');
16
- el.type = 'text/css';
17
- el.media = 'screen';
18
- el.id = 'todo';
19
- el.textContent = css;
20
- document.getElementsByTagName('head')[0].appendChild(el);
21
- }
22
-
23
- onload = function(){
24
- var styles = document.getElementsByTagName('style')
25
- , indent
26
- , styl;
27
-
28
- // TODO: link tags like https://github.com/cloudhead/less.js/blob/master/dist/less-1.1.4.js#L2463
29
- // TODO: strip indentation
30
- for (var i = 0, len = styles.length; i < len; ++i) {
31
- if ('text/stylus' == styles[i].type) {
32
- styl = styles[i].textContent;
33
- stylus(styl.trim())
34
- .render(function(err, css){
35
- if (err) throw err;
36
- createStylesheet(css);
37
- });
38
- }
39
- }
40
- };
41
- </script>
42
- </head>
43
- <body>
44
- <div id="dialog">
45
- <h1>Dialog</h1>
46
- <p>Some random dialog</p>
47
- </div>
48
-
49
- <div class="tip username-tip">Please enter your username</div>
50
- <div class="tip password-tip">Please enter your password</div>
51
- <div id="content">
52
- <p><input type="text" class="username" placeholder="Username:"></p>
53
- <p><input type="text" class="password" placeholder="Password:"></p>
54
- </div>
55
- </body>
56
- </html>
@@ -1,146 +0,0 @@
1
-
2
- var stylus = (function(){
3
- function center(selector) {
4
- jQuery(function(){
5
- var el = jQuery(selector);
6
-
7
- function center() {
8
- var w = el.outerWidth()
9
- , h = el.outerHeight();
10
-
11
- el.css({
12
- top: window.innerHeight / 2 - h / 2
13
- , left: window.innerWidth / 2 - w / 2
14
- });
15
- }
16
-
17
- jQuery(window).resize(center);
18
- center();
19
- });
20
- }
21
-
22
- function tip(selector, pos, color, width, height) {
23
- width = parseInt(width, 10);
24
- height = parseInt(height, 10);
25
- jQuery(function(){
26
- var el = jQuery(selector)
27
- , tip = $('<canvas>')
28
- , canvas = tip.get(0)
29
- , ctx = canvas.getContext('2d')
30
- , w = el.outerWidth()
31
- , h = el.outerHeight()
32
- , off = el.offset()
33
- , top
34
- , left;
35
-
36
- el.append(canvas);
37
- canvas.width = width;
38
- canvas.height = height;
39
-
40
- function calc() {
41
- ctx.beginPath();
42
- switch (pos) {
43
- case 'top':
44
- top = -height;
45
- left = w / 2 - width / 2;
46
- ctx.lineTo(width / 2, 0);
47
- ctx.lineTo(width, height);
48
- ctx.lineTo(0, height);
49
- break;
50
- case 'right':
51
- top = h / 2 - height / 2;
52
- left = w;
53
- ctx.lineTo(0, 0);
54
- ctx.lineTo(0, height);
55
- ctx.lineTo(width, height / 2);
56
- break;
57
- case 'bottom':
58
- top = h;
59
- left = w / 2 - width / 2;
60
- ctx.lineTo(width / 2, height);
61
- ctx.lineTo(0, 0);
62
- ctx.lineTo(width, 0);
63
- break;
64
- case 'left':
65
- top = h / 2 - height / 2;
66
- left = -width;
67
- ctx.lineTo(0, height / 2);
68
- ctx.lineTo(width, 0);
69
- ctx.lineTo(width, height);
70
- break;
71
- }
72
- }
73
-
74
- calc();
75
-
76
- tip.css({ top: top, left: left });
77
- ctx.fillStyle = color;
78
- ctx.fill();
79
- });
80
- }
81
-
82
- function snapTo(selector, target, pos, pad) {
83
- pad = parseInt(pad, 10);
84
- jQuery(function(){
85
- var el = jQuery(selector);
86
- target = jQuery(target);
87
-
88
- function snap() {
89
- var w = el.outerWidth()
90
- , h = el.outerHeight()
91
- , tw = target.outerWidth()
92
- , th = target.outerHeight()
93
- , off = target.offset()
94
- , ww = window.innerWidth
95
- , wh = window.innerHeight
96
- , auto = 'auto' == pos
97
- , top
98
- , left;
99
-
100
- if (auto) pos = 'right';
101
-
102
- function calc() {
103
- switch (pos) {
104
- case 'top':
105
- top = off.top - h - pad;
106
- left = off.left - w / 2 + tw / 2;
107
- break;
108
- case 'left':
109
- top = off.top - h / 2 + th / 2;
110
- left = off.left - w - pad;
111
- break;
112
- case 'bottom':
113
- top = off.top + th + pad;
114
- left = off.left - w / 2 + tw / 2;
115
- break;
116
- case 'right':
117
- top = off.top - h / 2 + th / 2;
118
- left = off.left + tw + pad;
119
- break;
120
- }
121
- }
122
-
123
- calc();
124
-
125
- if (auto) {
126
- // right
127
- if (left + w > ww) {
128
- pos = 'left';
129
- calc();
130
- }
131
- }
132
-
133
- el.css({ top: top, left: left });
134
- }
135
-
136
- jQuery(window).resize(snap);
137
- snap();
138
- });
139
- }
140
-
141
- return {
142
- snapTo: snapTo
143
- , tip: tip
144
- , center: center
145
- }
146
- })()
@@ -1,23 +0,0 @@
1
-
2
- /**
3
- * Module dependencies.
4
- */
5
-
6
- var connect = require('connect')
7
- , stylus = require('../');
8
-
9
- // Setup server
10
- // $ curl http://localhost:3000/functions.css
11
-
12
- var server = connect.createServer(
13
- stylus.middleware({
14
- src: __dirname
15
- , dest: __dirname
16
- , compress: true
17
- , debug: true
18
- }),
19
- connect.static(__dirname)
20
- );
21
-
22
- server.listen(3000);
23
- console.log('server listening on port 3000');
@@ -1,4 +0,0 @@
1
-
2
- body {
3
- foo: bar;
4
- }
@@ -1,28 +0,0 @@
1
-
2
- /**
3
- * Module dependencies.
4
- */
5
-
6
- var stylus = require('../')
7
- , utils = stylus.utils
8
- , nodes = stylus.nodes
9
- , str = require('fs').readFileSync(__dirname + '/test.styl', 'utf8')
10
- , fs = require('fs');
11
-
12
- stylus(str)
13
- //.import(__dirname + '/mixins/vendor')
14
- .set('filename', __dirname + '/test.styl')
15
- // .set('compress', true)
16
- // .set('firebug', true)
17
- // .set('linenos', true)
18
- // .set('warn', true)
19
- .set('include css', true)
20
- .define('string', 'some string')
21
- .define('number', 15.5)
22
- .define('some-bool', true)
23
- .define('list', ['Helvetica Neue', 'Helvetica', 'sans-serif'])
24
- .render(function(err, css, js){
25
- if (err) throw err;
26
- process.stdout.write(css);
27
- });
28
-
@@ -1,4 +0,0 @@
1
-
2
- /*!
3
- * foo
4
- */
@@ -1,3 +0,0 @@
1
-
2
- body
3
- foo: 'bar'