Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stylus

Package Overview
Dependencies
Maintainers
0
Versions
183
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stylus - npm Package Compare versions

Comparing version 0.0.2 to 0.1.0

bin/._stylus

6

._History.md

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�]��!�!com.macromates.caret{
column = 5;
line = 1;
Mac OS X  2��ATTR�X��"�"com.macromates.caret{
column = 0;
line = 11;
}

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�c��"�"com.macromates.caret{
Mac OS X  2��ATTR�X��"�"com.macromates.caret{
column = 21;
line = 2;
}

@@ -1,4 +0,1 @@

Mac OS X  2��ATTR�e��#�#com.macromates.caret{
column = 46;
line = 69;
}
Mac OS X  2��ATTR�X�� � com.macromates.caretx���R������<[k0?'3/«��
0.1.0 / 2011-02-01
==================
* Added `opposite-position(positions)` built-in function
* Added `image-lookup(path)` built-in function
* Added `-o, --out <dir>` support to stylus(1)
* Added `stylus [file|dir ...]` support
* Added; defaulting paths to `[CWD]` for stylus(1)
* Changed; `unquote()` using `Literal` node
* Changed; utilizing `Literal` in place of some `Ident`s
0.0.2 / 2011-01-31

@@ -3,0 +14,0 @@ ==================

@@ -1,4 +0,4 @@

Mac OS X  2��ATTR�p��#�#com.macromates.caret{
Mac OS X  2��ATTR�X%��#�#com.macromates.caret{
column = 24;
line = 25;
}

@@ -13,3 +13,4 @@

var nodes = require('../nodes')
, utils = require('../utils');
, utils = require('../utils')
, Image = require('./image');

@@ -337,3 +338,3 @@ /**

* @param {String|Ident} val
* @return {Ident}
* @return {Literal}
* @api public

@@ -344,3 +345,3 @@ */

utils.assertString(val, 'string');
return val.string;
return new nodes.Literal(val.string);
};

@@ -633,3 +634,3 @@

return new nodes.Unit(0);
}).tuple = true;
}).raw = true;

@@ -646,3 +647,3 @@ /**

return nodes.null;
}).tuple = true;
}).raw = true;

@@ -683,2 +684,67 @@ /**

return nodes.null;
};
/**
* Return the opposites of the given `positions`.
*
* Examples:
*
* opposite-position(top left)
* // => bottom right
*
* @param {Expression} positions
* @return {Expression}
* @api public
*/
(exports['opposite-position'] = function(positions){
var expr = new nodes.Expression;
positions.nodes.forEach(function(pos, i){
utils.assertString(pos, 'position ' + i);
pos = (function(){ switch (pos.string) {
case 'top': return 'bottom';
case 'bottom': return 'top';
case 'left': return 'right';
case 'right': return 'left';
default: throw new Error('invalid position ' + pos);
}})();
expr.push(new nodes.Literal(pos));
});
return expr;
}).raw = true;
/**
* Return the width and height of the given `img` path.
*
* Examples:
*
* image-size('foo.png')
* // => 200px 100px
*
* image-size('foo.png')[0]
* // => 200px
*
* image-size('foo.png')[1]
* // => 100px
*
* @param {String} img
* @return {Expression}
* @api public
*/
exports['image-size'] = function(img) {
utils.assertType(img, nodes.String, 'img');
var img = new Image(this, img.string);
// Read size
img.open();
var size = img.size();
img.close();
// Return (w h)
var expr = new nodes.Expression;
expr.push(new nodes.Unit(size[0], 'px'));
expr.push(new nodes.Unit(size[1], 'px'));
return expr;
};

@@ -52,3 +52,3 @@

, mime = mimes[ext]
, literal = new nodes.Ident('url("' + url.href + '")');
, literal = new nodes.Literal('url("' + url.href + '")');

@@ -55,0 +55,0 @@ // Not supported

@@ -228,3 +228,3 @@

this.skip(captures);
return new Token('ident', new nodes.Ident(c));
return new Token('ident', new nodes.Literal(c));
}

@@ -267,3 +267,3 @@ },

this.skip(captures);
return new Token('ident', new nodes.Ident('!important'));
return new Token('ident', new nodes.Literal('!important'));
}

@@ -270,0 +270,0 @@ },

@@ -81,1 +81,18 @@

};
/**
* Coerce `other` to an ident.
*
* @param {Node} other
* @return {String}
* @api public
*/
Ident.prototype.coerce = function(other){
if (other instanceof nodes.Literal ||
other instanceof Ident) {
return other;
} else {
return Node.prototype.coerce.call(this, other);
}
};

@@ -34,3 +34,3 @@

/**
* Return @<name>.
* Return hash.
*

@@ -41,4 +41,32 @@ * @return {String}

Literal.prototype.__defineGetter__('hash', function(){
return this.val;
});
/**
* Return literal value.
*
* @return {String}
* @api public
*/
Literal.prototype.toString = function(){
return 'css "' + this.val + '"';
return this.val;
};
/**
* Coerce `other` to a literal.
*
* @param {Node} other
* @return {String}
* @api public
*/
Literal.prototype.coerce = function(other){
if (other instanceof Literal ||
other instanceof nodes.Ident) {
return other;
} else {
return Node.prototype.coerce.call(this, other);
}
};

@@ -394,3 +394,3 @@

var str = this.expect('ident').val.name;
selector = new nodes.Ident(':' + str);
selector = new nodes.Literal(':' + str);
}

@@ -973,3 +973,3 @@ var page = new nodes.Page(selector);

expr.push(node);
expr.push(new nodes.Ident('/'));
expr.push(new nodes.Literal('/'));
return expr;

@@ -976,0 +976,0 @@ } else {

@@ -74,3 +74,3 @@

* Define function with the given `name`. Optionally
* the function may accept tuples, by setting `tuple`
* the function may accept full expressions, by setting `raw`
* to `true`.

@@ -84,5 +84,5 @@ *

Renderer.prototype.define = function(name, fn, tuple){
Renderer.prototype.define = function(name, fn, raw){
this.options.functions[name] = fn;
fn.tuple = tuple;
fn.raw = raw;
return this;

@@ -89,0 +89,0 @@ };

@@ -26,3 +26,3 @@

exports.version = '0.0.2';
exports.version = '0.1.0';

@@ -123,5 +123,5 @@ /**

/**
* Expose functions.
* Expose optional functions.
*/
exports.url = require('./functions/url');
exports.url = require('./functions/url');

@@ -104,4 +104,4 @@

if (node instanceof nodes.Ident) return;
var actual = node.constructor.name;
msg = msg || 'expected String or Ident, but got ' + actual + ':' + node;
var actual = node.constructor.name
, msg = 'expected String or Ident, but got ' + actual + ':' + node;
throw new Error('TypeError: ' + msg);

@@ -122,4 +122,4 @@ };

if (node instanceof nodes.HSLA) return;
var actual = node.constructor.name;
var msg = 'expected Color or HSLA, but got ' + actual + ':' + node;
var actual = node.constructor.name
, msg = 'expected Color or HSLA, but got ' + actual + ':' + node;
throw new Error('TypeError: ' + msg);

@@ -126,0 +126,0 @@ };

@@ -571,4 +571,5 @@

// BIFs. Functions may specify that
// they wish to accept tuples via .tuple
if (fn.tuple) {
// they wish to accept full expressions
// via .raw
if (fn.raw) {
args = args.nodes;

@@ -575,0 +576,0 @@ } else {

{ "name": "stylus"
, "description": "Robust, expressive language which compiles to CSS"
, "version": "0.0.2"
, "version": "0.1.0"
, "author": "TJ Holowaychuk <tj@vision-media.ca>"

@@ -5,0 +5,0 @@ , "keywords": ["css", "parser", "style", "stylesheets", "jade", "language"]

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