Skip to content

Commit 333386b

Browse files
committed
update to match editorconfig & JSHint (mostly)
1 parent 83342d5 commit 333386b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+90
-122
lines changed

Readme.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ $ npm install nib
1111
```
1212

1313
If the image generation features of Nib are desired, such as generating the linear gradient images, install [node-canvas](http://github.com/learnboost/node-canvas):
14-
15-
```bash
14+
15+
```bash
1616
$ npm install canvas
1717
```
1818

@@ -47,14 +47,14 @@ server.use(stylus.middleware({
4747
```css
4848
@import 'nib'
4949
```
50-
50+
5151
Or you may also pick and choose based on the directory structure in `./lib`, for example:
52-
52+
5353
```css
5454
@import 'nib/gradients'
5555
@import 'nib/overflow'
5656
```
57-
57+
5858
to be continued....
5959

6060
## More Information
@@ -64,23 +64,23 @@ to be continued....
6464
## Testing
6565

6666
You will first need to install the dependencies:
67-
67+
6868
```bash
6969
$ npm install -d
7070
```
71-
71+
7272
Run the automated test cases:
73-
73+
7474
```bash
7575
$ npm test
7676
```
77-
77+
7878
For visual testing run the test server:
79-
79+
8080
```bash
8181
$ npm run-script test-server
8282
```
83-
83+
8484
Then visit `localhost:3000` in your browser.
8585

8686
## Contributors

iconic/demo.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</style>
1010
</head>
1111
<body>
12-
<ul>
12+
<ul>
1313
<li><a name='home' class='iconic home'></a> Home</li>
1414
<li><a name='at' class='iconic at'></a> At Symbol</li>
1515
<li><a name='quote' class='iconic quote'></a> Quote</li>
@@ -92,4 +92,4 @@
9292
<li><a name='beaker-alt' class='iconic beaker-alt'></a> Beaker (alternate)</li>
9393
</ul>
9494
</body>
95-
</html>
95+
</html>

lib/nib.js

+12-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*!
32
* nib
43
* Copyright (c) 2010 TJ Holowaychuk <[email protected]>
@@ -9,11 +8,11 @@
98
* Module dependencies.
109
*/
1110

12-
var stylus = require('stylus')
13-
, path = require('path')
14-
, nodes = stylus.nodes
15-
, utils = stylus.utils
16-
, Canvas
11+
var stylus = require('stylus'),
12+
path = require('path'),
13+
nodes = stylus.nodes,
14+
utils = stylus.utils,
15+
Canvas;
1716

1817
exports = module.exports = plugin;
1918

@@ -22,8 +21,8 @@ exports = module.exports = plugin;
2221
try {
2322
Canvas = require('canvas');
2423

25-
var gradient = require('./nodes/gradient')
26-
, colorImage = require('./nodes/color-image')
24+
var gradient = require('./nodes/gradient'),
25+
colorImage = require('./nodes/color-image');
2726
} catch (err) {
2827
// ignore
2928
}
@@ -55,15 +54,15 @@ function plugin() {
5554
style.define('has-canvas', nodes.true);
5655

5756
// gradients
58-
style.define('create-gradient-image', gradient.create)
59-
style.define('gradient-data-uri', gradient.dataURL)
60-
style.define('add-color-stop', gradient.addColorStop)
57+
style.define('create-gradient-image', gradient.create);
58+
style.define('gradient-data-uri', gradient.dataURL);
59+
style.define('add-color-stop', gradient.addColorStop);
6160

6261
// color images
63-
style.define('create-color-image', colorImage.create)
62+
style.define('create-color-image', colorImage.create);
6463
style.define('color-data-uri', colorImage.dataURL);
6564
} else {
6665
style.define('has-canvas', nodes.false);
6766
}
68-
}
67+
};
6968
}

lib/nib/border.styl

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* border: <color>
43
* border: ...

lib/nib/clearfix.styl

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* The Magnificent Micro Clearfix
43
*

lib/nib/color-image.styl

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
color-image(color)
32
error('node-canvas is required for color-image()') unless has-canvas
43
colorImage = create-color-image(color)

lib/nib/gradients.styl

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
@import 'config'
32

43
/*

lib/nib/iconic.styl

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
iconic-stroke(path)
32
@font-face
43
font-family: 'IconicStroke'

lib/nib/image.styl

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* Define background-image as `path` with optional width and height, adding an
43
* @2x variant.

lib/nib/positions.styl

+15-15
Original file line numberDiff line numberDiff line change
@@ -10,56 +10,56 @@
1010

1111
/*
1212
* Position utility.
13-
*
13+
*
1414
* Synopsis:
15-
*
15+
*
1616
* fixed: <pos> [n] <pos> [n]
17-
*
17+
*
1818
* Examples:
19-
*
19+
*
2020
* fixed: top left
2121
* fixed: top 5px left
2222
* fixed: top left 5px
2323
* fixed: top 5px left 5px
24-
*
24+
*
2525
*/
2626

2727
fixed()
2828
-pos('fixed', arguments)
2929

3030
/*
3131
* Position utility.
32-
*
32+
*
3333
* Synopsis:
34-
*
34+
*
3535
* absolute: <pos> [n] <pos> [n]
36-
*
36+
*
3737
* Examples:
38-
*
38+
*
3939
* absolute: top left
4040
* absolute: top 5px left
4141
* absolute: top left 5px
4242
* absolute: top 5px left 5px
43-
*
43+
*
4444
*/
4545

4646
absolute()
4747
-pos('absolute', arguments)
4848

4949
/*
5050
* Position utility.
51-
*
51+
*
5252
* Synopsis:
53-
*
53+
*
5454
* relative: <pos> [n] <pos> [n]
55-
*
55+
*
5656
* Examples:
57-
*
57+
*
5858
* relative: top left
5959
* relative: top 5px left
6060
* relative: top left 5px
6161
* relative: top 5px left 5px
62-
*
62+
*
6363
*/
6464

6565
relative()

lib/nib/reset.styl

-1
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,3 @@ reset-html5()
7676
*zoom 1
7777
audio:not([controls]),[hidden]
7878
display none
79-

lib/nib/size.styl

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
/*
22
* Size utility.
3-
*
3+
*
44
* Synopsis:
5-
*
5+
*
66
* size: <width> <height> | <width & height>
7-
*
7+
*
88
* Examples:
9-
*
9+
*
1010
* size: 100% 30px
1111
* yields:
1212
* width: 100%
1313
* height: 30px
14-
*
14+
*
1515
* size: 5px
1616
* yields:
1717
* width: 5px
1818
* height: 5px
19-
*
19+
*
2020
*/
2121

2222
size()

lib/nib/text/aliases.styl

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* Alias of "nowrap".
43
*/
@@ -10,4 +9,4 @@ no-wrap = unquote('nowrap')
109
*/
1110

1211
whitespace()
13-
white-space: arguments
12+
white-space: arguments

lib/nib/text/ellipsis.styl

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*
32
* Ellipsis with wrapping disabled by default.
43
*/
@@ -7,4 +6,4 @@ ellipsis(no-wrap = true)
76
if no-wrap
87
white-space: nowrap
98
overflow: hidden
10-
text-overflow: ellipsis
9+
text-overflow: ellipsis

lib/nib/text/hide-text.styl

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
hide-text()
66
text-indent: 101%
77
white-space: nowrap
8-
overflow: hidden
8+
overflow: hidden

lib/nodes/color-image.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
21
/**
32
* Module dependencies.
43
*/
54

6-
var stylus = require('stylus')
7-
, Canvas = require('canvas')
8-
, nodes = stylus.nodes
9-
, utils = stylus.utils
5+
var stylus = require('stylus'),
6+
Canvas = require('canvas'),
7+
nodes = stylus.nodes,
8+
utils = stylus.utils;
109

1110
/**
1211
* Expose `ColorImage`.
@@ -53,7 +52,7 @@ function ColorImage(color) {
5352
this.ctx = this.canvas.getContext('2d');
5453
this.ctx.fillStyle = color.toString();
5554
this.ctx.fillRect(0, 0, 1, 1);
56-
};
55+
}
5756

5857
/**
5958
* Inherit from `nodes.Node.prototype`.

lib/nodes/gradient.js

+12-14
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
21
/**
32
* Module dependencies.
43
*/
54

6-
var stylus = require('stylus')
7-
, Canvas = require('canvas')
8-
, nodes = stylus.nodes
9-
, utils = stylus.utils;
5+
var stylus = require('stylus'),
6+
Canvas = require('canvas'),
7+
nodes = stylus.nodes,
8+
utils = stylus.utils;
109

1110
/**
1211
* Expose `Gradient`.
@@ -76,9 +75,9 @@ function Gradient(size, start) {
7675
this.setStartPosition(start);
7776
this.ctx = this.canvas.getContext('2d');
7877
this.grad = this.ctx.createLinearGradient(
79-
this.from[0], this.from[1]
80-
, this.to[0], this.to[1]);
81-
};
78+
this.from[0], this.from[1],
79+
this.to[0], this.to[1]);
80+
}
8281

8382
/**
8483
* Inspect the gradient.
@@ -88,8 +87,7 @@ function Gradient(size, start) {
8887
*/
8988

9089
Gradient.prototype.toString = function(){
91-
return 'Gradient(' + this.size + 'px '
92-
+ this.stops.map(function(stop){
90+
return 'Gradient(' + this.size + 'px ' + this.stops.map(function(stop){
9391
return stop[0] + ' ' + stop[1];
9492
}).join(', ') + ')';
9593
};
@@ -102,8 +100,8 @@ Gradient.prototype.toString = function(){
102100
*/
103101

104102
Gradient.prototype.setStartPosition = function(start){
105-
var size = this.size
106-
, canvas = this.canvas;
103+
var size = this.size,
104+
canvas = this.canvas;
107105

108106
switch (start) {
109107
case 'top':
@@ -151,8 +149,8 @@ Gradient.prototype.addColorStop = function(pos, color){
151149
*/
152150

153151
Gradient.prototype.toDataURL = function(){
154-
var canvas = this.canvas
155-
, ctx = this.ctx;
152+
var canvas = this.canvas,
153+
ctx = this.ctx;
156154
ctx.fillStyle = this.grad;
157155
ctx.fillRect(0, 0, canvas.width, canvas.height);
158156
return canvas.toDataURL();

0 commit comments

Comments
 (0)