Socket
Socket
Sign inDemoInstall

stylus

Package Overview
Dependencies
Maintainers
0
Versions
182
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.3.1 to 0.4.0

6

._History.md

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

Mac OS X  2��ATTRtX��"�"com.macromates.caret{
column = 65;
line = 6;
Mac OS X  2��ATTR0;O��!�!com.macromates.caret{
column = 0;
line = 7;
}

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

Mac OS X  2��ATTRt^��"�"com.macromates.caret{
Mac OS X  2��ATTR0;U��"�"com.macromates.caret{
column = 21;
line = 2;
}
0.4.0 / 2011-02-07
==================
* Added css-style syntax support
* Fixed support for `*` selector within __@media__ blocks
0.3.1 / 2011-02-04

@@ -3,0 +9,0 @@ ==================

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

Mac OS X  2��ATTRtk��#�#com.macromates.caret{
Mac OS X  2��ATTR0;a��#�#com.macromates.caret{
column = 24;
line = 25;
}

@@ -152,2 +152,3 @@

|| this.null
|| this.sep
|| this.keyword

@@ -207,2 +208,14 @@ || this.atrule

},
/**
* ';' ' '*
*/
get sep() {
var captures;
if (captures = /^; */.exec(this.str)) {
this.skip(captures);
return new Token(';');
}
},

@@ -397,3 +410,3 @@ /**

/**
* '@media' ([^\n]+)
* '@media' ([^{\n]+)
*/

@@ -403,5 +416,5 @@

var captures;
if (captures = /^@media *([^\n]+)/.exec(this.str)) {
if (captures = /^@media *([^{\n]+)/.exec(this.str)) {
this.skip(captures);
return new Token('media', captures[1]);
return new Token('media', captures[1].trim());
}

@@ -630,3 +643,3 @@ },

var captures;
if (captures = /^[^\n,]+/.exec(this.str)) {
if (captures = /^[^{\n,]+/.exec(this.str)) {
var selector = captures[0];

@@ -633,0 +646,0 @@ this.skip(captures);

@@ -25,3 +25,3 @@

Node.call(this);
this.val = val;
this.val = val.replace(/ +$/, '');
this.parent = parent;

@@ -28,0 +28,0 @@ };

@@ -125,2 +125,3 @@

var stmt = this.statement;
this.accept(';');
if (!stmt) this.error('unexpected token {peek}, not allowed at the root level');

@@ -247,2 +248,11 @@ block.push(stmt);

/**
* Consume whitespace.
*/
get skipWhitespace() {
while (~['space', 'indent', 'outdent', 'newline'].indexOf(this.peek.type))
this.next;
},
/**
* Check if the following sequence of tokens

@@ -254,2 +264,3 @@ * forms a selector.

var i = 0;
// Assume pseudo selectors are NOT properties

@@ -268,2 +279,14 @@ // as 'td:th-child(1)' may look like a property

// Trailing brace
if ('{' == this.lookahead(i).type
&& 'newline' == this.lookahead(i + 1).type)
return true;
// css-style mode, false on ; }
if (this.css) {
if (';' == this.lookahead(i)
|| '}' == this.lookahead(i))
return false;
}
// Trailing indentation

@@ -322,2 +345,3 @@ while ('newline' != this.lookahead(i)

case 'function':
case 'media':
case 'for':

@@ -350,12 +374,40 @@ switch (type) {

block: function(node, scope) {
var block = this.parent = new nodes.Block(this.parent, node);
var delim
, _ = this.css
, block = this.parent = new nodes.Block(this.parent, node);
if (false === scope) block.scope = false;
this.expect('indent');
while ('outdent' != this.peek.type) {
if (this.accept('newline')) continue;
var stmt = this.statement;
// css-style
if (this.css = this.accept('{')) {
delim = '}';
this.skipWhitespace;
} else {
delim = 'outdent';
this.expect('indent');
}
while (delim != this.peek.type) {
// css-style
if (this.css) {
if (this.accept('newline')) continue;
var stmt = this.statement;
this.accept(';');
this.skipWhitespace;
} else {
if (this.accept('newline')) continue;
var stmt = this.statement;
}
if (!stmt) this.error('unexpected token {peek} in block');
block.push(stmt);
}
this.expect('outdent');
// css-style
if (this.css) {
this.skipWhitespace;
this.expect('}');
this.css = _;
} else {
this.expect('outdent');
}
this.parent = block.parent;

@@ -487,5 +539,13 @@ return block;

var pos
, _ = this.css
, name = this.id.name
, keyframes = new nodes.Keyframes(name);
this.expect('indent');
// css-sty;e
if (this.css = this.accept('{')) {
this.skipWhitespace;
} else {
this.expect('indent');
}
while (pos = this.accept('unit') || this.accept('ident')) {

@@ -514,4 +574,14 @@ // from | to

this.state.pop();
if (this.css) this.skipWhitespace;
}
this.expect('outdent');
// css-style
if (this.css) {
this.skipWhitespace;
this.expect('}');
this.css = _;
} else {
this.expect('outdent');
}
return keyframes;

@@ -650,11 +720,9 @@ },

// Property
// property
var ident = this.interpolate
, prop = new nodes.Property(ident);
// Optional ':'
// optional ':'
this.accept('space');
if (this.accept(':')) {
this.accept('space');
}
if (this.accept(':')) this.accept('space');

@@ -668,2 +736,5 @@ this.state.push('property');

// optional ';'
this.accept(';');
return prop;

@@ -728,2 +799,3 @@ },

this.lexer.allowComments = false;
this.state.push('selector');

@@ -733,3 +805,2 @@ group.block = this.block(group);

this.lexer.allowComments = false;

@@ -736,0 +807,0 @@ return group;

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

exports.version = '0.3.1';
exports.version = '0.4.0';

@@ -29,0 +29,0 @@ /**

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

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

@@ -46,3 +46,3 @@

- optional property colons
- [css syntax](stylus/blob/master/docs/css-style.md) support
- [mixins](stylus/blob/master/docs/mixins.md)

@@ -49,0 +49,0 @@ - [variables](stylus/blob/master/docs/variables.md)

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