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

less

Package Overview
Dependencies
Maintainers
2
Versions
130
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

less - npm Package Compare versions

Comparing version 1.5.0-b2 to 1.5.0-b3

dist/less-1.5.0-b3.js

8

benchmark/less-benchmark.js

@@ -13,3 +13,3 @@ var path = require('path'),

sys.puts("Benchmarking...\n", path.basename(file) + " (" +
console.log("Benchmarking...\n", path.basename(file) + " (" +
parseInt(data.length / 1024) + " KB)", "");

@@ -24,3 +24,3 @@

sys.puts("Parsing: " +
console.log("Parsing: " +
total + " ms (" +

@@ -33,3 +33,3 @@ Number(1000 / total * data.length / 1024) + " KB\/s)");

sys.puts("Generation: " + (end - start) + " ms (" +
console.log("Generation: " + (end - start) + " ms (" +
parseInt(1000 / (end - start) *

@@ -40,3 +40,3 @@ data.length / 1024) + " KB\/s)");

sys.puts("Total: " + total + "ms (" +
console.log("Total: " + total + "ms (" +
Number(1000 / total * data.length / 1024) + " KB/s)");

@@ -43,0 +43,0 @@

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

# 1.5.0 Beta 1
# 1.5.0 Beta 3
2013-09-01
2013-09-17

@@ -19,5 +19,8 @@ - sourcemap support

- switched from the little supported and buggy cssmin (previously ycssmin) to clean-css
- support transparent as a color, but not convert between rgba(0, 0, 0, 0) and transparent
- remove sys.puts calls to stop deprecation warnings in future node.js releases
- Browser: added logLevel option to control logging (2 = everything, 1 = errors only, 0 = no logging)
- Browser: added errorReporting option which can be "html" (default) or "console" or a function
- A few bug fixes for media queries and extends
- Now uses grunt for building and testing
- A few bug fixes for media queries, extends, scoping, compression

@@ -24,0 +27,0 @@ # 1.4.2

@@ -18,3 +18,3 @@ 'use strict';

banner:
'/* \n' +
'/*! \n' +
' * LESS - <%= pkg.description %> v<%= pkg.version %> \n' +

@@ -21,0 +21,0 @@ ' * http://lesscss.org \n' +

@@ -143,3 +143,2 @@ (function (tree) {

'tomato':'#ff6347',
// 'transparent':'rgba(0,0,0,0)',
'turquoise':'#40e0d0',

@@ -146,0 +145,0 @@ 'violet':'#ee82ee',

@@ -11,2 +11,3 @@ (function (tree) {

'strictImports', // option -
'insecure', // option - whether to allow imports from insecure ssl hosts
'dumpLineNumbers', // option - whether to dump line numbers

@@ -13,0 +14,0 @@ 'compress', // option - whether to compress

@@ -323,3 +323,12 @@ (function (tree) {

if (n instanceof tree.Quoted) {
return new(tree.Color)(n.value.slice(1));
var colorCandidate = n.value,
returnColor;
returnColor = tree.Color.fromKeyword(colorCandidate);
if (returnColor) {
return returnColor;
}
if (/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/.test(colorCandidate)) {
return new(tree.Color)(colorCandidate.slice(1));
}
throw { type: "Argument", message: "argument must be a color keyword or 3/6 digit hex e.g. #FFF" };
} else {

@@ -326,0 +335,0 @@ throw { type: "Argument", message: "argument must be a string" };

@@ -8,3 +8,3 @@ var path = require('path'),

var less = {
version: [1, 5, "0-b2"],
version: [1, 5, "0-b3"],
Parser: require('./parser').Parser,

@@ -152,3 +152,3 @@ tree: require('./tree'),

request.get(urlStr, function (error, res, body) {
request.get({uri: urlStr, strictSSL: !env.insecure }, function (error, res, body) {
if (res.statusCode === 404) {

@@ -155,0 +155,0 @@ callback({ type: 'File', message: "resource '" + urlStr + "' was not found\n" });

@@ -26,44 +26,46 @@ // lessc_helper.js

printUsage: function() {
sys.puts("usage: lessc [option option=parameter ...] <source> [destination]");
sys.puts("");
sys.puts("If source is set to `-' (dash or hyphen-minus), input is read from stdin.");
sys.puts("");
sys.puts("options:");
sys.puts(" -h, --help Print help (this message) and exit.");
sys.puts(" --include-path=PATHS Set include paths. Separated by `:'. Use `;' on Windows.");
sys.puts(" -M, --depends Output a makefile import dependency list to stdout");
sys.puts(" --no-color Disable colorized output.");
sys.puts(" --no-ie-compat Disable IE compatibility checks.");
sys.puts(" --no-js Disable JavaScript in less files");
sys.puts(" -l, --lint Syntax check only (lint).");
sys.puts(" -s, --silent Suppress output of error messages.");
sys.puts(" --strict-imports Force evaluation of imports.");
sys.puts(" --verbose Be verbose.");
sys.puts(" -v, --version Print version number and exit.");
sys.puts(" -x, --compress Compress output by removing some whitespaces.");
sys.puts(" --clean-css Compress output using clean-css");
sys.puts(" -O0, -O1, -O2 Set the parser's optimization level. The lower");
sys.puts(" the number, the less nodes it will create in the");
sys.puts(" tree. This could matter for debugging, or if you");
sys.puts(" want to access the individual nodes in the tree.");
sys.puts(" --line-numbers=TYPE Outputs filename and line numbers.");
sys.puts(" TYPE can be either 'comments', which will output");
sys.puts(" the debug info within comments, 'mediaquery'");
sys.puts(" that will output the information within a fake");
sys.puts(" media query which is compatible with the SASS");
sys.puts(" format, and 'all' which will do both.");
sys.puts(" --source-map[=FILENAME] Outputs a v3 sourcemap to the filename (or output filename.map)");
sys.puts(" --source-map-rootpath=X adds this path onto the sourcemap filename and less file paths");
sys.puts(" --source-map-inline puts the less files into the map instead of referencing them");
sys.puts(" -rp, --rootpath=URL Set rootpath for url rewriting in relative imports and urls.");
sys.puts(" Works with or without the relative-urls option.");
sys.puts(" -ru, --relative-urls re-write relative urls to the base less file.");
sys.puts(" -sm=on|off Turn on or off strict math, where in strict mode, math");
sys.puts(" --strict-math=on|off requires brackets. This option may default to on and then");
sys.puts(" be removed in the future.");
sys.puts(" -su=on|off Allow mixed units, e.g. 1px+1em or 1px*1px which have units");
sys.puts(" --strict-units=on|off that cannot be represented.");
sys.puts("");
sys.puts("Report bugs to: http://github.com/less/less.js/issues");
sys.puts("Home page: <http://lesscss.org/>");
console.log("usage: lessc [option option=parameter ...] <source> [destination]");
console.log("");
console.log("If source is set to `-' (dash or hyphen-minus), input is read from stdin.");
console.log("");
console.log("options:");
console.log(" -h, --help Print help (this message) and exit.");
console.log(" --include-path=PATHS Set include paths. Separated by `:'. Use `;' on Windows.");
console.log(" -M, --depends Output a makefile import dependency list to stdout");
console.log(" --no-color Disable colorized output.");
console.log(" --no-ie-compat Disable IE compatibility checks.");
console.log(" --no-js Disable JavaScript in less files");
console.log(" -l, --lint Syntax check only (lint).");
console.log(" -s, --silent Suppress output of error messages.");
console.log(" --strict-imports Force evaluation of imports.");
console.log(" --insecure Allow imports from insecure https hosts.");
console.log(" --verbose Be verbose.");
console.log(" -v, --version Print version number and exit.");
console.log(" -x, --compress Compress output by removing some whitespaces.");
console.log(" --clean-css Compress output using clean-css");
console.log(" -O0, -O1, -O2 Set the parser's optimization level. The lower");
console.log(" the number, the less nodes it will create in the");
console.log(" tree. This could matter for debugging, or if you");
console.log(" want to access the individual nodes in the tree.");
console.log(" --line-numbers=TYPE Outputs filename and line numbers.");
console.log(" TYPE can be either 'comments', which will output");
console.log(" the debug info within comments, 'mediaquery'");
console.log(" that will output the information within a fake");
console.log(" media query which is compatible with the SASS");
console.log(" format, and 'all' which will do both.");
console.log(" --source-map[=FILENAME] Outputs a v3 sourcemap to the filename (or output filename.map)");
console.log(" --source-map-rootpath=X adds this path onto the sourcemap filename and less file paths");
console.log(" --source-map-basepath=X Sets sourcemap base path, defaults to current working directory.");
console.log(" --source-map-inline puts the less files into the map instead of referencing them");
console.log(" -rp, --rootpath=URL Set rootpath for url rewriting in relative imports and urls.");
console.log(" Works with or without the relative-urls option.");
console.log(" -ru, --relative-urls re-write relative urls to the base less file.");
console.log(" -sm=on|off Turn on or off strict math, where in strict mode, math");
console.log(" --strict-math=on|off requires brackets. This option may default to on and then");
console.log(" be removed in the future.");
console.log(" -su=on|off Allow mixed units, e.g. 1px+1em or 1px*1px which have units");
console.log(" --strict-units=on|off that cannot be represented.");
console.log("");
console.log("Report bugs to: http://github.com/less/less.js/issues");
console.log("Home page: <http://lesscss.org/>");
}

@@ -70,0 +72,0 @@ };

(function (tree) {
var sourceMap = require("source-map");

@@ -14,2 +13,3 @@ tree.sourceMapOutput = function (options) {

this._outputSourceFiles = options.outputSourceFiles;
this._sourceMapGeneratorConstructor = options.sourceMapGenerator || require("source-map").SourceMapGenerator;

@@ -31,3 +31,3 @@ if (this._sourceMapRootpath && this._sourceMapRootpath.charAt(this._sourceMapRootpath.length-1) !== '/') {

}
return this._sourceMapRootpath + filename.replace(/\\/g, '/');
return (this._sourceMapRootpath || "") + filename.replace(/\\/g, '/');
};

@@ -71,3 +71,3 @@

tree.sourceMapOutput.prototype.toCSS = function(env) {
this._sourceMapGenerator = new sourceMap.SourceMapGenerator({ file: this._outputFilename, sourceRoot: null });
this._sourceMapGenerator = new this._sourceMapGeneratorConstructor({ file: this._outputFilename, sourceRoot: null });

@@ -83,7 +83,18 @@ if (this._outputSourceFiles) {

if (this._css.length > 0) {
this._writeSourceMap(JSON.stringify(this._sourceMapGenerator.toJSON()));
var sourceMapFilename,
sourceMapContent = JSON.stringify(this._sourceMapGenerator.toJSON());
if (this._sourceMapFilename) {
this._css.push("/*# sourceMappingURL=" + this._sourceMapRootpath + this._sourceMapFilename + " */");
sourceMapFilename = this.normalizeFilename(this._sourceMapFilename);
}
if (this._writeSourceMap) {
this._writeSourceMap(sourceMapContent);
} else {
sourceMapFilename = "data:application/json," + encodeURIComponent(sourceMapContent);
}
if (sourceMapFilename) {
this._css.push("/*# sourceMappingURL=" + sourceMapFilename + " */");
}
}

@@ -94,2 +105,2 @@

})(require('./tree'));
})(require('./tree'));

@@ -25,2 +25,5 @@ (function (tree) {

};
var transparentKeyword = "transparent";
tree.Color.prototype = {

@@ -42,2 +45,5 @@ type: "Color",

if (this.alpha < 1.0) {
if (this.alpha === 0 && this.isTransparentKeyword) {
return transparentKeyword;
}
return "rgba(" + this.rgb.map(function (c) {

@@ -161,3 +167,15 @@ return Math.round(c);

tree.Color.fromKeyword = function(keyword) {
if (tree.colors.hasOwnProperty(keyword)) {
// detect named color
return new(tree.Color)(tree.colors[keyword].slice(1));
}
if (keyword === transparentKeyword) {
var transparent = new(tree.Color)([0, 0, 0], 0);
transparent.isTransparentKeyword = true;
return transparent;
}
};
})(require('../tree'));

@@ -213,7 +213,7 @@ (function (tree) {

matchCondition: function (args, env) {
if (this.condition && !this.condition.eval(
new(tree.evalEnv)(env,
[this.evalParams(env, new(tree.evalEnv)(env, this.frames.concat(env.frames)), args, [])]
.concat(env.frames)))) {
[this.evalParams(env, new(tree.evalEnv)(env, this.frames.concat(env.frames)), args, [])] // the parameter variables
.concat(this.frames) // the parent namespace/mixin frames
.concat(env.frames)))) { // the current environment frames
return false;

@@ -220,0 +220,0 @@ }

@@ -242,3 +242,5 @@ (function (tree) {

if (i + 1 === ruleNodes.length) {
// @page{ directive ends up with root elements inside it, a mix of rules and rulesets
// In this instance we do not know whether it is the last property
if (i + 1 === ruleNodes.length && (!this.root || rulesetNodes.length === 0 || this.firstRoot)) {
env.lastRule = true;

@@ -267,6 +269,6 @@ }

if (ruleNodes.length && firstRuleset) {
output.add("\n" + (this.root ? tabRuleStr : tabSetStr));
output.add((env.compress ? "" : "\n") + (this.root ? tabRuleStr : tabSetStr));
}
if (!firstRuleset) {
output.add('\n' + (this.root ? tabRuleStr : tabSetStr));
output.add((env.compress ? "" : "\n") + (this.root ? tabRuleStr : tabSetStr));
}

@@ -273,0 +275,0 @@ firstRuleset = false;

{
"name": "less",
"version": "1.5.0-b2",
"version": "1.5.0-b3",
"description": "Leaner CSS",

@@ -5,0 +5,0 @@ "homepage": "http://lesscss.org",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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