Socket
Socket
Sign inDemoInstall

nib

Package Overview
Dependencies
Maintainers
2
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nib - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

.editorconfig

25

lib/nib.js

@@ -1,2 +0,1 @@

/*!

@@ -12,7 +11,7 @@ * nib

var stylus = require('stylus')
, path = require('path')
, nodes = stylus.nodes
, utils = stylus.utils
, Canvas
var stylus = require('stylus'),
path = require('path'),
nodes = stylus.nodes,
utils = stylus.utils,
Canvas;

@@ -26,4 +25,4 @@ exports = module.exports = plugin;

var gradient = require('./nodes/gradient')
, colorImage = require('./nodes/color-image')
var gradient = require('./nodes/gradient'),
colorImage = require('./nodes/color-image');
} catch (err) {

@@ -60,8 +59,8 @@ // ignore

// gradients
style.define('create-gradient-image', gradient.create)
style.define('gradient-data-uri', gradient.dataURL)
style.define('add-color-stop', gradient.addColorStop)
style.define('create-gradient-image', gradient.create);
style.define('gradient-data-uri', gradient.dataURL);
style.define('add-color-stop', gradient.addColorStop);
// color images
style.define('create-color-image', colorImage.create)
style.define('create-color-image', colorImage.create);
style.define('color-data-uri', colorImage.dataURL);

@@ -71,3 +70,3 @@ } else {

}
}
};
}

@@ -1,2 +0,1 @@

/**

@@ -6,6 +5,6 @@ * Module dependencies.

var stylus = require('stylus')
, Canvas = require('canvas')
, nodes = stylus.nodes
, utils = stylus.utils
var stylus = require('stylus'),
Canvas = require('canvas'),
nodes = stylus.nodes,
utils = stylus.utils;

@@ -57,3 +56,3 @@ /**

this.ctx.fillRect(0, 0, 1, 1);
};
}

@@ -60,0 +59,0 @@ /**

@@ -1,2 +0,1 @@

/**

@@ -6,6 +5,6 @@ * Module dependencies.

var stylus = require('stylus')
, Canvas = require('canvas')
, nodes = stylus.nodes
, utils = stylus.utils;
var stylus = require('stylus'),
Canvas = require('canvas'),
nodes = stylus.nodes,
utils = stylus.utils;

@@ -80,5 +79,5 @@ /**

this.grad = this.ctx.createLinearGradient(
this.from[0], this.from[1]
, this.to[0], this.to[1]);
};
this.from[0], this.from[1],
this.to[0], this.to[1]);
}

@@ -93,4 +92,3 @@ /**

Gradient.prototype.toString = function(){
return 'Gradient(' + this.size + 'px '
+ this.stops.map(function(stop){
return 'Gradient(' + this.size + 'px ' + this.stops.map(function(stop){
return stop[0] + ' ' + stop[1];

@@ -108,4 +106,4 @@ }).join(', ') + ')';

Gradient.prototype.setStartPosition = function(start){
var size = this.size
, canvas = this.canvas;
var size = this.size,
canvas = this.canvas;

@@ -158,4 +156,4 @@ switch (start) {

Gradient.prototype.toDataURL = function(){
var canvas = this.canvas
, ctx = this.ctx;
var canvas = this.canvas,
ctx = this.ctx;
ctx.fillStyle = this.grad;

@@ -162,0 +160,0 @@ ctx.fillRect(0, 0, canvas.width, canvas.height);

@@ -1,6 +0,6 @@

var RE_GRADIENT_STOPS = /([\(\,]\s*)(-?(?:\d*\.)?\d+(?:%|px|em))(\s+)((hsl|rgb)a?\([^\)]+\)|#[^\)\,]+)/g
, RE_GRADIENT_VAL = /(\(\s*)(?:(-?(\d*\.)?\d+)deg|((to )?(top|bottom|left|right)( (top|bottom|left|right))?))/g
, RE_GRADIENT_TYPE = /((repeating-)?(linear|radial)-gradient\()/g
, RE_TRANSFORM = /\b(transform)\b/g
, RE_FILL_KEYWORD = /\s*\b(fill)\b\s*/g;
var RE_GRADIENT_STOPS = /([\(\,]\s*)(-?(?:\d*\.)?\d+(?:%|px|em))(\s+)((hsl|rgb)a?\([^\)]+\)|#[^\)\,]+)/g,
RE_GRADIENT_VAL = /(\(\s*)(?:(-?(\d*\.)?\d+)deg|((to )?(top|bottom|left|right)( (top|bottom|left|right))?))/g,
RE_GRADIENT_TYPE = /((repeating-)?(linear|radial)-gradient\()/g,
RE_TRANSFORM = /\b(transform)\b/g,
RE_FILL_KEYWORD = /\s*\b(fill)\b\s*/g;

@@ -14,4 +14,4 @@ var DIRECTIONS = { top: 'bottom', bottom: 'top', left: 'right', right:'left' };

function normalize(property, value, prefix){
var result = value.toString()
, args;
var result = value.toString(),
args;

@@ -18,0 +18,0 @@ /* Fixing the gradients */

{
"name": "nib",
"description": "Stylus mixins and utilities",
"version": "1.0.3",
"version": "1.0.4",
"license": "MIT",

@@ -11,3 +11,3 @@ "repository": {

"dependencies": {
"stylus": "~0.37.0"
"stylus": "0.45.x"
},

@@ -14,0 +14,0 @@ "devDependencies": {

@@ -14,4 +14,4 @@ [![Build Status](https://travis-ci.org/visionmedia/nib.png?branch=master)](https://travis-ci.org/visionmedia/nib)

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):
```bash
```bash
$ npm install canvas

@@ -51,5 +51,5 @@ ```

```
Or you may also pick and choose based on the directory structure in `./lib`, for example:
```css

@@ -59,3 +59,3 @@ @import 'nib/gradients'

```
to be continued....

@@ -70,19 +70,19 @@

You will first need to install the dependencies:
```bash
$ npm install -d
```
Run the automated test cases:
```bash
$ npm test
```
For visual testing run the test server:
```bash
$ npm run-script test-server
```
Then visit `localhost:3000` in your browser.

@@ -89,0 +89,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc