Full rename to mess

This commit is contained in:
Tom MacWright 2011-01-05 14:23:28 -05:00
parent e33f61bcd1
commit e5ba37d71e
68 changed files with 642 additions and 1156 deletions

View File

@ -6,7 +6,7 @@ var path = require('path'),
require.paths.unshift(path.join(__dirname, '..', 'lib')); require.paths.unshift(path.join(__dirname, '..', 'lib'));
var less = require('less'); var mess = require('mess');
var args = process.argv.slice(1); var args = process.argv.slice(1);
var options = { var options = {
compress: false, compress: false,
@ -23,7 +23,7 @@ args = args.filter(function (arg) {
switch (arg) { switch (arg) {
case 'v': case 'v':
case 'version': case 'version':
sys.puts("lessc " + less.version.join('.') + " (LESS Compiler) [JavaScript]"); sys.puts("messc " + mess.version.join('.') + " (MESS Compiler) [JavaScript]");
process.exit(0); process.exit(0);
case 'verbose': case 'verbose':
options.verbose = true; options.verbose = true;
@ -34,7 +34,7 @@ args = args.filter(function (arg) {
break; break;
case 'h': case 'h':
case 'help': case 'help':
sys.puts("usage: lessc source [destination]"); sys.puts("usage: messc source [destination]");
process.exit(0); process.exit(0);
case 'x': case 'x':
case 'compress': case 'compress':
@ -58,23 +58,23 @@ if (output && output[0] != '/') {
var css, fd, tree; var css, fd, tree;
if (! input) { if (! input) {
sys.puts("lessc: no input files"); sys.puts("messc: no input files");
process.exit(1); process.exit(1);
} }
fs.readFile(input, 'utf-8', function (e, data) { fs.readFile(input, 'utf-8', function (e, data) {
if (e) { if (e) {
sys.puts("lessc: " + e.message); sys.puts("messc: " + e.message);
process.exit(1); process.exit(1);
} }
new(less.Renderer)({ new(mess.Renderer)({
paths: [path.dirname(input)], paths: [path.dirname(input)],
optimization: options.optimization, optimization: options.optimization,
filename: input filename: input
}).render(data, function (err, output) { }).render(data, function (err, output) {
if (err) { if (err) {
less.writeError(err, options); mess.writeError(err, options);
process.exit(1); process.exit(1);
} else { } else {
sys.puts(output); sys.puts(output);

View File

@ -1,154 +0,0 @@
/*
Copyright (c) 2010 Tim Caswell <tim@creationix.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
// Inspired by http://github.com/willconant/flow-js, but reimplemented and
// modified to fit my taste and the node.JS error handling system.
function Step() {
var steps = Array.prototype.slice.call(arguments),
counter, results, lock;
// Define the main callback that's given as `this` to the steps.
function next() {
// Check if there are no steps left
if (steps.length === 0) {
// Throw uncaught errors
if (arguments[0]) {
throw arguments[0];
}
return;
}
// Get the next step to execute
var fn = steps.shift();
counter = 0;
results = [];
// Run the step in a try..catch block so exceptions don't get out of hand.
try {
lock = true;
var result = fn.apply(next, arguments);
} catch (e) {
// Pass any exceptions on through the next callback
next(e);
}
// If a syncronous return is used, pass it to the callback
if (result !== undefined) {
next(undefined, result);
}
lock = false;
}
// Add a special callback generator `this.parallel()` that groups stuff.
next.parallel = function () {
var i = counter;
counter++;
function check() {
counter--;
if (counter === 0) {
// When they're all done, call the callback
next.apply(null, results);
}
}
return function () {
// Compress the error from any result to the first argument
if (arguments[0]) {
results[0] = arguments[0];
}
// Send the other results as arguments
results[i + 1] = arguments[1];
if (lock) {
process.nextTick(check);
return
}
check();
};
};
// Generates a callback generator for grouped results
next.group = function () {
var localCallback = next.parallel();
var counter = 0;
var result = [];
var error = undefined;
// Generates a callback for the group
return function () {
var i = counter;
counter++;
function check() {
counter--;
if (counter === 0) {
// When they're all done, call the callback
localCallback(error, result);
}
}
return function () {
// Compress the error from any result to the first argument
if (arguments[0]) {
error = arguments[0];
}
// Send the other results as arguments
result[i] = arguments[1];
if (lock) {
process.nextTick(check);
return
}
check();
}
}
};
// Start the engine an pass nothing to the first step.
next([]);
}
// Tack on leading and tailing steps for input and output and return
// the whole thing as a function. Basically turns step calls into function
// factories.
Step.fn = function StepFn() {
var steps = Array.prototype.slice.call(arguments);
return function () {
var args = Array.prototype.slice.call(arguments);
// Insert a first step that primes the data stream
var toRun = [function () {
this.apply(null, args);
}].concat(steps);
// If the last arg is a function add it as a last step
if (typeof args[args.length-1] === 'function') {
toRun.push(args.pop());
}
Step.apply(null, toRun);
}
}
// Hook into commonJS module systems
if (typeof module !== 'undefined' && "exports" in module) {
module.exports = Step;
}

BIN
lib/mess/.index.js.swp Normal file

Binary file not shown.

BIN
lib/mess/.renderer.js.swp Normal file

Binary file not shown.

BIN
lib/mess/.step.js.swp Normal file

Binary file not shown.

View File

@ -154,4 +154,4 @@ function clamp(val) {
return Math.min(1, Math.max(0, val)); return Math.min(1, Math.max(0, val));
} }
})(require('less/tree')); })(require('mess/tree'));

View File

@ -4,12 +4,12 @@ var path = require('path'),
require.paths.unshift(path.join(__dirname, '..')); require.paths.unshift(path.join(__dirname, '..'));
var less = { var mess = {
version: [1, 0, 40], version: [1, 0, 40],
Parser: require('less/parser').Parser, Parser: require('mess/parser').Parser,
Renderer: require('less/renderer').Renderer, Renderer: require('mess/renderer').Renderer,
importer: require('less/parser').importer, importer: require('mess/parser').importer,
tree: require('less/tree'), tree: require('mess/tree'),
reference: JSON.parse(fs.readFileSync( reference: JSON.parse(fs.readFileSync(
path.join(__dirname, 'jsonreference.json'))), path.join(__dirname, 'jsonreference.json'))),
render: function (input, options, callback) { render: function (input, options, callback) {
@ -84,10 +84,10 @@ var less = {
'mixin', 'comment', 'anonymous', 'value', 'javascript', 'mixin', 'comment', 'anonymous', 'value', 'javascript',
'comparison', 'reference', 'filter' 'comparison', 'reference', 'filter'
].forEach(function (n) { ].forEach(function (n) {
require(path.join('less', 'tree', n)); require(path.join('mess', 'tree', n));
}); });
less.Parser.importer = function (file, paths, callback) { mess.Parser.importer = function (file, paths, callback) {
var pathname; var pathname;
paths.unshift('.'); paths.unshift('.');
@ -106,11 +106,11 @@ less.Parser.importer = function (file, paths, callback) {
fs.readFile(pathname, 'utf-8', function(e, data) { fs.readFile(pathname, 'utf-8', function(e, data) {
if (e) sys.error(e); if (e) sys.error(e);
new(less.Parser)({ new(mess.Parser)({
paths: [path.dirname(pathname)], paths: [path.dirname(pathname)],
filename: pathname filename: pathname
}).parse(data, function (e, root) { }).parse(data, function (e, root) {
if (e) less.writeError(e); if (e) mess.writeError(e);
callback(root); callback(root);
}); });
}); });
@ -120,9 +120,9 @@ less.Parser.importer = function (file, paths, callback) {
} }
} }
require('less/functions'); require('mess/functions');
for (var k in less) { exports[k] = less[k] } for (var k in mess) { exports[k] = mess[k] }
// Stylize a string // Stylize a string
function stylize(str, style) { function stylize(str, style) {

577
lib/mess/jsonreference.json Normal file
View File

@ -0,0 +1,577 @@
{
"symbolizers" : {
"map": {
"map-bgcolor": {
"type": "color_transparent",
"description": "Map Background color"
}
},
"polygon": {
"fill": {
"css": "polygon-fill",
"api": "fill",
"type": "color",
"availability": "0.5.1",
"default-value": "rgb(128,128,128)",
"default-meaning": "grey",
"doc": "Fill color to assign to a polygon"
},
"gamma": {
"css": "polygon-gamma",
"api": "gamma",
"type": "float",
"availability": "0.7.0",
"default-value": 1,
"default-meaning": "fully antialiased",
"range": "0-1",
"doc": "Level of antialiasing of polygon edges"
},
"opacity": {
"css": "polygon-opacity",
"type": "float",
"default-value": 1,
"default-meaning": "opaque"
},
"meta-output": {
"css": "polygon-meta-output",
"type": "string",
"default-value": "",
"default-meaning": "No MetaWriter Output"
},
"meta-writer": {
"css": "polygon-meta-writer",
"type": "string",
"default-value": "",
"default-meaning": "No MetaWriter specified"
}
},
"line": {
"color": {
"css": "line-color",
"default-value": "black",
"type": "color",
"doc": "The color of a drawn line"
},
"width": {
"css": "line-width",
"default-value": 1,
"type": "float",
"doc": "The width of a line"
},
"opacity": {
"css": "line-opacity",
"default-value": 1,
"type": "float",
"doc": "The opacity of a line"
},
"join": {
"css": "line-join",
"default-value": "miter",
"type": [
"miter",
"round",
"bevel"
],
"doc": "The behavior of lines when joining"
},
"cap": {
"css": "line-cap",
"default-value": "butt",
"type": [
"butt",
"round",
"square"
],
"doc": "The display of line endings."
},
"dasharray": {
"css": "line-dasharray",
"type": "numbers",
"doc": "A pair of length values [a,b], where (a) is the dash length and (b) is the gap length respectively. More than two values are supported as well (e.g. to start the line not with a stroke, but with a gap).",
"default-value": "none"
},
"meta-output": {
"css": "line-meta-output",
"type": "string",
"default-value": "",
"default-meaning": "No MetaWriter Output"
},
"meta-writer": {
"css": "line-meta-writer",
"type": "string",
"default-value": ""
}
},
"marker": {
"line-color": {
"css": "marker-line-color",
"type": "color"
},
"line-width": {
"css": "marker-line-width",
"type": "float"
},
"line-opacity": {
"css": "marker-line-opacity",
"default-value": 1,
"type": "float"
},
"placement": {
"css": "marker-placement",
"type": [
"point",
"line"
]
},
"type": {
"css": "marker-type",
"type": [
"arrow",
"ellipse"
]
},
"width": {
"css": "marker-width",
"type": "float"
},
"height": {
"css": "marker-height",
"type": "float"
},
"fill": {
"css": "marker-fill",
"type": "color"
},
"fill-opacity": {
"css": "marker-opacity",
"default-value": 1,
"type": "float"
},
"file": {
"css": "marker-file",
"type": "uri"
},
"allow-overlap": {
"css": "marker-allow-overlap",
"type": "boolean"
},
"spacing": {
"css": "marker-spacing",
"docs": "Space between repeated labels",
"type": "float"
},
"max-error": {
"css": "marker-max-error",
"type": "float"
},
"transform": {
"css": "marker-transform",
"type": "string"
},
"meta-output": {
"css": "marker-meta-output",
"type": "string",
"default-value": "",
"default-meaning": "No MetaWriter Output"
},
"meta-writer": {
"css": "marker-meta-writer",
"type": "string",
"default-value": "none"
}
},
"shield": {
"name": {
"css": "shield-name",
"type": "none"
},
"face-name": {
"css": "shield-name",
"type": "string"
},
"size": {
"css": "shield-size",
"type": "int"
},
"fill": {
"css": "shield-fill",
"type": "color"
},
"min-distance": {
"css": "shield-min-distance",
"type": "int",
"default-value": 0,
"doc": "Minimum distance to the next shield symbol, not necessarily the same shield."
},
"spacing": {
"css": "shield-spacing",
"type": "int",
"default-value": 0,
"doc": "The spacing between repeated occurrences of the same shield"
},
"character-spacing": {
"css": "shield-spacing",
"type": "int",
"default-value": 0,
"doc": "Horizontal spacing between characters (in pixels). Currently works for point placement only, not line placement."
},
"line-spacing": {
"css": "shield-line-spacing",
"doc": "Vertical spacing between lines of multiline labels (in pixels)",
"type": "int"
},
"file": {
"css": "shield-file",
"type": "uri"
},
"width": {
"css": "shield-width",
"type": "int",
"default-value": "The image's width"
},
"height": {
"css": "shield-height",
"type": "int",
"default-value": "The image's height"
},
"type": {
"css": "shield-type",
"type": "None",
"default-value": "The type of the image file: e.g. png"
},
"meta-output": {
"css": "shield-meta-output",
"type": "string",
"default-value": "",
"default-meaning": "No MetaWriter Output"
},
"meta-writer": {
"css": "shield-meta-writer",
"type": "string",
"default-value": ""
}
},
"line-pattern": {
"file": {
"css": "line-pattern-file",
"type": "uri"
},
"width": {
"css": "line-pattern-width",
"type": "int"
},
"height": {
"css": "line-pattern-height",
"type": "int"
},
"type": {
"css": "line-pattern-type",
"type": "none"
},
"meta-output": {
"css": "line-pattern-meta-output",
"type": "string",
"default-value": "",
"default-meaning": "No MetaWriter Output"
},
"meta-writer": {
"css": "line-pattern-meta-writer",
"type": "string",
"default-value": ""
}
},
"polygon-pattern": {
"file": {
"css": "polygon-pattern-file",
"type": "uri"
},
"width": {
"css": "polygon-pattern-width",
"type": "int"
},
"height": {
"css": "polygon-pattern-height",
"type": "int"
},
"type": {
"css": "polygon-pattern-type",
"type": "none"
},
"meta-output": {
"css": "polygon-pattern-meta-output",
"type": "string",
"default-value": "",
"default-meaning": "No MetaWriter Output"
},
"meta-writer": {
"css": "polygon-pattern-meta-writer",
"type": "string",
"default-value": ""
}
},
"raster": {
"opacity": {
"css": "raster-opacity",
"default-value": 1,
"type": "float"
},
"mode": {
"css": "raster-mode",
"default-value": "normal",
"type": [
"normal",
"grain_merge",
"grain_merge2",
"multiply",
"multiply2",
"divide",
"divide2",
"screen",
"hard_light"
]
},
"scaling": {
"css": "raster-scaling",
"type": [
"fast",
"bilinear",
"bilinear8"
]
}
},
"point": {
"file": {
"css": "point-file",
"type": "uri"
},
"width": {
"css": "point-width",
"type": "int"
},
"height": {
"css": "point-height",
"type": "int"
},
"type": {
"css": "point-type",
"type": "none"
},
"allow-overlap": {
"css": "point-allow-overlap",
"type": "boolean"
},
"meta-output": {
"css": "point-meta-output",
"type": "string",
"default-value": "",
"default-meaning": "No MetaWriter Output"
},
"meta-writer": {
"css": "point-meta-writer",
"type": "string",
"default-value": ""
}
},
"text": {
"face-name": {
"css": "text-face-name",
"type": "string"
},
"size": {
"css": "text-size",
"type": "integer"
},
"ratio": {
"css": "text-ratio",
"type": "integer",
"type": "none"
},
"wrap-width": {
"css": "text-wrap-width",
"doc": "Length of a chunk of text in characters before wrapping text",
"type": "integer"
},
"spacing": {
"css": "text-spacing",
"type": "integer"
},
"character-spacing": {
"css": "text-character-spacing",
"type": "integer",
"default-value": 0
},
"line-spacing": {
"css": "text-line-spacing",
"type": "integer"
},
"label-position-tolerance": {
"css": "text-label-position-tolerance",
"type": "integer"
},
"max-char-angle-delta": {
"css": "text-max-char-angle-delta",
"type": "integer"
},
"fill": {
"css": "text-fill",
"type": "color"
},
"halo-fill": {
"css": "text-halo-fill",
"docs": "Color of the text halo",
"type": "color"
},
"halo-radius": {
"css": "text-halo-radius",
"type": "integer"
},
"dx": {
"css": "text-dx",
"type": "integer"
},
"dy": {
"css": "text-dy",
"type": "integer"
},
"avoid-edges": {
"css": "text-avoid-edges",
"doc": "Tell positioning algorithm to avoid labeling near intersection edges.",
"type": "boolean"
},
"min-distance": {
"css": "text-min-distance",
"type": "integer"
},
"allow-overlap": {
"css": "text-allow-overlap",
"type": "boolean"
},
"placement": {
"css": "text-placement",
"type": [
"point",
"line"
]
},
"transform": {
"css": "text-transform",
"type": [
"point",
"line",
"uppercase",
"lowercase"
]
},
"meta-output": {
"css": "text-meta-output",
"type": "string",
"default-value": "",
"default-meaning": "No MetaWriter Output"
},
"meta-writer": {
"css": "text-meta-writer",
"type": "string",
"default-value": ""
}
},
"inline": {
"color": {
"css": "inline-color",
"default-value": "black",
"type": "color"
},
"width": {
"css": "inline-width",
"type": "float"
},
"opacity": {
"css": "inline-opacity",
"default-value": 1,
"type": "float"
},
"join": {
"css": "inline-join",
"default-value": "miter",
"type": [
"miter",
"round",
"bevel"
]
},
"cap": {
"css": "inline-cap",
"default-value": "butt",
"type": [
"butt",
"round",
"square"
]
},
"dasharray": {
"css": "inline-dasharray",
"type": "numbers"
},
"meta-output": {
"css": "inline-meta-output",
"type": "string",
"default-value": "none",
"default-meaning": "No MetaWriter Output"
},
"meta-writer": {
"css": "inline-meta-writer",
"type": "string",
"default-value": "none"
}
},
"outline": {
"color": {
"css": "outline-color",
"default-value": "black",
"type": "color"
},
"width": {
"css": "outline-width",
"default-value": 1,
"type": "float"
},
"opacity": {
"css": "outline-opacity",
"default-value": 1,
"type": "float"
},
"join": {
"css": "outline-join",
"default-value": "miter",
"type": [
"miter",
"round",
"bevel"
]
},
"cap": {
"css": "outline-cap",
"default-value": "butt",
"type": [
"butt",
"round",
"square"
]
},
"dasharray": {
"css": "outline-dasharray",
"type": "numbers"
},
"meta-output": {
"css": "outline-meta-output",
"type": "string",
"default-value": "none",
"default-meaning": "No MetaWriter Output"
},
"meta-writer": {
"css": "outline-meta-writer",
"type": "string",
"default-value": "none"
}
}
}
}

View File

@ -1,15 +1,15 @@
var less, tree; var mess, tree;
if (typeof(window) === 'undefined') { if (typeof(window) === 'undefined') {
less = exports, mess = exports,
tree = require('less/tree'); tree = require('mess/tree');
} else { } else {
if (typeof(window.less) === 'undefined') { window.less = {} } if (typeof(window.mess) === 'undefined') { window.mess = {} }
less = window.less, mess = window.mess,
tree = window.less.tree = {}; tree = window.mess.tree = {};
} }
// //
// less.js - parser // mess.js - parser
// //
// A relatively straight-forward predictive parser. // A relatively straight-forward predictive parser.
// There is no tokenization/lexing stage, the input is parsed // There is no tokenization/lexing stage, the input is parsed
@ -41,7 +41,7 @@ if (typeof(window) === 'undefined') {
// It also takes care of moving all the indices forwards. // It also takes care of moving all the indices forwards.
// //
// //
less.Parser = function Parser(env) { mess.Parser = function Parser(env) {
var input, // LeSS input string var input, // LeSS input string
i, // current index in `input` i, // current index in `input`
j, // current chunk j, // current chunk
@ -62,7 +62,7 @@ less.Parser = function Parser(env) {
paths: env && env.paths || [], // Search paths, when importing paths: env && env.paths || [], // Search paths, when importing
queue: [], // Files which haven't been imported yet queue: [], // Files which haven't been imported yet
files: {}, // Holds the imported parse trees files: {}, // Holds the imported parse trees
mime: env && env.mime, // MIME type of .less files mime: env && env.mime, // MIME type of .mess files
push: function (path, callback) { push: function (path, callback) {
var that = this; var that = this;
this.queue.push(path); this.queue.push(path);
@ -70,7 +70,7 @@ less.Parser = function Parser(env) {
// //
// Import a file asynchronously // Import a file asynchronously
// //
less.Parser.importer(path, this.paths, function (root) { mess.Parser.importer(path, this.paths, function (root) {
that.queue.splice(that.queue.indexOf(path), 1); // Remove the path from the queue that.queue.splice(that.queue.indexOf(path), 1); // Remove the path from the queue
that.files[path] = root; // Store the root that.files[path] = root; // Store the root
@ -165,7 +165,7 @@ less.Parser = function Parser(env) {
this.env = env = env || {}; this.env = env = env || {};
// The optimization level dictates the thoroughness of the parser, // The optimization level dictates the thoroughness of the parser,
// the lower the number, the less nodes it will create in the tree. // the lower the number, the mess nodes it will create in the tree.
// This could matter for debugging, or if you want to access // This could matter for debugging, or if you want to access
// the individual nodes in the tree. // the individual nodes in the tree.
this.optimization = ('optimization' in this.env) ? this.env.optimization : 1; this.optimization = ('optimization' in this.env) ? this.env.optimization : 1;
@ -991,7 +991,7 @@ if (typeof(window) !== 'undefined') {
// //
// Used by `@import` directives // Used by `@import` directives
// //
less.Parser.importer = function (path, paths, callback, env) { mess.Parser.importer = function (path, paths, callback, env) {
if (path.charAt(0) !== '/' && paths.length > 0) { if (path.charAt(0) !== '/' && paths.length > 0) {
path = paths[0] + path; path = paths[0] + path;
} }

View File

@ -1,14 +1,14 @@
var path = require('path'), var path = require('path'),
fs = require('fs'), fs = require('fs'),
External = require('./external'), External = require('./external'),
Step = require('./step'), Step = require('step'),
_ = require('underscore')._, _ = require('underscore')._,
sys = require('sys'); sys = require('sys');
require.paths.unshift(path.join(__dirname, '..', 'lib')); require.paths.unshift(path.join(__dirname, '..', 'lib'));
var mess = {}, var mess = {},
less = require('less'); mess = require('mess');
/** /**
* Convert a two-element-per-item Array * Convert a two-element-per-item Array
@ -129,11 +129,11 @@ mess.Renderer = function Renderer(env) {
var options = {}, var options = {},
group = this.group(); group = this.group();
for (var i = 0, l = results.length; i < l; i++) { for (var i = 0, l = results.length; i < l; i++) {
new(less.Parser)({ new(mess.Parser)({
filename: s filename: s
}).parse(results[i][1], function(err, tree) { }).parse(results[i][1], function(err, tree) {
if (err) { if (err) {
less.writeError(err, options); mess.writeError(err, options);
process.exit(1); process.exit(1);
} else { } else {
try { try {
@ -142,7 +142,7 @@ mess.Renderer = function Renderer(env) {
tree.toCSS({ compress: false }), tree.toCSS({ compress: false }),
tree]); tree]);
} catch (e) { } catch (e) {
less.writeError(e, options); mess.writeError(e, options);
process.exit(2); process.exit(2);
} }
} }

View File

@ -1,4 +1,4 @@
require('less/tree').find = function (obj, fun) { require('mess/tree').find = function (obj, fun) {
for (var i = 0, r; i < obj.length; i++) { for (var i = 0, r; i < obj.length; i++) {
if (r = fun.call(obj, obj[i])) { return r } if (r = fun.call(obj, obj[i])) { return r }
} }

Binary file not shown.

View File

@ -11,4 +11,4 @@ tree.Alpha.prototype = {
eval: function () { return this } eval: function () { return this }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -10,4 +10,4 @@ tree.Anonymous.prototype = {
eval: function () { return this } eval: function () { return this }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -22,4 +22,4 @@ tree.Attribute.prototype.toCSS = function (env) {
'</Filter>'; '</Filter>';
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -36,4 +36,4 @@ tree.Call.prototype = {
} }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -91,4 +91,4 @@ tree.Color.prototype = {
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -11,4 +11,4 @@ tree.Comment.prototype = {
eval: function () { return this } eval: function () { return this }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -17,4 +17,4 @@ tree.Comparison.prototype = {
} }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -36,4 +36,4 @@ tree.Dimension.prototype = {
} }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -30,4 +30,4 @@ tree.Directive.prototype = {
rulesets: function () { return tree.Ruleset.prototype.rulesets.apply(this.ruleset) } rulesets: function () { return tree.Ruleset.prototype.rulesets.apply(this.ruleset) }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -32,4 +32,4 @@ tree.Combinator.prototype.toCSS = function (env) {
}[this.value]; }[this.value];
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -18,4 +18,4 @@ tree.Expression.prototype = {
} }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -49,4 +49,4 @@ tree.Filter.prototype.toCSS = function (env) {
'</Filter>'; '</Filter>';
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -16,16 +16,16 @@ tree.Import = function (path, imports) {
this._path = path; this._path = path;
// The '.less' extension is optional // The '.mess' extension is optional
if (path instanceof tree.Quoted) { if (path instanceof tree.Quoted) {
this.path = /\.(le?|c)ss$/.test(path.value) ? path.value : path.value + '.less'; this.path = /\.(le?|c)ss$/.test(path.value) ? path.value : path.value + '.mess';
} else { } else {
this.path = path.value.value || path.value; this.path = path.value.value || path.value;
} }
this.css = /css$/.test(this.path); this.css = /css$/.test(this.path);
// Only pre-compile .less files // Only pre-compile .mess files
if (! this.css) { if (! this.css) {
imports.push(this.path, function (root) { imports.push(this.path, function (root) {
if (! root) { if (! root) {
@ -74,4 +74,4 @@ tree.Import.prototype = {
} }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -34,5 +34,5 @@ tree.JavaScript.prototype = {
} }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -14,4 +14,4 @@ tree.Keyword.prototype = {
toCSS: function () { return this.value } toCSS: function () { return this.value }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -96,4 +96,4 @@ tree.mixin.Definition.prototype = {
} }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -29,4 +29,4 @@ tree.operate = function (op, a, b) {
} }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -14,4 +14,4 @@ tree.Quoted.prototype = {
} }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -675,4 +675,4 @@ tree.Reference.validValue = function(selector, value) {
} }
} }
})(require('less/tree')); })(require('mess/tree'));

View File

@ -58,4 +58,4 @@ tree.Shorthand.prototype = {
eval: function () { return this } eval: function () { return this }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -197,4 +197,4 @@ tree.Ruleset.prototype = {
return css.join('') + (env.compress ? '\n' : ''); return css.join('') + (env.compress ? '\n' : '');
} }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -22,4 +22,4 @@ tree.Selector.prototype.toCSS = function (env) {
}).join('--'); }).join('--');
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -23,4 +23,4 @@ tree.URL.prototype = {
} }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -24,4 +24,4 @@ tree.Value.prototype = {
} }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -17,4 +17,4 @@ tree.Variable.prototype = {
} }
}; };
})(require('less/tree')); })(require('mess/tree'));

View File

@ -1,46 +0,0 @@
#yelow {
#short {
color: #fea;
}
#long {
color: #ffeeaa;
}
#rgba {
color: rgba(255, 238, 170, 0.1);
}
}
#blue {
#short {
color: #00f;
}
#long {
color: #0000ff;
}
#rgba {
color: rgba(0, 0, 255, 0.1);
}
}
#alpha #hsla {
color: hsla(11, 20%, 20%, 0.6);
}
#overflow {
.a { color: #111111 - #444444; } // #000000
.b { color: #eee + #fff; } // #ffffff
.c { color: #aaa * 3; } // #ffffff
.d { color: #00ee00 + #009900; } // #00ff00
}
#grey {
color: rgb(200, 200, 200);
}
#808080 {
color: hsl(50, 0%, 50%);
}
#00ff00 {
color: hsl(120, 100%, 50%);
}

View File

@ -1,59 +0,0 @@
/******************\
* *
* Comment Header *
* *
\******************/
/*
Comment
*/
/*
* Comment Test
*
* - cloudhead (http://cloudhead.net)
*
*/
////////////////
@var: "content";
////////////////
/* Colors
* ------
* #EDF8FC (background blue)
* #166C89 (darkest blue)
*
* Text:
* #333 (standard text) // A comment within a comment!
* #1F9EC9 (standard link)
*
*/
/* @group Variables
------------------- */
#comments /* boo */ {
/**/ // An empty comment
color: red; /* A C-style comment */
background-color: orange; // A little comment
font-size: 12px;
/* lost comment */ content: @var;
border: 1px solid black;
// padding & margin //
padding: 0; // }{ '"
margin: 2em;
} //
/* commented out
#more-comments {
color: grey;
}
*/
#last { color: blue }
//

View File

@ -1,55 +0,0 @@
.comma-delimited {
background: url(bg.jpg) no-repeat, url(bg.png) repeat-x top left, url(bg);
text-shadow: -1px -1px 1px red, 6px 5px 5px yellow;
-moz-box-shadow: 0pt 0pt 2px rgba(255, 255, 255, 0.4) inset,
0pt 4px 6px rgba(255, 255, 255, 0.4) inset;
}
@font-face {
font-family: Headline;
src: local(Futura-Medium),
url(fonts.svg#MyGeometricModern) format("svg");
}
.other {
-moz-transform: translate(0, 11em) rotate(-90deg);
}
p:not([class*="lead"]) {
color: black;
}
input[type="text"].class#id[attr=32]:not(1) {
color: white;
}
div#id.class[a=1][b=2].class:not(1) {
color: white;
}
ul.comma > li:not(:only-child)::after {
color: white;
}
ol.comma > li:nth-last-child(2)::after {
color: white;
}
li:nth-child(4n+1),
li:nth-child(-5n),
li:nth-child(-n+2) {
color: white;
}
a[href^="http://"] {
color: black;
}
a[href$="http://"] {
color: black;
}
form[data-disabled] {
color: black;
}
p::before {
color: black;
}

View File

@ -1,28 +0,0 @@
@ugly: fuchsia;
.escape\|random\|char {
color: red;
}
.mixin\!tUp {
font-weight: bold;
}
// class="404"
.\34 04 {
background: red;
strong {
color: @ugly;
.mixin\!tUp;
}
}
.trailingTest\+ {
color: red;
}
/* This hideous test of hideousness checks for the selector "blockquote" with various permutations of hex escapes */
\62\6c\6f \63 \6B \0071 \000075o\74 e {
color: silver;
}

View File

@ -1,95 +0,0 @@
@charset "utf-8";
div { color: black; }
div { width: 99%; }
* {
min-width: 45em;
}
h1, h2 > a > p, h3 {
color: none;
}
div.class {
color: blue;
}
div#id {
color: green;
}
.class#id {
color: purple;
}
.one.two.three {
color: grey;
}
@media print {
font-size: 3em;
}
@media screen {
font-size: 10px;
}
@font-face {
font-family: 'Garamond Pro';
src: url("/fonts/garamond-pro.ttf");
}
a:hover, a:link {
color: #999;
}
p, p:first-child {
text-transform: none;
}
q:lang(no) {
quotes: none;
}
p + h1 {
font-size: 2.2em;
}
#shorthands {
border: 1px solid #000;
font: 12px/16px Arial;
font: 100%/16px Arial;
margin: 1px 0;
padding: 0 auto;
background: url("http://www.lesscss.org/spec.html") no-repeat 0 4px;
}
#more-shorthands {
margin: 0;
padding: 1px 0 2px 0;
font: normal small/20px 'Trebuchet MS', Verdana, sans-serif;
}
.misc {
-moz-border-radius: 2px;
display: -moz-inline-stack;
width: .1em;
background-color: #009998;
background-image: url(images/image.jpg);
background: -webkit-gradient(linear, left top, left bottom, from(red), to(blue));
margin: ;
}
#important {
color: red !important;
width: 100%!important;
height: 20px ! important;
}
#data-uri {
background: url(data:image/png;charset=utf-8;base64,
kiVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAABlBMVEUAAAD/
k//+l2Z/dAAAAM0lEQVR4nGP4/5/h/1+G/58ZDrAz3D/McH8yw83NDDeNGe4U
kg9C9zwz3gVLMDA/A6P9/AFGGFyjOXZtQAAAAAElFTkSuQmCC);
background-image: url(data:image/x-png,f9difSSFIIGFIFJD1f982FSDKAA9==);
}

View File

@ -1,31 +0,0 @@
#functions {
@var: 10;
color: color("evil red"); // #660000
width: increment(15);
height: undefined("self");
border-width: add(2, 3);
variable: increment(@var);
}
#built-in {
@r: 32;
escaped: e("-Some::weird(#thing, y)");
lighten: lighten(#ff0000, 40%);
darken: darken(#ff0000, 40%);
saturate: saturate(#29332f, 20%);
desaturate: desaturate(#203c31, 20%);
greyscale: greyscale(#203c31);
spin-p: spin(hsl(340, 50%, 50%), 40);
spin-n: spin(hsl(30, 50%, 50%), -40);
format: %("rgb(%d, %d, %d)", @r, 128, 64);
format-string: %("hello %s", "world");
eformat: e(%("rgb(%d, %d, %d)", @r, 128, 64));
hue: hue(hsl(98, 12%, 95%));
saturation: saturation(hsl(98, 12%, 95%));
lightness: lightness(hsl(98, 12%, 95%));
}
#alpha {
alpha: darken(hsla(25, 50%, 50%, 0.6), 10%);
}

View File

@ -1,8 +0,0 @@
@import url("import/import-test-a.less");
//@import url("import/import-test-a.less");
#import-test {
.mixin;
width: 10px;
height: @a + 10%;
}

View File

@ -1,2 +0,0 @@
@import "import-test-b.less";
@a: 20%;

View File

@ -1,8 +0,0 @@
@import "import-test-c";
@b: 100%;
.mixin {
height: 10px;
color: @c;
}

View File

@ -1,7 +0,0 @@
@import "import-test-d.css";
@c: red;
#import {
color: @c;
}

View File

@ -1 +0,0 @@
#css { color: yellow; }

View File

@ -1,16 +0,0 @@
.eval {
js: `42`;
js: `1 + 1`;
js: `"hello world"`;
sigkill: `process.SIGKILL`;
ternary: `(1 + 1 == 2 ? true : false)`;
}
.scope {
@foo: 42;
var: `this.foo.toJS()`;
escaped: e(`2 + 5 + 'px'`);
}
.vars {
@var: `4 + 4`;
width: @var;
}

View File

@ -1,6 +0,0 @@
@var: @a;
@a: 100%;
.lazy-eval {
width: @var;
}

View File

@ -1,25 +0,0 @@
// For now, variables can't be declared inside @media blocks.
@var: 42;
@media print {
.class {
color: blue;
.sub {
width: @var;
}
}
.top, header > h1 {
color: #222 * 2;
}
}
@media screen {
@base: 8;
body { max-width: @base * 60; }
}
@media all and (orientation:portrait) {
aside { float: none; }
}

View File

@ -1,107 +0,0 @@
.mixin (@a: 1px, @b: 50%) {
width: @a * 5;
height: @b - 1%;
}
.mixina (@style, @width, @color: black) {
border: @width @style @color;
}
.mixiny
(@a: 0, @b: 0) {
margin: @a;
padding: @b;
}
.hidden() {
color: transparent; // asd
}
#hidden {
.hidden;
.hidden();
}
.two-args {
color: blue;
.mixin(2px, 100%);
.mixina(dotted, 2px);
}
.one-arg {
.mixin(3px);
}
.no-parens {
.mixin;
}
.no-args {
.mixin();
}
.var-args {
@var: 9;
.mixin(@var, @var * 2);
}
.multi-mix {
.mixin(2px, 30%);
.mixiny(4, 5);
}
.maxa(@arg1: 10, @arg2: #f00) {
padding: @arg1 * 2px;
color: @arg2;
}
body {
.maxa(15);
}
@glob: 5;
.global-mixin(@a:2) {
width: @glob + @a;
}
.scope-mix {
.global-mixin(3);
}
.nested-ruleset (@width: 200px) {
width: @width;
.column { margin: @width; }
}
.content {
.nested-ruleset(600px);
}
//
.same-var-name2(@radius) {
radius: @radius;
}
.same-var-name(@radius) {
.same-var-name2(@radius);
}
#same-var-name {
.same-var-name(5px);
}
//
.var-inside () {
@var: 10px;
width: @var;
}
#var-inside { .var-inside; }
// # mixins
#id-mixin () {
color: red;
}
.id-class {
#id-mixin();
#id-mixin;
}

View File

@ -1,26 +0,0 @@
.scope {
@var: 99px;
.mixin () {
width: @var;
}
}
.class {
.scope > .mixin;
}
.overwrite {
@var: 0px;
.scope > .mixin;
}
.nested {
@var: 5px;
.mixin () {
width: @var;
}
.class {
@var: 10px;
.mixin;
}
}

View File

@ -1,22 +0,0 @@
.mix-inner (@var) {
border-width: @var;
}
.mix (@a: 10) {
.inner {
height: @a * 10;
.innest {
width: @a;
.mix-inner(@a * 2);
}
}
}
.class {
.mix(30);
}
.class2 {
.mix(60);
}

View File

@ -1,96 +0,0 @@
.mixin () {
zero: 0;
}
.mixin (@a: 1px) {
one: 1;
}
.mixin (@a) {
one-req: 1;
}
.mixin (@a: 1px, @b: 2px) {
two: 2;
}
.mixin (@a, @b, @c) {
three-req: 3;
}
.mixin (@a: 1px, @b: 2px, @c: 3px) {
three: 3;
}
.zero {
.mixin();
}
.one {
.mixin(1);
}
.two {
.mixin(1, 2);
}
.three {
.mixin(1, 2, 3);
}
//
.mixout ('left') {
left: 1;
}
.mixout ('right') {
right: 1;
}
.left {
.mixout('left');
}
.right {
.mixout('right');
}
//
.border (@side, @width) {
color: black;
.border-side(@side, @width);
}
.border-side (left, @w) {
border-left: @w;
}
.border-side (right, @w) {
border-right: @w;
}
.border-right {
.border(right, 4px);
}
.border-left {
.border(left, 4px);
}
//
.border-radius (@r) {
both: @r * 10;
}
.border-radius (@r, left) {
left: @r;
}
.border-radius (@r, right) {
right: @r;
}
.only-right {
.border-radius(33, right);
}
.only-left {
.border-radius(33, left);
}
.left-right {
.border-radius(33);
}

View File

@ -1,47 +0,0 @@
.mixin { border: 1px solid black; }
.mixout { border-color: orange; }
.borders { border-style: dashed; }
#namespace {
.borders {
border-style: dotted;
}
.biohazard {
content: "death";
.man {
color: transparent;
}
}
}
#theme {
> .mixin {
background-color: grey;
}
}
#container {
color: black;
.mixin;
.mixout;
#theme > .mixin;
}
#header {
.milk {
color: white;
.mixin;
#theme > .mixin;
}
#cookie {
.chips {
#namespace .borders;
.calories {
#container;
}
}
.borders;
}
}
.secure-zone { #namespace .biohazard .man; }
.direct {
#namespace > .borders;
}

View File

@ -1,47 +0,0 @@
#operations {
color: #110000 + #000011 + #001100; // #111111
height: 10px / 2px + 6px - 1px * 2; // 9px
width: 2 * 4 - 5em; // 3em
.spacing {
height: 10px / 2px+6px-1px*2;
width: 2 * 4-5em;
}
substraction: 20 - 10 - 5 - 5; // 0
division: 20 / 5 / 4; // 1
}
@x: 4;
@y: 12em;
.with-variables {
height: @x + @y; // 16em
width: 12 + @y; // 24em
size: 5cm - @x; // 1cm
}
.with-functions {
color: rgb(200, 200, 200) / 2;
color: 2 * hsl(0, 50%, 50%);
color: rgb(10, 10, 10) + hsl(0, 50%, 50%);
}
@z: -2;
.negative {
height: 2px + @z; // 0px
width: 2px - @z; // 4px
}
.shorthands {
padding: -1px 2px 0 -4px; //
}
.colors {
color: #123; // #112233
border-color: #234 + #111111; // #334455
background-color: #222222 - #fff; // #000000
.other {
color: 2 * #111; // #222222
border-color: #333333 / 3 + #111; // #222222
}
}

View File

@ -1,26 +0,0 @@
.parens {
@var: 1px;
border: (@var * 2) solid black;
margin: (@var * 1) (@var + 2) (4 * 4) 3;
width: (6 * 6);
padding: 2px (6px * 6px);
}
.more-parens {
@var: (2 * 2);
padding: (2 * @var) 4 4 (@var * 1px);
width: (@var * @var) * 6;
height: (7 * 7) + (8 * 8);
margin: 4 * (5 + 5) / 2 - (@var * 2);
//margin: (6 * 6)px;
}
.nested-parens {
width: 2 * (4 * (2 + (1 + 6))) - 1;
height: ((2+3)*(2+3) / (9-4)) + 1;
}
.mixed-units {
margin: 2px 4em 1 5pc;
padding: (2px + 4px) 1em 2px 2;
}

View File

@ -1,30 +0,0 @@
#first > .one {
> #second .two > #deux {
width: 50%;
#third {
&:focus {
color: black;
#fifth {
> #sixth {
.seventh #eighth {
+ #ninth {
color: purple;
}
}
}
}
}
height: 100%;
}
#fourth, #five, #six {
color: #110000;
.seven, .eight > #nine {
border: 1px solid black;
}
#ten {
color: red;
}
}
}
font-size: 2em;
}

View File

@ -1,32 +0,0 @@
@x: blue;
@z: transparent;
@mix: none;
.mixin {
@mix: #989;
}
.tiny-scope {
color: @mix; // #989
.mixin;
}
.scope1 {
@y: orange;
@z: black;
color: @x; // blue
border-color: @z; // black
.hidden {
@x: #131313;
}
.scope2 {
@y: red;
color: @x; // blue
.scope3 {
@local: white;
color: @y; // red
border-color: @z; // black
background-color: @local; // white
}
}
}

View File

@ -1,24 +0,0 @@
h1, h2, h3 {
a, p {
&:hover {
color: red;
}
}
}
#all { color: blue; }
#the { color: blue; }
#same { color: blue; }
ul, li, div, q, blockquote, textarea {
margin: 0;
}
td {
margin: 0;
padding: 0;
}
td, input {
line-height: 1em;
}

View File

@ -1,16 +0,0 @@
#strings {
background-image: url("http://son-of-a-banana.com");
quotes: "~" "~";
content: "#*%:&^,)!.(~*})";
empty: "";
brackets: "{" "}";
}
#comments {
content: "/* hello */ // not-so-secret";
}
#single-quote {
quotes: "'" "'";
content: '""#!&""';
empty: '';
semi-colon: ';';
}

View File

@ -1,40 +0,0 @@
@a: 2;
@x: @a * @a;
@y: @x + 1;
@z: @x * 2 + @y;
.variables {
width: @z + 1cm; // 14cm
}
@b: @a * 10;
@c: #888;
@fonts: "Trebuchet MS", Verdana, sans-serif;
@f: @fonts;
@quotes: "~" "~";
@q: @quotes;
.variables {
height: @b + @x + 0px; // 24px
color: @c;
font-family: @f;
quotes: @q;
}
.redefinition {
@var: 4;
@var: 2;
@var: 3;
three: @var;
}
.values {
@a: 'Trebuchet';
@multi: 'A', B, C;
font-family: @a, @a, @a;
color: @c !important;
url: url(@a);
multi: something @multi, @a;
}

View File

@ -1,37 +0,0 @@
.whitespace
{ color: white; }
.whitespace
{
color: white;
}
.whitespace
{ color: white; }
.whitespace{color:white;}
.whitespace { color : white ; }
.white,
.space,
.mania
{ color: white; }
.no-semi-column { color: white }
.no-semi-column {
color: white;
white-space: pre
}
.no-semi-column {border: 2px solid white}
.newlines {
background: the,
great,
wall;
border: 2px
solid
black;
}
.empty {
}