Comparing version 0.47.1 to 0.47.2
@@ -265,2 +265,3 @@ | ||
exports.red = function red(color, value){ | ||
color = color.rgba; | ||
if (value) { | ||
@@ -296,2 +297,3 @@ return exports.rgba( | ||
exports.green = function green(color, value){ | ||
color = color.rgba; | ||
if (value) { | ||
@@ -327,2 +329,3 @@ return exports.rgba( | ||
exports.blue = function blue(color, value){ | ||
color = color.rgba; | ||
if (value) { | ||
@@ -361,2 +364,3 @@ return exports.rgba( | ||
exports.alpha = function alpha(color, value){ | ||
color = color.rgba; | ||
if (value) { | ||
@@ -580,4 +584,6 @@ return exports.rgba( | ||
utils.assertColor(top); | ||
top = top.rgba; | ||
bottom = bottom || new nodes.RGBA(255, 255, 255, 1); | ||
utils.assertColor(bottom); | ||
bottom = bottom.rgba; | ||
@@ -613,2 +619,3 @@ return new nodes.RGBA( | ||
utils.assertColor(color); | ||
color = color.rgba; | ||
function processChannel(channel) { | ||
@@ -649,4 +656,6 @@ channel = channel / 255; | ||
utils.assertColor(top); | ||
top = top.rgba; | ||
bottom = bottom || new nodes.RGBA(255, 255, 255, 1); | ||
utils.assertColor(bottom); | ||
bottom = bottom.rgba; | ||
function contrast(top, bottom) { | ||
@@ -718,2 +727,3 @@ if (1 > top.a) { | ||
utils.assertColor(top); | ||
top = top.rgba; | ||
// Handle default arguments | ||
@@ -726,2 +736,3 @@ bottom = bottom || new nodes.RGBA(255, 255, 255, 1); | ||
utils.assertColor(bottom); | ||
bottom = bottom.rgba; | ||
var bestAlpha = ['r', 'g', 'b'].map(function(channel){ | ||
@@ -728,0 +739,0 @@ return (top[channel] - bottom[channel]) / ((0 < (top[channel] - bottom[channel]) ? 255 : 0) - bottom[channel]); |
@@ -63,2 +63,14 @@ | ||
// HACK! | ||
function comment(str, val, offset, s) { | ||
var commentIdx = s.lastIndexOf('//', offset) | ||
, inComment = s.lastIndexOf('/*', offset) > s.lastIndexOf('*/', offset) | ||
|| (~commentIdx && commentIdx > s.lastIndexOf('\n', offset) | ||
&& commentIdx > s.lastIndexOf("'", offset) | ||
&& commentIdx > s.lastIndexOf('"', offset)); | ||
return inComment | ||
? str | ||
: val + '\u0085'; | ||
}; | ||
// Remove UTF-8 BOM. | ||
@@ -69,4 +81,6 @@ if ('\uFEFF' == str.charAt(0)) str = str.slice(1); | ||
.replace(/\s+$/, '\n') | ||
.replace(/\\ *\n/g, ' ') | ||
.replace(/\r\n?/g, '\n'); | ||
.replace(/\\ *\n/g, '\u0085') | ||
.replace(/\r\n?/g, '\n') | ||
.replace(/([,(]|:(?!\/\/[^ ])) *(?:\/\/[^\n]*)?\n\s*/g, comment) | ||
.replace(/\s*\n[ \t]*([,)])/g, comment); | ||
}; | ||
@@ -196,2 +210,3 @@ | ||
|| this.op() | ||
|| this.eol() | ||
|| this.space() | ||
@@ -261,2 +276,14 @@ || this.selector(); | ||
}, | ||
/** | ||
* '\u0085' | ||
*/ | ||
eol: function() { | ||
if ('\u0085' == this.str[0]) { | ||
++this.lineno; | ||
this.skip(1); | ||
return this.advance(); | ||
} | ||
}, | ||
@@ -587,3 +614,3 @@ /** | ||
}, | ||
/** | ||
@@ -590,0 +617,0 @@ * '\n' ' '+ |
@@ -115,4 +115,5 @@ /*! | ||
// check for dest-path overlap | ||
var overlap = compare((typeof dest == 'function' ? dest(path) : dest), path); | ||
path = path.slice(overlap.length); | ||
var overlap = compare((typeof dest == 'function' ? dest(path) : dest), path).length; | ||
if (sep == path.charAt(0)) overlap++; | ||
path = path.slice(overlap); | ||
} | ||
@@ -119,0 +120,0 @@ |
@@ -89,4 +89,3 @@ | ||
function hasProperties(block) { | ||
for (var i = 0, len = block.nodes.length; i < len; i++) { | ||
var node = block.nodes[i]; | ||
return block.nodes.some(function(node) { | ||
switch (node.nodeName) { | ||
@@ -102,3 +101,3 @@ case 'property': | ||
} | ||
} | ||
}); | ||
} |
@@ -164,3 +164,2 @@ /*! | ||
this.css = 0; | ||
this.indent = false; | ||
this.state.pop = function(){ | ||
@@ -814,3 +813,3 @@ self.prevState = [].pop.call(this); | ||
delim = 'outdent'; | ||
this.accept('indent'); | ||
this.expect('indent'); | ||
} | ||
@@ -1065,3 +1064,2 @@ | ||
do { | ||
this.accept('indent'); | ||
query.push(this.queryExpr()); | ||
@@ -1552,3 +1550,2 @@ } while (this.accept('&&')); | ||
this.expect(')'); | ||
if (this.indent && this.accept('outdent')) this.indent = false; | ||
this.state.pop(); | ||
@@ -1570,3 +1567,2 @@ return new nodes.Call('url', args); | ||
this.expect(')'); | ||
if (this.indent && this.accept('outdent')) this.indent = false; | ||
this.parens--; | ||
@@ -1641,4 +1637,2 @@ this.state.pop(); | ||
do { | ||
this.accept('newline'); | ||
if (this.accept('indent')) this.indent = true; | ||
// keyword | ||
@@ -1654,3 +1648,2 @@ if ('ident' == this.peek().type && ':' == this.lookahead(2).type) { | ||
} while (this.accept(',')); | ||
if (this.accept('outdent')) this.indent = false; | ||
@@ -1665,15 +1658,5 @@ return args; | ||
list: function() { | ||
var node | ||
, indent | ||
, prev; | ||
var node = this.expression(); | ||
if (this.inProperty) { | ||
indent = this.accept('indent'); | ||
} | ||
node = this.expression(); | ||
while (this.accept(',')) { | ||
prev = this.lexer.prev; | ||
if (',' == prev.type) { | ||
indent = this.accept('newline') || this.accept('indent'); | ||
} | ||
if (node.isList) { | ||
@@ -1687,3 +1670,2 @@ list.push(this.expression()); | ||
} | ||
if (indent) this.accept('outdent'); | ||
} | ||
@@ -1690,0 +1672,0 @@ return node; |
@@ -256,9 +256,7 @@ | ||
medias.forEach(function(node){ | ||
if (node.bubbled) { | ||
if (!media.block.parent.node) { | ||
node.group.block = node.block.nodes[0].block; | ||
node.block.nodes[0] = node.group; | ||
} | ||
media.block.parent.push(node); | ||
if (node.bubbled && !media.block.parent.node) { | ||
node.group.block = node.block.nodes[0].block; | ||
node.block.nodes[0] = node.group; | ||
} | ||
media.block.parent.push(node); | ||
block.push(node); | ||
@@ -265,0 +263,0 @@ }); |
{ | ||
"name": "stylus", | ||
"description": "Robust, expressive, and feature-rich CSS superset", | ||
"version": "0.47.1", | ||
"version": "0.47.2", | ||
"author": "TJ Holowaychuk <tj@vision-media.ca>", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
318642
12227