├── test ├── expected │ ├── nomatches.css │ ├── cleancss.css │ ├── compress.css │ ├── yuicompress.css │ ├── less.css │ ├── nopaths.css │ ├── individual │ │ ├── style.css │ │ ├── level2 │ │ │ └── style3.css │ │ └── style2.css │ ├── modifyVars.css │ ├── globalVars.css │ ├── individual_flatten │ │ ├── style.css │ │ ├── style3.css │ │ └── style2.css │ ├── variablesAsLess.css │ ├── strip_banners │ │ ├── banner.css │ │ ├── banner2.css │ │ └── banner3.css │ ├── templates-lodash.css │ ├── cleancssReport.css │ ├── yuicompressReport.css │ ├── templates-palette.css │ ├── ieCompatTrue.css │ ├── concat.css │ ├── customFunctions.css │ └── banners │ │ └── banner.css ├── fixtures │ ├── include │ │ ├── variables.less │ │ ├── variablesAsLess.css │ │ └── bob.jpg │ ├── globalVars.less │ ├── style.less │ ├── style3.less │ ├── modifyVars.less │ ├── level2 │ │ └── style3.less │ ├── nopaths.less │ ├── style2.less │ ├── strip_banners │ │ ├── banner2.less │ │ ├── banner.less │ │ └── banner3.less │ ├── templates-lodash.less │ ├── hex.less │ ├── props.less │ ├── variablesAsLess.less │ ├── ieCompat.less │ ├── footer.less │ ├── data │ │ └── palette.yml │ ├── assets.less │ ├── banners │ │ └── banner.less │ ├── customFunctions.less │ ├── merge.less │ ├── templates-palette.less │ ├── metadata.less │ └── bootstrap │ │ ├── breadcrumbs.less │ │ ├── component-animations.less │ │ ├── wells.less │ │ ├── thumbnails.less │ │ ├── close.less │ │ ├── utilities.less │ │ ├── jumbotron.less │ │ ├── media.less │ │ ├── pager.less │ │ ├── badges.less │ │ ├── labels.less │ │ ├── bootstrap.less │ │ ├── code.less │ │ ├── alerts.less │ │ ├── print.less │ │ ├── pagination.less │ │ ├── progress-bars.less │ │ ├── list-group.less │ │ ├── scaffolding.less │ │ ├── grid.less │ │ ├── tooltip.less │ │ ├── modals.less │ │ ├── popovers.less │ │ ├── input-groups.less │ │ ├── buttons.less │ │ ├── panels.less │ │ ├── dropdowns.less │ │ ├── tables.less │ │ ├── carousel.less │ │ ├── responsive-utilities.less │ │ ├── type.less │ │ ├── button-groups.less │ │ ├── navs.less │ │ ├── theme.less │ │ └── normalize.less ├── .lessrc.yml ├── .lessrc └── less_test.js ├── .bowerrc ├── .npmignore ├── AUTHORS ├── .travis.yml ├── CONTRIBUTING.md ├── docs ├── overview.md ├── getting-started.md ├── README.tmpl.md ├── examples.md └── options.md ├── .gitignore ├── .gitattributes ├── .jshintrc ├── vendor └── less-1.3.3 │ ├── lib │ └── less │ │ ├── tree │ │ ├── ratio.js │ │ ├── unicode-descriptor.js │ │ ├── comment.js │ │ ├── paren.js │ │ ├── alpha.js │ │ ├── assignment.js │ │ ├── keyword.js │ │ ├── anonymous.js │ │ ├── value.js │ │ ├── expression.js │ │ ├── url.js │ │ ├── operation.js │ │ ├── variable.js │ │ ├── quoted.js │ │ ├── condition.js │ │ ├── directive.js │ │ ├── selector.js │ │ ├── dimension.js │ │ ├── element.js │ │ ├── rule.js │ │ ├── javascript.js │ │ ├── call.js │ │ ├── import.js │ │ ├── color.js │ │ └── media.js │ │ ├── tree.js │ │ ├── lessc_helper.js │ │ ├── rhino.js │ │ ├── colors.js │ │ └── index.js │ └── package.json ├── tasks └── lib │ ├── comment.js │ └── utils.js ├── LICENSE-MIT ├── CHANGELOG └── package.json /test/expected/nomatches.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "vendor" 3 | } -------------------------------------------------------------------------------- /test/expected/cleancss.css: -------------------------------------------------------------------------------- 1 | body{color:#fff} -------------------------------------------------------------------------------- /test/expected/compress.css: -------------------------------------------------------------------------------- 1 | body{color:#fff} -------------------------------------------------------------------------------- /test/expected/yuicompress.css: -------------------------------------------------------------------------------- 1 | body{color:#fff} -------------------------------------------------------------------------------- /test/fixtures/include/variables.less: -------------------------------------------------------------------------------- 1 | @color: #ffffff; 2 | -------------------------------------------------------------------------------- /test/expected/less.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: #ffffff; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/include/variablesAsLess.css: -------------------------------------------------------------------------------- 1 | @color: #ffffff; 2 | -------------------------------------------------------------------------------- /test/expected/nopaths.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: #ffffff; 3 | } 4 | -------------------------------------------------------------------------------- /test/expected/individual/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: #ffffff; 3 | } 4 | -------------------------------------------------------------------------------- /test/expected/modifyVars.css: -------------------------------------------------------------------------------- 1 | .banner { 2 | content: BOTTOM; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/globalVars.less: -------------------------------------------------------------------------------- 1 | .banner { 2 | content: @content; 3 | } -------------------------------------------------------------------------------- /test/expected/globalVars.css: -------------------------------------------------------------------------------- 1 | .banner { 2 | content: Global Variable!!!; 3 | } 4 | -------------------------------------------------------------------------------- /test/expected/individual/level2/style3.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: #ffffff; 3 | } 4 | -------------------------------------------------------------------------------- /test/expected/individual/style2.css: -------------------------------------------------------------------------------- 1 | #header { 2 | background: #ffffff; 3 | } 4 | -------------------------------------------------------------------------------- /test/expected/individual_flatten/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: #ffffff; 3 | } 4 | -------------------------------------------------------------------------------- /test/expected/individual_flatten/style3.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: #ffffff; 3 | } 4 | -------------------------------------------------------------------------------- /test/expected/variablesAsLess.css: -------------------------------------------------------------------------------- 1 | #header { 2 | background: #ffffff; 3 | } 4 | -------------------------------------------------------------------------------- /test/fixtures/style.less: -------------------------------------------------------------------------------- 1 | @import "variables.less"; 2 | body { 3 | color: @color; 4 | } -------------------------------------------------------------------------------- /test/fixtures/style3.less: -------------------------------------------------------------------------------- 1 | #footer { 2 | color: #377; 3 | background: #233; 4 | } 5 | -------------------------------------------------------------------------------- /test/expected/individual_flatten/style2.css: -------------------------------------------------------------------------------- 1 | #header { 2 | background: #ffffff; 3 | } 4 | -------------------------------------------------------------------------------- /test/expected/strip_banners/banner.css: -------------------------------------------------------------------------------- 1 | /* Comment */ 2 | .nav li { 3 | color: #900; 4 | } 5 | -------------------------------------------------------------------------------- /test/expected/strip_banners/banner2.css: -------------------------------------------------------------------------------- 1 | /*! Don't delete this comment! */ 2 | /* Comment */ 3 | -------------------------------------------------------------------------------- /test/expected/templates-lodash.css: -------------------------------------------------------------------------------- 1 | /*! assemble-less */ 2 | .nav li { 3 | color: #900; 4 | } 5 | -------------------------------------------------------------------------------- /test/fixtures/modifyVars.less: -------------------------------------------------------------------------------- 1 | @content: 'TOP'; 2 | 3 | .banner { 4 | content: @content; 5 | } -------------------------------------------------------------------------------- /test/fixtures/level2/style3.less: -------------------------------------------------------------------------------- 1 | @import "variables.less"; 2 | body { 3 | color: @color; 4 | } 5 | -------------------------------------------------------------------------------- /test/fixtures/nopaths.less: -------------------------------------------------------------------------------- 1 | @import "include/variables.less"; 2 | body { 3 | color: @color; 4 | } 5 | -------------------------------------------------------------------------------- /test/fixtures/style2.less: -------------------------------------------------------------------------------- 1 | @import "variables.less"; 2 | #header { 3 | background: @color; 4 | } 5 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | experimental 2 | node_modules 3 | test 4 | temp 5 | tmp 6 | TODO.md 7 | vendor 8 | *.sublime-* -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Jon Schlinkert (https://github.com/jonschlinkert/) 2 | Brian Woodward (https://github.com/doowb/) -------------------------------------------------------------------------------- /test/expected/cleancssReport.css: -------------------------------------------------------------------------------- 1 | body{color:#fff}#header{background:#fff}#footer{color:#377;background:#233} -------------------------------------------------------------------------------- /test/expected/yuicompressReport.css: -------------------------------------------------------------------------------- 1 | body{color:#fff}#header{background:#fff}#footer{color:#377;background:#233} -------------------------------------------------------------------------------- /test/fixtures/include/bob.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/assemble/assemble-less/master/test/fixtures/include/bob.jpg -------------------------------------------------------------------------------- /test/expected/strip_banners/banner3.css: -------------------------------------------------------------------------------- 1 | /* This is not a banner. */ 2 | /* This isn't a banner 3 | * either 4 | */ 5 | -------------------------------------------------------------------------------- /test/fixtures/strip_banners/banner2.less: -------------------------------------------------------------------------------- 1 | /*! Don't delete this comment! */ 2 | 3 | // Comment 4 | 5 | /* Comment */ 6 | -------------------------------------------------------------------------------- /test/fixtures/templates-lodash.less: -------------------------------------------------------------------------------- 1 | /*! <%= pkg.name %> */ 2 | 3 | .nav { 4 | li { 5 | color: #900; 6 | } 7 | } -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.8" 4 | - "0.10" 5 | before_script: 6 | - npm install -g grunt-cli 7 | -------------------------------------------------------------------------------- /test/fixtures/hex.less: -------------------------------------------------------------------------------- 1 | /** 2 | * Hex to rgba function 3 | */ 4 | 5 | 6 | .button { 7 | background-color: #f8f8f8; 8 | } -------------------------------------------------------------------------------- /test/fixtures/props.less: -------------------------------------------------------------------------------- 1 | 2 | @ele: property; 3 | @prop: color; 4 | @value: #900; 5 | 6 | .@{ele} { 7 | @{prop}: @value; 8 | } -------------------------------------------------------------------------------- /test/fixtures/variablesAsLess.less: -------------------------------------------------------------------------------- 1 | @import (less) "include/variablesAsLess.css"; 2 | #header { 3 | background: @color; 4 | } 5 | -------------------------------------------------------------------------------- /test/expected/templates-palette.css: -------------------------------------------------------------------------------- 1 | .test { 2 | color: #000000; 3 | color: #111111; 4 | color: #222222; 5 | color: #333333; 6 | } 7 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Please see the [Contributing to Assemble](http://assemble.io/contributing) guide for information on contributing to this project. 2 | -------------------------------------------------------------------------------- /docs/overview.md: -------------------------------------------------------------------------------- 1 | Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide. -------------------------------------------------------------------------------- /test/expected/ieCompatTrue.css: -------------------------------------------------------------------------------- 1 | body { 2 | width: 288px; 3 | height: 288px; 4 | background: transparent url('include/bob.jpg') 0 0 no-repeat; 5 | } 6 | -------------------------------------------------------------------------------- /test/fixtures/ieCompat.less: -------------------------------------------------------------------------------- 1 | body { 2 | width: 288px; 3 | height: 288px; 4 | background: transparent data-uri('include/bob.jpg') 0 0 no-repeat; 5 | } 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | 3 | experimental 4 | node_modules 5 | test/actual 6 | temp 7 | tmp 8 | vendor 9 | 10 | 11 | TODO.md 12 | npm-debug.log 13 | *.sublime-* 14 | *.zip 15 | *.rar -------------------------------------------------------------------------------- /test/expected/concat.css: -------------------------------------------------------------------------------- 1 | body { 2 | color: #ffffff; 3 | } 4 | 5 | #header { 6 | background: #ffffff; 7 | } 8 | 9 | #footer { 10 | color: #377; 11 | background: #233; 12 | } 13 | -------------------------------------------------------------------------------- /test/fixtures/footer.less: -------------------------------------------------------------------------------- 1 | /* THIS 2 | * IS 3 | * A 4 | * SAMPLE 5 | * BANNER! 6 | */ 7 | @import "include/variables.less"; 8 | .nav { 9 | li { 10 | color: @color; 11 | } 12 | } -------------------------------------------------------------------------------- /test/fixtures/data/palette.yml: -------------------------------------------------------------------------------- 1 | ### 2 | # Palette 3 | ### 4 | 5 | 6 | info: '#000' 7 | warning: '#111' 8 | danger: '#222' 9 | success: '#333' 10 | 11 | one: 'success' 12 | two: 'success' -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set default behaviour, in case users don't have core.autocrlf set. 2 | *.* text=lf 3 | *.* text eol=lf 4 | *.* eol=lf 5 | 6 | *.jpg binary 7 | *.gif binary 8 | *.png binary 9 | *.jpeg binary -------------------------------------------------------------------------------- /test/fixtures/strip_banners/banner.less: -------------------------------------------------------------------------------- 1 | /* THIS 2 | * IS 3 | * A 4 | * SAMPLE 5 | * BANNER! 6 | */ 7 | 8 | // Comment 9 | 10 | /* Comment */ 11 | 12 | .nav { 13 | li { 14 | color: #900; 15 | } 16 | } -------------------------------------------------------------------------------- /test/fixtures/strip_banners/banner3.less: -------------------------------------------------------------------------------- 1 | 2 | // This is 3 | // A sample 4 | // Banner 5 | /* This is not a banner. */ 6 | 7 | // This is not a banner. 8 | 9 | /* This isn't a banner 10 | * either 11 | */ 12 | -------------------------------------------------------------------------------- /test/fixtures/assets.less: -------------------------------------------------------------------------------- 1 | @assets: assets(); 2 | 3 | 4 | .d() {color: blue} 5 | .d() {width: 10px} 6 | 7 | 8 | .image { 9 | .d(); 10 | background: transparent url('@{assets}/img/bar.jpg') 0 0 no-repeat; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /test/.lessrc.yml: -------------------------------------------------------------------------------- 1 | ### 2 | # LESS config 3 | ### 4 | 5 | # Search paths, when importing 6 | paths: 7 | - test/fixtures/bootstrap 8 | - test/fixtures/include 9 | 10 | imports: 11 | less: 12 | - mixins.less 13 | - variables.less -------------------------------------------------------------------------------- /test/fixtures/banners/banner.less: -------------------------------------------------------------------------------- 1 | /* THIS 2 | * IS 3 | * A 4 | * SAMPLE 5 | * BANNER! 6 | */ 7 | 8 | // Comment 9 | 10 | /* Comment */ 11 | 12 | .nav { 13 | li { 14 | color: #900; 15 | content: "Yeah Banners!"; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "curly": true, 3 | "eqeqeq": true, 4 | "immed": true, 5 | "latedef": true, 6 | "newcap": true, 7 | "noarg": true, 8 | "sub": true, 9 | "undef": true, 10 | "boss": true, 11 | "eqnull": true, 12 | "node": true 13 | } -------------------------------------------------------------------------------- /test/expected/customFunctions.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Metadata test 3 | */ 4 | .myRule { 5 | background-image: url("test/assets/foo/img/js.jpg"); 6 | background-color: rgba(248,248,248,1); 7 | background-color: #ff0000; 8 | width: 5px; 9 | background: "Hello"; 10 | } 11 | -------------------------------------------------------------------------------- /test/expected/banners/banner.css: -------------------------------------------------------------------------------- 1 | /* 2 | * assemble-less 3 | * http://assemble.io 4 | * 5 | * Copyright (c) 2014, Jon Schlinkert 6 | * Licensed under the MIT License. 7 | * 8 | */ 9 | /* Comment */ 10 | .nav li { 11 | color: #900; 12 | content: "Yeah Banners!"; 13 | } 14 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/ratio.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.Ratio = function (value) { 4 | this.value = value; 5 | }; 6 | tree.Ratio.prototype = { 7 | toCSS: function (env) { 8 | return this.value; 9 | }, 10 | eval: function () { return this } 11 | }; 12 | 13 | })(require('../tree')); 14 | -------------------------------------------------------------------------------- /test/.lessrc: -------------------------------------------------------------------------------- 1 | { 2 | "metadata": ["test/fixtures/data/*.{yml,json}"], 3 | "paths": [ 4 | "test/fixtures/booststrap", 5 | "test/fixtures/include" 6 | ], 7 | "imports": { 8 | "reference": [ 9 | "mixins.less", 10 | "variables.less", 11 | "modal.less", 12 | "navbar.less" 13 | ] 14 | } 15 | } -------------------------------------------------------------------------------- /test/fixtures/customFunctions.less: -------------------------------------------------------------------------------- 1 | /** 2 | * Metadata test 3 | */ 4 | 5 | @assets: assets(); 6 | 7 | 8 | .myRule { 9 | background-image: url("@{assets}/img/js.jpg"); 10 | background-color: to-rgba(#f8f8f8); 11 | background-color: to-hex(255,0,0); 12 | width: multiple-args(1px, 4px); 13 | background: string-result(3); 14 | } 15 | -------------------------------------------------------------------------------- /test/fixtures/merge.less: -------------------------------------------------------------------------------- 1 | 2 | .black-box-1() { 3 | transform+: rotate(45deg); 4 | } 5 | .black-box-2() { 6 | transform+: scale(1.2); 7 | } 8 | .my-element { 9 | .black-box-1(); 10 | .black-box-2(); 11 | } 12 | 13 | 14 | .foo { 15 | box-shadow+: inset 0 0 10px #555; 16 | } 17 | .bar { 18 | .foo; 19 | box-shadow+: 0 0 20px black; 20 | } -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/unicode-descriptor.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.UnicodeDescriptor = function (value) { 4 | this.value = value; 5 | }; 6 | tree.UnicodeDescriptor.prototype = { 7 | toCSS: function (env) { 8 | return this.value; 9 | }, 10 | eval: function () { return this } 11 | }; 12 | 13 | })(require('../tree')); 14 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/comment.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.Comment = function (value, silent) { 4 | this.value = value; 5 | this.silent = !!silent; 6 | }; 7 | tree.Comment.prototype = { 8 | toCSS: function (env) { 9 | return env.compress ? '' : this.value; 10 | }, 11 | eval: function () { return this } 12 | }; 13 | 14 | })(require('../tree')); 15 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/paren.js: -------------------------------------------------------------------------------- 1 | 2 | (function (tree) { 3 | 4 | tree.Paren = function (node) { 5 | this.value = node; 6 | }; 7 | tree.Paren.prototype = { 8 | toCSS: function (env) { 9 | return '(' + this.value.toCSS(env) + ')'; 10 | }, 11 | eval: function (env) { 12 | return new(tree.Paren)(this.value.eval(env)); 13 | } 14 | }; 15 | 16 | })(require('../tree')); 17 | -------------------------------------------------------------------------------- /test/fixtures/templates-palette.less: -------------------------------------------------------------------------------- 1 | // 2 | // Palette 3 | // -------------------------------------------------- 4 | 5 | @palette-info: <%= palette.info %>; 6 | @palette-warning: <%= palette.warning %>; 7 | @palette-danger: <%= palette.danger %>; 8 | @palette-success: <%= palette.success %>; 9 | 10 | .test { 11 | color: @palette-info; 12 | color: @palette-warning; 13 | color: @palette-danger; 14 | color: @palette-success; 15 | } -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/alpha.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.Alpha = function (val) { 4 | this.value = val; 5 | }; 6 | tree.Alpha.prototype = { 7 | toCSS: function () { 8 | return "alpha(opacity=" + 9 | (this.value.toCSS ? this.value.toCSS() : this.value) + ")"; 10 | }, 11 | eval: function (env) { 12 | if (this.value.eval) { this.value = this.value.eval(env) } 13 | return this; 14 | } 15 | }; 16 | 17 | })(require('../tree')); 18 | -------------------------------------------------------------------------------- /test/fixtures/metadata.less: -------------------------------------------------------------------------------- 1 | /** 2 | * <%= theme.name %> 3 | * <%= theme.description %> 4 | */ 5 | 6 | 7 | // Variables 8 | @path: '<%= assets %>'; 9 | 10 | 11 | // Component 12 | .<%= foo %>:extend(.<%= bar %> all) { 13 | background-image: url("@{path}/img/js.jpg"); 14 | color: <%= palette.info %>; 15 | } 16 | 17 | 18 | .metadata { 19 | a: '<%= foo %>'; 20 | b: '<%= bar %>'; 21 | c: <%= palette.info %>; 22 | d: '<%= pkg.name %>'; 23 | e: '<%= package.name %>'; 24 | f: '<%= theme.name %>'; 25 | g: '<%= theme.description %>'; 26 | } -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/assignment.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.Assignment = function (key, val) { 4 | this.key = key; 5 | this.value = val; 6 | }; 7 | tree.Assignment.prototype = { 8 | toCSS: function () { 9 | return this.key + '=' + (this.value.toCSS ? this.value.toCSS() : this.value); 10 | }, 11 | eval: function (env) { 12 | if (this.value.eval) { 13 | return new(tree.Assignment)(this.key, this.value.eval(env)); 14 | } 15 | return this; 16 | } 17 | }; 18 | 19 | })(require('../tree')); -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/keyword.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.Keyword = function (value) { this.value = value }; 4 | tree.Keyword.prototype = { 5 | eval: function () { return this }, 6 | toCSS: function () { return this.value }, 7 | compare: function (other) { 8 | if (other instanceof tree.Keyword) { 9 | return other.value === this.value ? 0 : 1; 10 | } else { 11 | return -1; 12 | } 13 | } 14 | }; 15 | 16 | tree.True = new(tree.Keyword)('true'); 17 | tree.False = new(tree.Keyword)('false'); 18 | 19 | })(require('../tree')); 20 | -------------------------------------------------------------------------------- /docs/getting-started.md: -------------------------------------------------------------------------------- 1 | This plugin requires Grunt `~0.4.2` 2 | 3 | If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command: 4 | 5 | ```shell 6 | npm install assemble-less --save-dev 7 | ``` 8 | 9 | Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript: 10 | 11 | ```js 12 | grunt.loadNpmTasks('assemble-less'); 13 | ``` -------------------------------------------------------------------------------- /test/fixtures/bootstrap/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: 8px 15px; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | > li { 13 | display: inline-block; 14 | + li:before { 15 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 16 | padding: 0 5px; 17 | color: @breadcrumb-color; 18 | } 19 | } 20 | > .active { 21 | color: @breadcrumb-active-color; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /test/fixtures/bootstrap/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twitter/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | &.in { 21 | display: block; 22 | } 23 | } 24 | .collapsing { 25 | position: relative; 26 | height: 0; 27 | overflow: hidden; 28 | .transition(height .35s ease); 29 | } 30 | -------------------------------------------------------------------------------- /test/fixtures/bootstrap/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid darken(@well-bg, 7%); 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/anonymous.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.Anonymous = function (string) { 4 | this.value = string.value || string; 5 | }; 6 | tree.Anonymous.prototype = { 7 | toCSS: function () { 8 | return this.value; 9 | }, 10 | eval: function () { return this }, 11 | compare: function (x) { 12 | if (!x.toCSS) { 13 | return -1; 14 | } 15 | 16 | var left = this.toCSS(), 17 | right = x.toCSS(); 18 | 19 | if (left === right) { 20 | return 0; 21 | } 22 | 23 | return left < right ? -1 : 1; 24 | } 25 | }; 26 | 27 | })(require('../tree')); 28 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/value.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.Value = function (value) { 4 | this.value = value; 5 | this.is = 'value'; 6 | }; 7 | tree.Value.prototype = { 8 | eval: function (env) { 9 | if (this.value.length === 1) { 10 | return this.value[0].eval(env); 11 | } else { 12 | return new(tree.Value)(this.value.map(function (v) { 13 | return v.eval(env); 14 | })); 15 | } 16 | }, 17 | toCSS: function (env) { 18 | return this.value.map(function (e) { 19 | return e.toCSS(env); 20 | }).join(env.compress ? ',' : ', '); 21 | } 22 | }; 23 | 24 | })(require('../tree')); 25 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/expression.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.Expression = function (value) { this.value = value }; 4 | tree.Expression.prototype = { 5 | eval: function (env) { 6 | if (this.value.length > 1) { 7 | return new(tree.Expression)(this.value.map(function (e) { 8 | return e.eval(env); 9 | })); 10 | } else if (this.value.length === 1) { 11 | return this.value[0].eval(env); 12 | } else { 13 | return this; 14 | } 15 | }, 16 | toCSS: function (env) { 17 | return this.value.map(function (e) { 18 | return e.toCSS ? e.toCSS(env) : ''; 19 | }).join(' '); 20 | } 21 | }; 22 | 23 | })(require('../tree')); 24 | -------------------------------------------------------------------------------- /test/fixtures/bootstrap/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | .img-thumbnail(); 9 | display: block; // Override the inline-block from `.img-thumbnail` 10 | margin-bottom: @line-height-computed; 11 | 12 | > img { 13 | .img-responsive(); 14 | margin-left: auto; 15 | margin-right: auto; 16 | } 17 | } 18 | 19 | 20 | // Add a hover state for linked versions only 21 | a.thumbnail:hover, 22 | a.thumbnail:focus, 23 | a.thumbnail.active { 24 | border-color: @link-color; 25 | } 26 | 27 | // Image captions 28 | .thumbnail .caption { 29 | padding: @thumbnail-caption-padding; 30 | color: @thumbnail-caption-color; 31 | } 32 | -------------------------------------------------------------------------------- /test/fixtures/bootstrap/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | button& { 27 | padding: 0; 28 | cursor: pointer; 29 | background: transparent; 30 | border: 0; 31 | -webkit-appearance: none; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/url.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.URL = function (val, rootpath) { 4 | this.value = val; 5 | this.rootpath = rootpath; 6 | }; 7 | tree.URL.prototype = { 8 | toCSS: function () { 9 | return "url(" + this.value.toCSS() + ")"; 10 | }, 11 | eval: function (ctx) { 12 | var val = this.value.eval(ctx), rootpath; 13 | 14 | // Add the base path if the URL is relative 15 | if (typeof val.value === "string" && !/^(?:[a-z-]+:|\/)/.test(val.value)) { 16 | rootpath = this.rootpath; 17 | if (!val.quote) { 18 | rootpath = rootpath.replace(/[\(\)'"\s]/g, function(match) { return "\\"+match; }); 19 | } 20 | val.value = rootpath + val.value; 21 | } 22 | 23 | return new(tree.URL)(val, this.rootpath); 24 | } 25 | }; 26 | 27 | })(require('../tree')); 28 | -------------------------------------------------------------------------------- /tasks/lib/comment.js: -------------------------------------------------------------------------------- 1 | /* 2 | * From grunt-contrib-concat 3 | * http://gruntjs.com/ 4 | * 5 | * Copyright (c) 2012 "Cowboy" Ben Alman, contributors 6 | * Licensed under the MIT license. 7 | */ 8 | 9 | 'use strict'; 10 | 11 | exports.init = function(/*grunt*/) { 12 | var exports = {}; 13 | 14 | // Return the given source code with any leading banner comment stripped. 15 | exports.stripBanner = function(src, options) { 16 | options = options || {}; 17 | var m = []; 18 | if (options.line) { 19 | // Strip // ... leading banners. 20 | m.push('(?:.*\\/\\/.*\\r?\\n?)*\\s*'); 21 | } 22 | if (options.block) { 23 | // Strips all /* ... */ block comment banners. 24 | m.push('\\/\\*[\\s\\S]*?\\*\\/'); 25 | } else { 26 | // Strips only /* ... */ block comment banners, excluding /*! ... */. 27 | m.push('\\/\\*[^!][\\s\\S]*?\\*\\/'); 28 | } 29 | var re = new RegExp('^\\s*(?:' + m.join('|') + ')\\s*', ''); 30 | return src.replace(re, ''); 31 | }; 32 | 33 | return exports; 34 | }; -------------------------------------------------------------------------------- /test/fixtures/bootstrap/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | visibility: hidden !important; 48 | } 49 | 50 | 51 | // For Affix plugin 52 | // ------------------------- 53 | 54 | .affix { 55 | position: fixed; 56 | } 57 | -------------------------------------------------------------------------------- /test/fixtures/bootstrap/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding: @jumbotron-padding; 8 | margin-bottom: @jumbotron-padding; 9 | font-size: @jumbotron-font-size; 10 | font-weight: 200; 11 | line-height: (@line-height-base * 1.5); 12 | color: @jumbotron-color; 13 | background-color: @jumbotron-bg; 14 | 15 | h1 { 16 | line-height: 1; 17 | color: @jumbotron-heading-color; 18 | } 19 | p { 20 | line-height: 1.4; 21 | } 22 | 23 | .container & { 24 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 25 | } 26 | 27 | @media screen and (min-width: @screen-sm-min) { 28 | padding-top: (@jumbotron-padding * 1.6); 29 | padding-bottom: (@jumbotron-padding * 1.6); 30 | 31 | .container & { 32 | padding-left: (@jumbotron-padding * 2); 33 | padding-right: (@jumbotron-padding * 2); 34 | } 35 | 36 | h1 { 37 | font-size: (@font-size-base * 4.5); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /test/fixtures/bootstrap/media.less: -------------------------------------------------------------------------------- 1 | // Media objects 2 | // Source: http://stubbornella.org/content/?p=497 3 | // -------------------------------------------------- 4 | 5 | 6 | // Common styles 7 | // ------------------------- 8 | 9 | // Clear the floats 10 | .media, 11 | .media-body { 12 | overflow: hidden; 13 | zoom: 1; 14 | } 15 | 16 | // Proper spacing between instances of .media 17 | .media, 18 | .media .media { 19 | margin-top: 15px; 20 | } 21 | .media:first-child { 22 | margin-top: 0; 23 | } 24 | 25 | // For images and videos, set to block 26 | .media-object { 27 | display: block; 28 | } 29 | 30 | // Reset margins on headings for tighter default spacing 31 | .media-heading { 32 | margin: 0 0 5px; 33 | } 34 | 35 | 36 | // Media image alignment 37 | // ------------------------- 38 | 39 | .media { 40 | > .pull-left { 41 | margin-right: 10px; 42 | } 43 | > .pull-right { 44 | margin-left: 10px; 45 | } 46 | } 47 | 48 | 49 | // Media list variation 50 | // ------------------------- 51 | 52 | // Undo default ul/ol styles 53 | .media-list { 54 | padding-left: 0; 55 | list-style: none; 56 | } 57 | -------------------------------------------------------------------------------- /test/fixtures/bootstrap/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | .clearfix(); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pagination-bg; 19 | border: 1px solid @pagination-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pagination-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pagination-bg; 51 | cursor: not-allowed; 52 | } 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Tyler Kellen, contributors 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/operation.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.Operation = function (op, operands) { 4 | this.op = op.trim(); 5 | this.operands = operands; 6 | }; 7 | tree.Operation.prototype.eval = function (env) { 8 | var a = this.operands[0].eval(env), 9 | b = this.operands[1].eval(env), 10 | temp; 11 | 12 | if (a instanceof tree.Dimension && b instanceof tree.Color) { 13 | if (this.op === '*' || this.op === '+') { 14 | temp = b, b = a, a = temp; 15 | } else { 16 | throw { name: "OperationError", 17 | message: "Can't substract or divide a color from a number" }; 18 | } 19 | } 20 | if (!a.operate) { 21 | throw { name: "OperationError", 22 | message: "Operation on an invalid type" }; 23 | } 24 | 25 | return a.operate(this.op, b); 26 | }; 27 | 28 | tree.operate = function (op, a, b) { 29 | switch (op) { 30 | case '+': return a + b; 31 | case '-': return a - b; 32 | case '*': return a * b; 33 | case '/': return a / b; 34 | } 35 | }; 36 | 37 | })(require('../tree')); 38 | -------------------------------------------------------------------------------- /test/fixtures/bootstrap/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base classes 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | } 26 | 27 | // Hover state, but only for links 28 | a.badge { 29 | &:hover, 30 | &:focus { 31 | color: @badge-link-hover-color; 32 | text-decoration: none; 33 | cursor: pointer; 34 | } 35 | } 36 | 37 | // Quick fix for labels/badges in buttons 38 | .btn .badge { 39 | position: relative; 40 | top: -1px; 41 | } 42 | 43 | // Account for counters in navs 44 | a.list-group-item.active > .badge, 45 | .nav-pills > .active > a > .badge { 46 | color: @badge-active-color; 47 | background-color: @badge-active-bg; 48 | } 49 | .nav-pills > li > a > .badge { 50 | margin-left: 3px; 51 | } 52 | -------------------------------------------------------------------------------- /test/fixtures/bootstrap/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | &[href] { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | } 32 | 33 | // Colors 34 | // Contextual variations (linked labels get darker on :hover) 35 | 36 | .label-default { 37 | .label-variant(@label-default-bg); 38 | } 39 | 40 | .label-primary { 41 | .label-variant(@label-primary-bg); 42 | } 43 | 44 | .label-success { 45 | .label-variant(@label-success-bg); 46 | } 47 | 48 | .label-info { 49 | .label-variant(@label-info-bg); 50 | } 51 | 52 | .label-warning { 53 | .label-variant(@label-warning-bg); 54 | } 55 | 56 | .label-danger { 57 | .label-variant(@label-danger-bg); 58 | } 59 | -------------------------------------------------------------------------------- /test/fixtures/bootstrap/bootstrap.less: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "variables.less"; 3 | @import "mixins.less"; 4 | 5 | // Reset 6 | @import "normalize.less"; 7 | @import "print.less"; 8 | 9 | // Core CSS 10 | @import "scaffolding.less"; 11 | @import "type.less"; 12 | @import "code.less"; 13 | @import "grid.less"; 14 | @import "tables.less"; 15 | @import "forms.less"; 16 | @import "buttons.less"; 17 | 18 | // Components 19 | @import "component-animations.less"; 20 | @import "glyphicons.less"; 21 | @import "dropdowns.less"; 22 | @import "button-groups.less"; 23 | @import "input-groups.less"; 24 | @import "navs.less"; 25 | @import "navbar.less"; 26 | @import "breadcrumbs.less"; 27 | @import "pagination.less"; 28 | @import "pager.less"; 29 | @import "labels.less"; 30 | @import "badges.less"; 31 | @import "jumbotron.less"; 32 | @import "thumbnails.less"; 33 | @import "alerts.less"; 34 | @import "progress-bars.less"; 35 | @import "media.less"; 36 | @import "list-group.less"; 37 | @import "panels.less"; 38 | @import "wells.less"; 39 | @import "close.less"; 40 | 41 | // Components w/ JavaScript 42 | @import "modals.less"; 43 | @import "tooltip.less"; 44 | @import "popovers.less"; 45 | @import "carousel.less"; 46 | 47 | // Utility classes 48 | @import "utilities.less"; 49 | @import "responsive-utilities.less"; 50 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/variable.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.Variable = function (name, index, file) { this.name = name, this.index = index, this.file = file }; 4 | tree.Variable.prototype = { 5 | eval: function (env) { 6 | var variable, v, name = this.name; 7 | 8 | if (name.indexOf('@@') == 0) { 9 | name = '@' + new(tree.Variable)(name.slice(1)).eval(env).value; 10 | } 11 | 12 | if (this.evaluating) { 13 | throw { type: 'Name', 14 | message: "Recursive variable definition for " + name, 15 | filename: this.file, 16 | index: this.index }; 17 | } 18 | 19 | this.evaluating = true; 20 | 21 | if (variable = tree.find(env.frames, function (frame) { 22 | if (v = frame.variable(name)) { 23 | return v.value.eval(env); 24 | } 25 | })) { 26 | this.evaluating = false; 27 | return variable; 28 | } 29 | else { 30 | throw { type: 'Name', 31 | message: "variable " + name + " is undefined", 32 | filename: this.file, 33 | index: this.index }; 34 | } 35 | } 36 | }; 37 | 38 | })(require('../tree')); 39 | -------------------------------------------------------------------------------- /test/fixtures/bootstrap/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | white-space: nowrap; 21 | border-radius: @border-radius-base; 22 | } 23 | 24 | // Blocks of code 25 | pre { 26 | display: block; 27 | padding: ((@line-height-computed - 1) / 2); 28 | margin: 0 0 (@line-height-computed / 2); 29 | font-size: (@font-size-base - 1); // 14px to 13px 30 | line-height: @line-height-base; 31 | word-break: break-all; 32 | word-wrap: break-word; 33 | color: @pre-color; 34 | background-color: @pre-bg; 35 | border: 1px solid @pre-border-color; 36 | border-radius: @border-radius-base; 37 | 38 | // Account for some code outputs that place code tags in pre tags 39 | code { 40 | padding: 0; 41 | font-size: inherit; 42 | color: inherit; 43 | white-space: pre-wrap; 44 | background-color: transparent; 45 | border-radius: 0; 46 | } 47 | } 48 | 49 | // Enable scrollable blocks of code 50 | .pre-scrollable { 51 | max-height: @pre-scrollable-max-height; 52 | overflow-y: scroll; 53 | } 54 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/quoted.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.Quoted = function (str, content, escaped, i) { 4 | this.escaped = escaped; 5 | this.value = content || ''; 6 | this.quote = str.charAt(0); 7 | this.index = i; 8 | }; 9 | tree.Quoted.prototype = { 10 | toCSS: function () { 11 | if (this.escaped) { 12 | return this.value; 13 | } else { 14 | return this.quote + this.value + this.quote; 15 | } 16 | }, 17 | eval: function (env) { 18 | var that = this; 19 | var value = this.value.replace(/`([^`]+)`/g, function (_, exp) { 20 | return new(tree.JavaScript)(exp, that.index, true).eval(env).value; 21 | }).replace(/@\{([\w-]+)\}/g, function (_, name) { 22 | var v = new(tree.Variable)('@' + name, that.index).eval(env); 23 | return (v instanceof tree.Quoted) ? v.value : v.toCSS(); 24 | }); 25 | return new(tree.Quoted)(this.quote + value + this.quote, value, this.escaped, this.index); 26 | }, 27 | compare: function (x) { 28 | if (!x.toCSS) { 29 | return -1; 30 | } 31 | 32 | var left = this.toCSS(), 33 | right = x.toCSS(); 34 | 35 | if (left === right) { 36 | return 0; 37 | } 38 | 39 | return left < right ? -1 : 1; 40 | } 41 | }; 42 | 43 | })(require('../tree')); 44 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/condition.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.Condition = function (op, l, r, i, negate) { 4 | this.op = op.trim(); 5 | this.lvalue = l; 6 | this.rvalue = r; 7 | this.index = i; 8 | this.negate = negate; 9 | }; 10 | tree.Condition.prototype.eval = function (env) { 11 | var a = this.lvalue.eval(env), 12 | b = this.rvalue.eval(env); 13 | 14 | var i = this.index, result; 15 | 16 | var result = (function (op) { 17 | switch (op) { 18 | case 'and': 19 | return a && b; 20 | case 'or': 21 | return a || b; 22 | default: 23 | if (a.compare) { 24 | result = a.compare(b); 25 | } else if (b.compare) { 26 | result = b.compare(a); 27 | } else { 28 | throw { type: "Type", 29 | message: "Unable to perform comparison", 30 | index: i }; 31 | } 32 | switch (result) { 33 | case -1: return op === '<' || op === '=<'; 34 | case 0: return op === '=' || op === '>=' || op === '=<'; 35 | case 1: return op === '>' || op === '>='; 36 | } 37 | } 38 | })(this.op); 39 | return this.negate ? !result : result; 40 | }; 41 | 42 | })(require('../tree')); 43 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/directive.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.Directive = function (name, value) { 4 | this.name = name; 5 | 6 | if (Array.isArray(value)) { 7 | this.ruleset = new(tree.Ruleset)([], value); 8 | this.ruleset.allowImports = true; 9 | } else { 10 | this.value = value; 11 | } 12 | }; 13 | tree.Directive.prototype = { 14 | toCSS: function (ctx, env) { 15 | if (this.ruleset) { 16 | this.ruleset.root = true; 17 | return this.name + (env.compress ? '{' : ' {\n ') + 18 | this.ruleset.toCSS(ctx, env).trim().replace(/\n/g, '\n ') + 19 | (env.compress ? '}': '\n}\n'); 20 | } else { 21 | return this.name + ' ' + this.value.toCSS() + ';\n'; 22 | } 23 | }, 24 | eval: function (env) { 25 | var evaldDirective = this; 26 | if (this.ruleset) { 27 | env.frames.unshift(this); 28 | evaldDirective = new(tree.Directive)(this.name); 29 | evaldDirective.ruleset = this.ruleset.eval(env); 30 | env.frames.shift(); 31 | } 32 | return evaldDirective; 33 | }, 34 | variable: function (name) { return tree.Ruleset.prototype.variable.call(this.ruleset, name) }, 35 | find: function () { return tree.Ruleset.prototype.find.apply(this.ruleset, arguments) }, 36 | rulesets: function () { return tree.Ruleset.prototype.rulesets.apply(this.ruleset) } 37 | }; 38 | 39 | })(require('../tree')); 40 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/selector.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.Selector = function (elements) { 4 | this.elements = elements; 5 | }; 6 | tree.Selector.prototype.match = function (other) { 7 | var elements = this.elements, 8 | len = elements.length, 9 | oelements, olen, max, i; 10 | 11 | oelements = other.elements.slice( 12 | (other.elements.length && other.elements[0].value === "&") ? 1 : 0); 13 | olen = oelements.length; 14 | max = Math.min(len, olen) 15 | 16 | if (olen === 0 || len < olen) { 17 | return false; 18 | } else { 19 | for (i = 0; i < max; i++) { 20 | if (elements[i].value !== oelements[i].value) { 21 | return false; 22 | } 23 | } 24 | } 25 | return true; 26 | }; 27 | tree.Selector.prototype.eval = function (env) { 28 | return new(tree.Selector)(this.elements.map(function (e) { 29 | return e.eval(env); 30 | })); 31 | }; 32 | tree.Selector.prototype.toCSS = function (env) { 33 | if (this._css) { return this._css } 34 | 35 | if (this.elements[0].combinator.value === "") { 36 | this._css = ' '; 37 | } else { 38 | this._css = ''; 39 | } 40 | 41 | this._css += this.elements.map(function (e) { 42 | if (typeof(e) === 'string') { 43 | return ' ' + e.trim(); 44 | } else { 45 | return e.toCSS(env); 46 | } 47 | }).join(''); 48 | 49 | return this._css; 50 | }; 51 | 52 | })(require('../tree')); 53 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.debugInfo = function(env, ctx) { 4 | var result=""; 5 | if (env.dumpLineNumbers && !env.compress) { 6 | switch(env.dumpLineNumbers) { 7 | case 'comments': 8 | result = tree.debugInfo.asComment(ctx); 9 | break; 10 | case 'mediaquery': 11 | result = tree.debugInfo.asMediaQuery(ctx); 12 | break; 13 | case 'all': 14 | result = tree.debugInfo.asComment(ctx)+tree.debugInfo.asMediaQuery(ctx); 15 | break; 16 | } 17 | } 18 | return result; 19 | }; 20 | 21 | tree.debugInfo.asComment = function(ctx) { 22 | return '/* line ' + ctx.debugInfo.lineNumber + ', ' + ctx.debugInfo.fileName + ' */\n'; 23 | }; 24 | 25 | tree.debugInfo.asMediaQuery = function(ctx) { 26 | return '@media -sass-debug-info{filename{font-family:' + 27 | ('file://' + ctx.debugInfo.fileName).replace(/[\/:.]/g, '\\$&') + 28 | '}line{font-family:\\00003' + ctx.debugInfo.lineNumber + '}}\n'; 29 | }; 30 | 31 | tree.find = function (obj, fun) { 32 | for (var i = 0, r; i < obj.length; i++) { 33 | if (r = fun.call(obj, obj[i])) { return r } 34 | } 35 | return null; 36 | }; 37 | tree.jsify = function (obj) { 38 | if (Array.isArray(obj.value) && (obj.value.length > 1)) { 39 | return '[' + obj.value.map(function (v) { return v.toCSS(false) }).join(', ') + ']'; 40 | } else { 41 | return obj.toCSS(false); 42 | } 43 | }; 44 | 45 | })(require('./tree')); 46 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/dimension.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | // 4 | // A number with a unit 5 | // 6 | tree.Dimension = function (value, unit) { 7 | this.value = parseFloat(value); 8 | this.unit = unit || null; 9 | }; 10 | 11 | tree.Dimension.prototype = { 12 | eval: function () { return this }, 13 | toColor: function () { 14 | return new(tree.Color)([this.value, this.value, this.value]); 15 | }, 16 | toCSS: function () { 17 | var css = this.value + this.unit; 18 | return css; 19 | }, 20 | 21 | // In an operation between two Dimensions, 22 | // we default to the first Dimension's unit, 23 | // so `1px + 2em` will yield `3px`. 24 | // In the future, we could implement some unit 25 | // conversions such that `100cm + 10mm` would yield 26 | // `101cm`. 27 | operate: function (op, other) { 28 | return new(tree.Dimension) 29 | (tree.operate(op, this.value, other.value), 30 | this.unit || other.unit); 31 | }, 32 | 33 | compare: function (other) { 34 | if (other instanceof tree.Dimension) { 35 | if (other.value > this.value) { 36 | return -1; 37 | } else if (other.value < this.value) { 38 | return 1; 39 | } else { 40 | if (other.unit && this.unit !== other.unit) { 41 | return -1; 42 | } 43 | return 0; 44 | } 45 | } else { 46 | return -1; 47 | } 48 | } 49 | }; 50 | 51 | })(require('../tree')); 52 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/element.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.Element = function (combinator, value, index) { 4 | this.combinator = combinator instanceof tree.Combinator ? 5 | combinator : new(tree.Combinator)(combinator); 6 | 7 | if (typeof(value) === 'string') { 8 | this.value = value.trim(); 9 | } else if (value) { 10 | this.value = value; 11 | } else { 12 | this.value = ""; 13 | } 14 | this.index = index; 15 | }; 16 | tree.Element.prototype.eval = function (env) { 17 | return new(tree.Element)(this.combinator, 18 | this.value.eval ? this.value.eval(env) : this.value, 19 | this.index); 20 | }; 21 | tree.Element.prototype.toCSS = function (env) { 22 | var value = (this.value.toCSS ? this.value.toCSS(env) : this.value); 23 | if (value == '' && this.combinator.value.charAt(0) == '&') { 24 | return ''; 25 | } else { 26 | return this.combinator.toCSS(env || {}) + value; 27 | } 28 | }; 29 | 30 | tree.Combinator = function (value) { 31 | if (value === ' ') { 32 | this.value = ' '; 33 | } else { 34 | this.value = value ? value.trim() : ""; 35 | } 36 | }; 37 | tree.Combinator.prototype.toCSS = function (env) { 38 | return { 39 | '' : '', 40 | ' ' : ' ', 41 | ':' : ' :', 42 | '+' : env.compress ? '+' : ' + ', 43 | '~' : env.compress ? '~' : ' ~ ', 44 | '>' : env.compress ? '>' : ' > ', 45 | '|' : env.compress ? '|' : ' | ' 46 | }[this.value]; 47 | }; 48 | 49 | })(require('../tree')); 50 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "less", 3 | "description": "Leaner CSS", 4 | "homepage": "http://lesscss.org", 5 | "keywords": [ 6 | "css", 7 | "parser", 8 | "lesscss", 9 | "browser" 10 | ], 11 | "author": { 12 | "name": "Alexis Sellier", 13 | "email": "self@cloudhead.net" 14 | }, 15 | "contributors": [], 16 | "version": "1.3.3", 17 | "bin": { 18 | "lessc": "./bin/lessc" 19 | }, 20 | "main": "./lib/less/index", 21 | "directories": { 22 | "test": "./test" 23 | }, 24 | "engines": { 25 | "node": ">=0.4.2" 26 | }, 27 | "optionalDependencies": { 28 | "ycssmin": ">=1.0.1" 29 | }, 30 | "devDependencies": { 31 | "diff": "~1.0" 32 | }, 33 | "scripts": { 34 | "test": "make test" 35 | }, 36 | "bugs": { 37 | "url": "https://github.com/cloudhead/less.js/issues" 38 | }, 39 | "repository": { 40 | "type": "git", 41 | "url": "https://github.com/cloudhead/less.js.git" 42 | }, 43 | "readme": "less.js\n=======\n\nThe **dynamic** stylesheet language.\n\n\n\nabout\n-----\n\nThis is the JavaScript, and now official, stable version of LESS.\n\nFor more information, visit .\n\nlicense\n-------\n\nSee `LICENSE` file.\n\n> Copyright (c) 2009-2011 Alexis Sellier\n", 44 | "readmeFilename": "README.md", 45 | "_id": "less@1.3.3", 46 | "dependencies": { 47 | "ycssmin": ">=1.0.1" 48 | }, 49 | "dist": { 50 | "shasum": "a8b1ea2f2a70a0858b0d97b9e0aab683b5023a30" 51 | }, 52 | "_from": "less@1.3.3", 53 | "_resolved": "https://registry.npmjs.org/less/-/less-1.3.3.tgz" 54 | } 55 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/rule.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.Rule = function (name, value, important, index, inline) { 4 | this.name = name; 5 | this.value = (value instanceof tree.Value) ? value : new(tree.Value)([value]); 6 | this.important = important ? ' ' + important.trim() : ''; 7 | this.index = index; 8 | this.inline = inline || false; 9 | 10 | if (name.charAt(0) === '@') { 11 | this.variable = true; 12 | } else { this.variable = false } 13 | }; 14 | tree.Rule.prototype.toCSS = function (env) { 15 | if (this.variable) { return "" } 16 | else { 17 | return this.name + (env.compress ? ':' : ': ') + 18 | this.value.toCSS(env) + 19 | this.important + (this.inline ? "" : ";"); 20 | } 21 | }; 22 | 23 | tree.Rule.prototype.eval = function (context) { 24 | return new(tree.Rule)(this.name, 25 | this.value.eval(context), 26 | this.important, 27 | this.index, this.inline); 28 | }; 29 | 30 | tree.Rule.prototype.makeImportant = function () { 31 | return new(tree.Rule)(this.name, 32 | this.value, 33 | "!important", 34 | this.index, this.inline); 35 | }; 36 | 37 | tree.Shorthand = function (a, b) { 38 | this.a = a; 39 | this.b = b; 40 | }; 41 | 42 | tree.Shorthand.prototype = { 43 | toCSS: function (env) { 44 | return this.a.toCSS(env) + "/" + this.b.toCSS(env); 45 | }, 46 | eval: function () { return this } 47 | }; 48 | 49 | })(require('../tree')); 50 | -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | v0.7.0: 2 | date: 2014-01-01 3 | changes: 4 | - "Update to use the Less.js v1.6.0 API for `banner`, `globalVars` and `modifyVars`." 5 | v0.6.0: 6 | date: 2013-12-18 7 | changes: 8 | - "Adds `globalVars` and `modifyVars` options. See readme and Gruntfile for examples." 9 | - "Support `sourceMapURL`" 10 | - "Support `outputSourceFiles`" 11 | - "Support `sourceMapFilename`, `sourceMapBasepath` and `sourceMapRootpath`" 12 | - "Upgrade to LESS 1.5 Support `strictUnits` option" 13 | - "Support sourceMap option" 14 | - "Add `customFunctions` option for defining custom functions within LESS" 15 | - "Output the source file name on error" 16 | - "yuicompress option now cleancss (Less changed underlying dependency)" 17 | v0.5.0: 18 | date: 2013-07-30 19 | changes: 20 | - "Completely refactored the plugin based on grunt-contrib-less." 21 | - "Add examples for all features to Gruntfile." 22 | - "Removed the concat feature." 23 | - "You can now use `.lessrc` or `.lessrc.yml` for externalizing task options." 24 | - "New `stripBanners` option" 25 | v0.4.7: 26 | date: 2013-06-13 27 | changes: 28 | - "Cleaned up a lot of the Gruntfile. Examples are more clear." 29 | - "New `import` option for prepending import statements to LESS files before compiling." 30 | - "New `banner` option for adding banners to generated CSS files." 31 | v0.3.0: 32 | date: 2013-03-17 33 | changes: 34 | - "New option to specify the version of less.js to use for compiling to CSS." 35 | v0.2.3: 36 | date: 2013-03-14 37 | changes: 38 | - "New options from Less.js 1.4.0" 39 | v0.1.0: 40 | date: 2013-02-27 41 | changes: 42 | - "First commit." 43 | -------------------------------------------------------------------------------- /test/fixtures/bootstrap/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | // Provide class for links that match alerts 22 | .alert-link { 23 | font-weight: @alert-link-font-weight; 24 | } 25 | 26 | // Improve alignment and spacing of inner content 27 | > p, 28 | > ul { 29 | margin-bottom: 0; 30 | } 31 | > p + p { 32 | margin-top: 5px; 33 | } 34 | } 35 | 36 | // Dismissable alerts 37 | // 38 | // Expand the right padding and account for the close button's positioning. 39 | 40 | .alert-dismissable { 41 | padding-right: (@alert-padding + 20); 42 | 43 | // Adjust close link position 44 | .close { 45 | position: relative; 46 | top: -2px; 47 | right: -21px; 48 | color: inherit; 49 | } 50 | } 51 | 52 | // Alternate styles 53 | // 54 | // Generate contextual modifier classes for colorizing the alert. 55 | 56 | .alert-success { 57 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 58 | } 59 | .alert-info { 60 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 61 | } 62 | .alert-warning { 63 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 64 | } 65 | .alert-danger { 66 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 67 | } 68 | -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/javascript.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | tree.JavaScript = function (string, index, escaped) { 4 | this.escaped = escaped; 5 | this.expression = string; 6 | this.index = index; 7 | }; 8 | tree.JavaScript.prototype = { 9 | eval: function (env) { 10 | var result, 11 | that = this, 12 | context = {}; 13 | 14 | var expression = this.expression.replace(/@\{([\w-]+)\}/g, function (_, name) { 15 | return tree.jsify(new(tree.Variable)('@' + name, that.index).eval(env)); 16 | }); 17 | 18 | try { 19 | expression = new(Function)('return (' + expression + ')'); 20 | } catch (e) { 21 | throw { message: "JavaScript evaluation error: `" + expression + "`" , 22 | index: this.index }; 23 | } 24 | 25 | for (var k in env.frames[0].variables()) { 26 | context[k.slice(1)] = { 27 | value: env.frames[0].variables()[k].value, 28 | toJS: function () { 29 | return this.value.eval(env).toCSS(); 30 | } 31 | }; 32 | } 33 | 34 | try { 35 | result = expression.call(context); 36 | } catch (e) { 37 | throw { message: "JavaScript evaluation error: '" + e.name + ': ' + e.message + "'" , 38 | index: this.index }; 39 | } 40 | if (typeof(result) === 'string') { 41 | return new(tree.Quoted)('"' + result + '"', result, this.escaped, this.index); 42 | } else if (Array.isArray(result)) { 43 | return new(tree.Anonymous)(result.join(', ')); 44 | } else { 45 | return new(tree.Anonymous)(result); 46 | } 47 | } 48 | }; 49 | 50 | })(require('../tree')); 51 | 52 | -------------------------------------------------------------------------------- /docs/README.tmpl.md: -------------------------------------------------------------------------------- 1 | # {%= name %} [![NPM version](https://badge.fury.io/js/{%= name %}.png)](http://badge.fury.io/js/{%= name %}) [![Build Status](https://travis-ci.org/assemble/{%= name %}.png)](https://travis-ci.org/assemble/{%= name %}) 2 | 3 | > Compile LESS to CSS. Adds experimental features that extend Less.js for maintaining UI components and themes. From Jon Schlinkert, core team member of Less.js. 4 | 5 | This project is a fork of the popular [grunt-contrib-less](https://github.com/gruntjs/grunt-contrib-less) by the talented [Tyler Kellen](http://goingslowly.com/). Please use that plugin if you require something stable and dependable. 6 | 7 | ## Getting Started 8 | 9 | {%= _.doc("getting-started.md") %} 10 | 11 | ## Less task 12 | _Run this task with the `grunt less` command._ 13 | 14 | Task targets, files and options may be specified according to the grunt [Configuring tasks](http://gruntjs.com/configuring-tasks) guide. 15 | 16 | ### Options 17 | {%= _.doc("options.md") %} 18 | 19 | ### Usage Examples 20 | {%= _.doc("examples.md") %} 21 | 22 | ## Release History 23 | {%= _.include("release-history.md") %} 24 | 25 | ## Authors 26 | This project is a fork of the popular [grunt-contrib-less](https://github.com/gruntjs/grunt-contrib-less) by [Tyler Kellen](http://goingslowly.com/). Please use that plugin if you require something stable and dependable. 27 | 28 | This fork is maintained by: 29 | {%= _.contrib("authors.md") %} 30 | 31 | ## License 32 | {%= copyright %} 33 | {%= license %} 34 | 35 | *** 36 | 37 | {%= _.include("footer.md") %} 38 | 39 | [1]: https://github.com/assemble/assemble-less/blob/master/test/fixtures/data/palette.yml 40 | [2]: https://github.com/assemble/assemble-less/blob/master/test/fixtures/templates-palette.less 41 | [3]: http://gruntjs.com/api/grunt.template 42 | [4]: http://gruntjs.com/api/grunt.template#grunt.template.process -------------------------------------------------------------------------------- /vendor/less-1.3.3/lib/less/tree/call.js: -------------------------------------------------------------------------------- 1 | (function (tree) { 2 | 3 | // 4 | // A function call node. 5 | // 6 | tree.Call = function (name, args, index, filename) { 7 | this.name = name; 8 | this.args = args; 9 | this.index = index; 10 | this.filename = filename; 11 | }; 12 | tree.Call.prototype = { 13 | // 14 | // When evaluating a function call, 15 | // we either find the function in `tree.functions` [1], 16 | // in which case we call it, passing the evaluated arguments, 17 | // if this returns null or we cannot find the function, we 18 | // simply print it out as it appeared originally [2]. 19 | // 20 | // The *functions.js* file contains the built-in functions. 21 | // 22 | // The reason why we evaluate the arguments, is in the case where 23 | // we try to pass a variable to a function, like: `saturate(@color)`. 24 | // The function should receive the value, not the variable. 25 | // 26 | eval: function (env) { 27 | var args = this.args.map(function (a) { return a.eval(env) }), 28 | result; 29 | 30 | if (this.name in tree.functions) { // 1. 31 | try { 32 | result = tree.functions[this.name].apply(tree.functions, args); 33 | if (result != null) { 34 | return result; 35 | } 36 | } catch (e) { 37 | throw { type: e.type || "Runtime", 38 | message: "error evaluating function `" + this.name + "`" + 39 | (e.message ? ': ' + e.message : ''), 40 | index: this.index, filename: this.filename }; 41 | } 42 | } 43 | 44 | // 2. 45 | return new(tree.Anonymous)(this.name + 46 | "(" + args.map(function (a) { return a.toCSS(env) }).join(', ') + ")"); 47 | }, 48 | 49 | toCSS: function (env) { 50 | return this.eval(env).toCSS(); 51 | } 52 | }; 53 | 54 | })(require('../tree')); 55 | -------------------------------------------------------------------------------- /test/fixtures/bootstrap/print.less: -------------------------------------------------------------------------------- 1 | // 2 | // Basic print styles 3 | // -------------------------------------------------- 4 | // Source: https://github.com/h5bp/html5-boilerplate/blob/master/css/main.css 5 | 6 | @media print { 7 | 8 | * { 9 | text-shadow: none !important; 10 | color: #000 !important; // Black prints faster: h5bp.com/s 11 | background: transparent !important; 12 | box-shadow: none !important; 13 | } 14 | 15 | a, 16 | a:visited { 17 | text-decoration: underline; 18 | } 19 | 20 | a[href]:after { 21 | content: " (" attr(href) ")"; 22 | } 23 | 24 | abbr[title]:after { 25 | content: " (" attr(title) ")"; 26 | } 27 | 28 | // Don't show links for images, or javascript/internal links 29 | a[href^="javascript:"]:after, 30 | a[href^="#"]:after { 31 | content: ""; 32 | } 33 | 34 | pre, 35 | blockquote { 36 | border: 1px solid #999; 37 | page-break-inside: avoid; 38 | } 39 | 40 | thead { 41 | display: table-header-group; // h5bp.com/t 42 | } 43 | 44 | tr, 45 | img { 46 | page-break-inside: avoid; 47 | } 48 | 49 | img { 50 | max-width: 100% !important; 51 | } 52 | 53 | @page { 54 | margin: 2cm .5cm; 55 | } 56 | 57 | p, 58 | h2, 59 | h3 { 60 | orphans: 3; 61 | widows: 3; 62 | } 63 | 64 | h2, 65 | h3 { 66 | page-break-after: avoid; 67 | } 68 | 69 | // Chrome (OSX) fix for https://github.com/twbs/bootstrap/issues/11245 70 | // Once fixed, we can just straight up remove this. 71 | select { 72 | background: #fff !important; 73 | } 74 | 75 | // Bootstrap components 76 | .navbar { 77 | display: none; 78 | } 79 | .table { 80 | td, 81 | th { 82 | background-color: #fff !important; 83 | } 84 | } 85 | .btn, 86 | .dropup > .btn { 87 | > .caret { 88 | border-top-color: #000 !important; 89 | } 90 | } 91 | .label { 92 | border: 1px solid #000; 93 | } 94 | 95 | .table { 96 | border-collapse: collapse !important; 97 | } 98 | .table-bordered { 99 | th, 100 | td { 101 | border: 1px solid #ddd !important; 102 | } 103 | } 104 | 105 | } 106 | -------------------------------------------------------------------------------- /test/fixtures/bootstrap/pagination.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pagination (multiple pages) 3 | // -------------------------------------------------- 4 | .pagination { 5 | display: inline-block; 6 | padding-left: 0; 7 | margin: @line-height-computed 0; 8 | border-radius: @border-radius-base; 9 | 10 | > li { 11 | display: inline; // Remove list-style and block-level defaults 12 | > a, 13 | > span { 14 | position: relative; 15 | float: left; // Collapse white-space 16 | padding: @padding-base-vertical @padding-base-horizontal; 17 | line-height: @line-height-base; 18 | text-decoration: none; 19 | background-color: @pagination-bg; 20 | border: 1px solid @pagination-border; 21 | margin-left: -1px; 22 | } 23 | &:first-child { 24 | > a, 25 | > span { 26 | margin-left: 0; 27 | .border-left-radius(@border-radius-base); 28 | } 29 | } 30 | &:last-child { 31 | > a, 32 | > span { 33 | .border-right-radius(@border-radius-base); 34 | } 35 | } 36 | } 37 | 38 | > li > a, 39 | > li > span { 40 | &:hover, 41 | &:focus { 42 | background-color: @pagination-hover-bg; 43 | } 44 | } 45 | 46 | > .active > a, 47 | > .active > span { 48 | &, 49 | &:hover, 50 | &:focus { 51 | z-index: 2; 52 | color: @pagination-active-color; 53 | background-color: @pagination-active-bg; 54 | border-color: @pagination-active-bg; 55 | cursor: default; 56 | } 57 | } 58 | 59 | > .disabled { 60 | > span, 61 | > span:hover, 62 | > span:focus, 63 | > a, 64 | > a:hover, 65 | > a:focus { 66 | color: @pagination-disabled-color; 67 | background-color: @pagination-bg; 68 | border-color: @pagination-border; 69 | cursor: not-allowed; 70 | } 71 | } 72 | } 73 | 74 | // Sizing 75 | // -------------------------------------------------- 76 | 77 | // Large 78 | .pagination-lg { 79 | .pagination-size(@padding-large-vertical; @padding-large-horizontal; @font-size-large; @border-radius-large); 80 | } 81 | 82 | // Small 83 | .pagination-sm { 84 | .pagination-size(@padding-small-vertical; @padding-small-horizontal; @font-size-small; @border-radius-small); 85 | } 86 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "assemble-less", 3 | "description": "Compile LESS to CSS. Adds experimental features that extend Less.js for maintaining UI components, 'bundles' and themes. From Jon Schlinkert, core team member of Less.js. This project is a fork of the popular grunt-contrib-less plugin by the talented Tyler Kellen. Please use that plugin if you require something stable and dependable.", 4 | "version": "0.7.0", 5 | "homepage": "https://github.com/assemble/assemble-less", 6 | "author": { 7 | "name": "Jon Schlinkert", 8 | "url": "http://github.com/jonschlinkert" 9 | }, 10 | "contributors": [ 11 | { 12 | "name": "Jon Schlinkert", 13 | "url": "http://github.com/jonschlinkert" 14 | }, 15 | { 16 | "name": "Brian Woodward", 17 | "url": "http://github.com/doowb" 18 | } 19 | ], 20 | "repository": { 21 | "type": "git", 22 | "url": "git://github.com/assemble/assemble-less.git" 23 | }, 24 | "bugs": { 25 | "url": "https://github.com/assemble/assemble-less/issues" 26 | }, 27 | "licenses": [ 28 | { 29 | "type": "MIT", 30 | "url": "https://github.com/assemble/assemble-less/blob/master/LICENSE-MIT" 31 | } 32 | ], 33 | "main": "Gruntfile.js", 34 | "engines": { 35 | "node": ">= 0.8.0" 36 | }, 37 | "scripts": { 38 | "test": "grunt test" 39 | }, 40 | "dependencies": { 41 | "grunt-lib-contrib": "~0.6.1", 42 | "lodash": "~2.4.1", 43 | "less": "~1.6.0", 44 | "async": "~0.2.9" 45 | }, 46 | "devDependencies": { 47 | "grunt": "~0.4.2", 48 | "grunt-contrib-clean": "~0.5.0", 49 | "grunt-contrib-jshint": "~0.7.2", 50 | "grunt-readme": "~0.4.5", 51 | "matchdep": "~0.3.0", 52 | "grunt-contrib-nodeunit": "~0.2.2" 53 | }, 54 | "keywords": [ 55 | "compile css", 56 | "gruntplugin", 57 | "less css compiler", 58 | "less css framework", 59 | "less css import", 60 | "less css tutorial", 61 | "less css", 62 | "less library", 63 | "less style sheet", 64 | "less styles", 65 | "less stylesheet", 66 | "less to sass", 67 | "less", 68 | "less.js", 69 | "lesscss", 70 | "minify css", 71 | "pre-processor", 72 | "pre-processors", 73 | "preprocessor" 74 | ] 75 | } 76 | -------------------------------------------------------------------------------- /test/fixtures/bootstrap/progress-bars.less: -------------------------------------------------------------------------------- 1 | // 2 | // Progress bars 3 | // -------------------------------------------------- 4 | 5 | 6 | // Bar animations 7 | // ------------------------- 8 | 9 | // WebKit 10 | @-webkit-keyframes progress-bar-stripes { 11 | from { background-position: 40px 0; } 12 | to { background-position: 0 0; } 13 | } 14 | 15 | // Firefox 16 | @-moz-keyframes progress-bar-stripes { 17 | from { background-position: 40px 0; } 18 | to { background-position: 0 0; } 19 | } 20 | 21 | // Opera 22 | @-o-keyframes progress-bar-stripes { 23 | from { background-position: 0 0; } 24 | to { background-position: 40px 0; } 25 | } 26 | 27 | // Spec and IE10+ 28 | @keyframes progress-bar-stripes { 29 | from { background-position: 40px 0; } 30 | to { background-position: 0 0; } 31 | } 32 | 33 | 34 | 35 | // Bar itself 36 | // ------------------------- 37 | 38 | // Outer container 39 | .progress { 40 | overflow: hidden; 41 | height: @line-height-computed; 42 | margin-bottom: @line-height-computed; 43 | background-color: @progress-bg; 44 | border-radius: @border-radius-base; 45 | .box-shadow(inset 0 1px 2px rgba(0,0,0,.1)); 46 | } 47 | 48 | // Bar of progress 49 | .progress-bar { 50 | float: left; 51 | width: 0%; 52 | height: 100%; 53 | font-size: @font-size-small; 54 | line-height: @line-height-computed; 55 | color: @progress-bar-color; 56 | text-align: center; 57 | background-color: @progress-bar-bg; 58 | .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15)); 59 | .transition(width .6s ease); 60 | } 61 | 62 | // Striped bars 63 | .progress-striped .progress-bar { 64 | #gradient > .striped(); 65 | background-size: 40px 40px; 66 | } 67 | 68 | // Call animation for the active one 69 | .progress.active .progress-bar { 70 | .animation(progress-bar-stripes 2s linear infinite); 71 | } 72 | 73 | 74 | 75 | // Variations 76 | // ------------------------- 77 | 78 | .progress-bar-success { 79 | .progress-bar-variant(@progress-bar-success-bg); 80 | } 81 | 82 | .progress-bar-info { 83 | .progress-bar-variant(@progress-bar-info-bg); 84 | } 85 | 86 | .progress-bar-warning { 87 | .progress-bar-variant(@progress-bar-warning-bg); 88 | } 89 | 90 | .progress-bar-danger { 91 | .progress-bar-variant(@progress-bar-danger-bg); 92 | } 93 | -------------------------------------------------------------------------------- /test/fixtures/bootstrap/list-group.less: -------------------------------------------------------------------------------- 1 | // 2 | // List groups 3 | // -------------------------------------------------- 4 | 5 | // Base class 6 | // 7 | // Easily usable on