diff --git a/library/vendor/lessphp/README.md b/library/vendor/lessphp/README.md deleted file mode 100644 index 0085e19d9..000000000 --- a/library/vendor/lessphp/README.md +++ /dev/null @@ -1,96 +0,0 @@ -# lessphp v0.3.9 -### - -[![Build Status](https://secure.travis-ci.org/leafo/lessphp.png)](http://travis-ci.org/leafo/lessphp) - -`lessphp` is a compiler for LESS written in PHP. The documentation is great, -so check it out: . - -Here's a quick tutorial: - -### How to use in your PHP project - -The only file required is `lessc.inc.php`, so copy that to your include directory. - -The typical flow of **lessphp** is to create a new instance of `lessc`, -configure it how you like, then tell it to compile something using one built in -compile methods. - -The `compile` method compiles a string of LESS code to CSS. - -```php -compile(".block { padding: 3 + 4px }"); -``` - -The `compileFile` method reads and compiles a file. It will either return the -result or write it to the path specified by an optional second argument. - -```php -compileFile("input.less"); -``` - -The `compileChecked` method is like `compileFile`, but it only compiles if the output -file doesn't exist or it's older than the input file: - -```php -checkedCompile("input.less", "output.css"); -``` - -If there any problem compiling your code, an exception is thrown with a helpful message: - -```php -compile("invalid LESS } {"); -} catch (exception $e) { - echo "fatal error: " . $e->getMessage(); -} -``` - -The `lessc` object can be configured through an assortment of instance methods. -Some possible configuration options include [changing the output format][1], -[setting variables from PHP][2], and [controlling the preservation of -comments][3], writing [custom functions][4] and much more. It's all described -in [the documentation][0]. - - - [0]: http://leafo.net/lessphp/docs/ - [1]: http://leafo.net/lessphp/docs/#output_formatting - [2]: http://leafo.net/lessphp/docs/#setting_variables_from_php - [3]: http://leafo.net/lessphp/docs/#preserving_comments - [4]: http://leafo.net/lessphp/docs/#custom_functions - - -### How to use from the command line - -An additional script has been included to use the compiler from the command -line. In the simplest invocation, you specify an input file and the compiled -css is written to standard out: - - $ plessc input.less > output.css - -Using the -r flag, you can specify LESS code directly as an argument or, if -the argument is left off, from standard in: - - $ plessc -r "my less code here" - -Finally, by using the -w flag you can watch a specified input file and have it -compile as needed to the output file: - - $ plessc -w input-file output-file - -Errors from watch mode are written to standard out. - -The -f flag sets the [output formatter][1]. For example, to compress the -output run this: - - $ plessc -f=compressed myfile.less - -For more help, run `plessc --help` - diff --git a/library/vendor/lessphp/SOURCE b/library/vendor/lessphp/SOURCE new file mode 100644 index 000000000..3d4ddd72c --- /dev/null +++ b/library/vendor/lessphp/SOURCE @@ -0,0 +1,2 @@ +http://leafo.net/lessphp/src/lessphp-0.4.0.tar.gz +tar xfz lessphp-0.4.0.tar.gz lessphp/lessc.inc.php lessphp/LICENSE diff --git a/library/vendor/lessphp/composer.json b/library/vendor/lessphp/composer.json deleted file mode 100644 index 2b525a57c..000000000 --- a/library/vendor/lessphp/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "leafo/lessphp", - "type": "library", - "description": "lessphp is a compiler for LESS written in PHP.", - "homepage": "http://leafo.net/lessphp/", - "license": [ - "MIT", - "GPL-3.0" - ], - "authors": [ - { - "name": "Leaf Corcoran", - "email": "leafot@gmail.com", - "homepage": "http://leafo.net" - } - ], - "autoload": { - "classmap": ["lessc.inc.php"] - }, - "extra": { - "branch-alias": { - "dev-master": "0.3-dev" - } - } -} diff --git a/library/vendor/lessphp/docs/docs.md b/library/vendor/lessphp/docs/docs.md deleted file mode 100644 index ce3a331f7..000000000 --- a/library/vendor/lessphp/docs/docs.md +++ /dev/null @@ -1,1294 +0,0 @@ - title: v0.3.9 documentation - link_to_home: true --- - -

Documentation v0.3.9

- -
$index
- -**lessphp** is a compiler that generates CSS from a superset language which -adds a collection of convenient features often seen in other languages. All CSS -is compatible with LESS, so you can start using new features with your existing CSS. - -It is designed to be compatible with [less.js](http://lesscss.org), and suitable -as a drop in replacement for PHP projects. - -## Getting Started - -The homepage for **lessphp** can be found at [http://leafo.net/lessphp/][1]. - -You can follow development at the project's [GitHub][2]. - -Including **lessphp** in your project is as simple as dropping the single -include file into your code base and running the appropriate compile method as -described in the [PHP Interface](#php_interface). - - [1]: http://leafo.net/lessphp "lessphp homepage" - [2]: https://github.com/leafo/lessphp "lessphp GitHub page" - -## Installation - -**lessphp** is distributed entirely in a single stand-alone file. Download the -latest version from either [the homepage][1] or [GitHub][2]. - -Development versions can also be downloading from GitHub. - -Place `lessphp.inc.php` in a location available to your PHP scripts, and -include it. That's it! you're ready to begin. - -## The Language - -**lessphp** is very easy to learn because it generally functions how you would -expect it to. If you feel something is challenging or missing, feel free to -open an issue on the [bug tracker](https://github.com/leafo/lessphp/issues). - -It is also easy to learn because any standards-compliant CSS code is valid LESS -code. You are free to gradually enhance your existing CSS code base with LESS -features without having to worry about rewriting anything. - -The following is a description of the new languages features provided by LESS. - -### Line Comments - -Simple but very useful; line comments are started with `//`: - - ```less - // this is a comment - body { - color: red; // as is this - /* block comments still work also */ - } - ``` - -### Variables -Variables are identified with a name that starts with `@`. To declare a -variable, you create an appropriately named CSS property and assign it a value: - - ```less - @family: "verdana"; - @color: red; - body { - @mycolor: red; - font-family: @family; - color: @color; - border-bottom: 1px solid @color; - } - ``` - -Variable declarations will not appear in the output. Variables can be declared -in the outer most scope of the file, or anywhere else a CSS property may -appear. They can hold any CSS property value. - -Variables are only visible for use from their current scope, or any enclosed -scopes. - -If you have a string or keyword in a variable, you can reference another -variable by that name by repeating the `@`: - - ```less - @value: 20px; - @value_name: "value"; - - width: @@value_name; - ``` - -### Expressions - -Expressions let you combine values and variables in meaningful ways. For -example you can add to a color to make it a different shade. Or divide up the -width of your layout logically. You can even concatenate strings. - -Use the mathematical operators to evaluate an expression: - - ```less - @width: 960px; - .nav { - width: @width / 3; - color: #001 + #abc; - } - .body { - width: 2 * @width / 3; - font-family: "hel" + "vetica"; - } - ``` - -Parentheses can be used to control the order of evaluation. They can also be -used to force an evaluation for cases where CSS's syntax makes the expression -ambiguous. - -The following property will produce two numbers, instead of doing the -subtraction: - - ```less - margin: 10px -5px; - ``` - -To force the subtraction: - - ```less - margin: (10px -5px); - ``` - -It is also safe to surround mathematical operators by spaces to ensure that -they are evaluated: - - ```less - margin: 10px - 5px; - ``` - -Division has a special quirk. There are certain CSS properties that use the `/` -operator as part of their value's syntax. Namely, the [font][4] shorthand and -[border-radius][3]. - - [3]: https://developer.mozilla.org/en/CSS/border-radius - [4]: https://developer.mozilla.org/en/CSS/font - - -Thus, **lessphp** will ignore any division in these properties unless it is -wrapped in parentheses. For example, no division will take place here: - - ```less - .font { - font: 20px/80px "Times New Roman"; - } - ``` - -In order to force division we must wrap the expression in parentheses: - - ```less - .font { - font: (20px/80px) "Times New Roman"; - } - ``` - -If you want to write a literal `/` expression without dividing in another -property (or a variable), you can use [string unquoting](#string_unquoting): - - ```less - .var { - @size: ~"20px/80px"; - font: @size sans-serif; - } - ``` - -### Nested Blocks - -By nesting blocks we can build up a chain of CSS selectors through scope -instead of repeating them. In addition to reducing repetition, this also helps -logically organize the structure of our CSS. - - ```less - ol.list { - li.special { - border: 1px solid red; - } - - li.plain { - font-weight: bold; - } - } - ``` - - -This will produce two blocks, a `ol.list li.special` and `ol.list li.plain`. - -Blocks can be nested as deep as required in order to build a hierarchy of -relationships. - -The `&` operator can be used in a selector to represent its parent's selector. -If the `&` operator is used, then the default action of appending the parent to -the front of the child selector separated by space is not performed. - - ```less - b { - a & { - color: red; - } - - // the following have the same effect - - & i { - color: blue; - } - - i { - color: blue; - } - } - ``` - - -Because the `&` operator respects the whitespace around it, we can use it to -control how the child blocks are joined. Consider the differences between the -following: - - ```less - div { - .child-class { color: purple; } - - &.isa-class { color: green; } - - #child-id { height: 200px; } - - &#div-id { height: 400px; } - - &:hover { color: red; } - - :link { color: blue; } - } - ``` - -The `&` operator also works with [mixins](#mixins), which produces interesting results: - - ```less - .within_box_style() { - .box & { - color: blue; - } - } - - #menu { - .within_box_style; - } - ``` - -### Mixins - -Any block can be mixed in just by naming it: - - ```less - .mymixin { - color: blue; - border: 1px solid red; - - .special { - font-weight: bold; - } - } - - - h1 { - font-size: 200px; - .mixin; - } - ``` - -All properties and child blocks are mixed in. - -Mixins can be made parametric, meaning they can take arguments, in order to -enhance their utility. A parametric mixin all by itself is not outputted when -compiled. Its properties will only appear when mixed into another block. - -The canonical example is to create a rounded corners mixin that works across -browsers: - - ```less - .rounded-corners(@radius: 5px) { - border-radius: @radius; - -webkit-border-radius: @radius; - -moz-border-radius: @radius; - } - - .header { - .rounded-corners(); - } - - .info { - background: red; - .rounded-corners(14px); - } - ``` - -If you have a mixin that doesn't have any arguments, but you don't want it to -show up in the output, give it a blank argument list: - - ```less - .secret() { - font-size: 6000px; - } - - .div { - .secret; - } - ``` - -If the mixin doesn't need any arguments, you can leave off the parentheses when -mixing it in, as seen above. - -You can also mixin a block that is nested inside other blocks. You can think of -the outer block as a way of making a scope for your mixins. You just list the -names of the mixins separated by spaces, which describes the path to the mixin -you want to include. Optionally you can separate them by `>`. - - ```less - .my_scope { - .some_color { - color: red; - .inner_block { - text-decoration: underline; - } - } - .bold { - font-weight: bold; - color: blue; - } - } - - .a_block { - .my_scope .some_color; - .my_scope .some_color .inner_block; - } - - .another_block { - // the alternative syntax - .my_scope > .bold; - } - ``` - -#### `@arguments` Variable - -Within an mixin there is a special variable named `@arguments` that contains -all the arguments passed to the mixin along with any remaining arguments that -have default values. The value of the variable has all the values separated by -spaces. - -This useful for quickly assigning all the arguments: - - ```less - .box-shadow(@x, @y, @blur, @color) { - box-shadow: @arguments; - -webkit-box-shadow: @arguments; - -moz-box-shadow: @arguments; - } - .menu { - .box-shadow(1px, 1px, 5px, #aaa); - } - ``` - -In addition to the arguments passed to the mixin, `@arguments` will also include -remaining default values assigned by the mixin: - - - ```less - .border-mixin(@width, @style: solid, @color: black) { - border: @arguments; - } - - pre { - .border-mixin(4px, dotted); - } - - ``` - - -#### Pattern Matching - -When you *mix in* a mixin, all the available mixins of that name in the current -scope are checked to see if they match based on what was passed to the mixin -and how it was declared. - -The simplest case is matching by number of arguments. Only the mixins that -match the number of arguments passed in are used. - - ```less - .simple() { // matches no arguments - height: 10px; - } - - .simple(@a, @b) { // matches two arguments - color: red; - } - - .simple(@a) { // matches one argument - color: blue; - } - - div { - .simple(10); - } - - span { - .simple(10, 20); - } - ``` - -Whether an argument has default values is also taken into account when matching -based on number of arguments: - - ```less - // matches one or two arguments - .hello(@a, @b: blue) { - height: @a; - color: @b; - } - - .hello(@a, @b) { // matches only two - width: @a; - border-color: @b; - } - - .hello(@a) { // matches only one - padding: 1em; - } - - div { - .hello(10px); - } - - pre { - .hello(10px, yellow); - } - ``` - -Additionally, a *vararg* value can be used to further control how things are -matched. A mixin's argument list can optionally end in the special argument -named `...`. The `...` may match any number of arguments, including 0. - - ```less - // this will match any number of arguments - .first(...) { - color: blue; - } - - // matches at least 1 argument - .second(@arg, ...) { - height: 200px + @arg; - } - - div { .first("some", "args"); } - pre { .second(10px); } - ``` - -If you want to capture the values that get captured by the *vararg* you can -give it a variable name by putting it directly before the `...`. This variable -must be the last argument defined. It's value is just like the special -[`@arguments` variable](#arguments_variable), a space separated list. - - - ```less - .hello(@first, @rest...) { - color: @first; - text-shadow: @rest; - } - - span { - .hello(red, 1px, 1px, 0px, white); - } - - ``` - -Another way of controlling whether a mixin matches is by specifying a value in -place of an argument name when declaring the mixin: - - ```less - .style(old, @size) { - font: @size serif; - } - - .style(new, @size) { - font: @size sans-serif; - } - - .style(@_, @size) { - letter-spacing: floor(@size / 6px); - } - - em { - @switch: old; - .style(@switch, 15px); - } - ``` - -Notice that two of the three mixins were matched. The mixin with a matching -first argument, and the generic mixin that matches two arguments. It's common -to use `@_` as the name of a variable we intend to not use. It has no special -meaning to LESS, just to the reader of the code. - -#### Guards - -Another way of restricting when a mixin is mixed in is by using guards. A guard -is a special expression that is associated with a mixin declaration that is -evaluated during the mixin process. It must evaluate to true before the mixin -can be used. - -We use the `when` keyword to begin describing a list of guard expressions. - -Here's a simple example: - - ```less - .guarded(@arg) when (@arg = hello) { - color: blue; - } - - div { - .guarded(hello); // match - } - - span { - .guarded(world); // no match - } - ``` -Only the `div`'s mixin will match in this case, because the guard expression -requires that `@arg` is equal to `hello`. - -We can include many different guard expressions by separating them by commas. -Only one of them needs to match to trigger the mixin: - - ```less - .x(@a, @b) when (@a = hello), (@b = world) { - width: 960px; - } - - div { - .x(hello, bar); // match - } - - span { - .x(foo, world); // match - } - - pre { - .x(foo, bar); // no match - } - ``` - -Instead of a comma, we can use `and` keyword to make it so all of the guards -must match in order to trigger the mixin. `and` has higher precedence than the -comma. - - ```less - .y(@a, @b) when (@a = hello) and (@b = world) { - height: 600px; - } - - div { - .y(hello, world); // match - } - - span { - .y(hello, bar); // no match - } - ``` - -Commas and `and`s can be mixed and matched. - -You can also negate a guard expression by using `not` in from of the parentheses: - - ```less - .x(@a) when not (@a = hello) { - color: blue; - } - - div { - .x(hello); // no match - } - ``` - -The `=` operator is used to check equality between any two values. For numbers -the following comparison operators are also defined: - -`<`, `>`, `=<`, `>=` - -There is also a collection of predicate functions that can be used to test the -type of a value. - -These are `isnumber`, `iscolor`, `iskeyword`, `isstring`, `ispixel`, -`ispercentage` and `isem`. - - ```less - .mix(@a) when (ispercentage(@a)) { - height: 500px * @a; - } - .mix(@a) when (ispixel(@a)) { - height: @a; - } - - div.a { - .mix(50%); - } - - div.a { - .mix(350px); - } - ``` - -#### !important - -If you want to apply the `!important` suffix to every property when mixing in a -mixin, just append `!important` to the end of the call to the mixin: - - ```less - .make_bright { - color: red; - font-weight: bold; - } - - .color { - color: green; - } - - body { - .make_bright() !important; - .color(); - } - - ``` - -### Selector Expressions - -Sometimes we want to dynamically generate the selector of a block based on some -variable or expression. We can do this by using *selector expressions*. Selector -expressions are CSS selectors that are evaluated in the current scope before -being written out. - -A simple example is a mixin that dynamically creates a selector named after the -mixin's argument: - - ```less - .create-selector(@name) { - (e(@name)) { - color: red; - } - } - - .create-selector("hello"); - .create-selector("world"); - ``` - -Any selector that is enclosed in `()` will have it's contents evaluated and -directly written to output. The value is not changed any way before being -outputted, thats why we use the `e` function. If you're not familiar, the `e` -function strips quotes off a string value. If we didn't have it, then the -selector would have quotes around it, and that's not valid CSS! - -Any value can be used in a selector expression, but it works best when using -strings and things like [String Interpolation](#string_interpolation). - -Here's an interesting example adapted from Twitter Bootstrap. A couple advanced -things are going on. We are using [Guards](#guards) along with a recursive -mixin to work like a loop to generate a series of CSS blocks. - - - ```less - // create our recursive mixin: - .spanX (@index) when (@index > 0) { - (~".span@{index}") { - width: @index * 100px; - } - .spanX(@index - 1); - } - .spanX (0) {} - - // mix it into the global scopee: - .spanX(4); - ``` - -### Import - -Multiple LESS files can be compiled into a single CSS file by using the -`@import` statement. Be careful, the LESS import statement shares syntax with -the CSS import statement. If the file being imported ends in a `.less` -extension, or no extension, then it is treated as a LESS import. Otherwise it -is left alone and outputted directly: - - ```less - // my_file.less - .some-mixin(@height) { - height: @height; - } - - // main.less - @import "main.less" // will import the file if it can be found - @import "main.css" // will be left alone - - body { - .some-mixin(400px); - } - ``` - -All of the following lines are valid ways to import the same file: - - ```less - @import "file"; - @import 'file.less'; - @import url("file"); - @import url('file'); - @import url(file); - ``` - -When importing, the `importDir` is searched for files. This can be configured, -see [PHP Interface](#php_interface). - -### String Interpolation - -String interpolation is a convenient way to insert the value of a variable -right into a string literal. Given some variable named `@var_name`, you just -need to write it as `@{var_name}` from within the string to have its value -inserted: - - ```less - @symbol: ">"; - h1:before { - content: "@{symbol}: "; - } - - h2:before { - content: "@{symbol}@{symbol}: "; - } - ``` - -There are two kinds of strings, implicit and explicit strings. Explicit strings -are wrapped by double quotes, `"hello I am a string"`, or single quotes `'I am -another string'`. Implicit strings only appear when using `url()`. The text -between the parentheses is considered a string and thus string interpolation is -possible: - - ```less - @path: "files/"; - body { - background: url(@{path}my_background.png); - } - ``` - -### String Format Function - -The `%` function can be used to insert values into strings using a *format -string*. It works similar to `printf` seen in other languages. It has the -same purpose as string interpolation above, but gives explicit control over -the output format. - - ```less - @symbol: ">"; - h1:before { - content: %("%s: ", @symbol); - } - ``` - -The `%` function takes as its first argument the format string, following any -number of addition arguments that are inserted in place of the format -directives. - -A format directive starts with a `%` and is followed by a single character that -is either `a`, `d`, or `s`: - - ```less - strings: %("%a %d %s %a", hi, 1, 'ok', 'cool'); - ``` - -`%a` and `%d` format the value the same way: they compile the argument to its -CSS value and insert it directly. When used with a string, the quotes are -included in the output. This typically isn't what we want, so we have the `%s` -format directive which strips quotes from strings before inserting them. - -The `%d` directive functions the same as `%a`, but is typically used for numbers -assuming the output format of numbers might change in the future. - -### String Unquoting - -Sometimes you will need to write proprietary CSS syntax that is unable to be -parsed. As a workaround you can place the code into a string and unquote it. -Unquoting is the process of outputting a string without its surrounding quotes. -There are two ways to unquote a string. - -The `~` operator in front of a string will unquote that string: - - ```less - .class { - // a made up, but problematic vendor specific CSS - filter: ~"Microsoft.AlphaImage(src='image.png')"; - } - ``` - -If you are working with other types, such as variables, there is a built in -function that let's you unquote any value. It is called `e`. - - ```less - @color: "red"; - .class { - color: e(@color); - } - ``` - -### Built In Functions - -**lessphp** has a collection of built in functions: - -* `e(str)` -- returns a string without the surrounding quotes. - See [String Unquoting](#string_unquoting) - -* `floor(number)` -- returns the floor of a numerical input -* `round(number)` -- returns the rounded value of numerical input - -* `lighten(color, percent)` -- lightens `color` by `percent` and returns it -* `darken(color, percent)` -- darkens `color` by `percent` and returns it - -* `saturate(color, percent)` -- saturates `color` by `percent` and returns it -* `desaturate(color, percent)` -- desaturates `color` by `percent` and returns it - -* `fadein(color, percent)` -- makes `color` less transparent by `percent` and returns it -* `fadeout(color, percent)` -- makes `color` more transparent by `percent` and returns it - -* `spin(color, amount)` -- returns a color with `amount` degrees added to hue - -* `fade(color, amount)` -- returns a color with the alpha set to `amount` - -* `hue(color)` -- returns the hue of `color` - -* `saturation(color)` -- returns the saturation of `color` - -* `lightness(color)` -- returns the lightness of `color` - -* `alpha(color)` -- returns the alpha value of `color` or 1.0 if it doesn't have an alpha - -* `percentage(number)` -- converts a floating point number to a percentage, e.g. `0.65` -> `65%` - -* `mix(color1, color1, percent)` -- mixes two colors by percentage where 100% - keeps all of `color1`, and 0% keeps all of `color2`. Will take into account - the alpha of the colors if it exists. See - . - -* `constrast(color, dark, light)` -- if `color` has a lightness value greater - than 50% then `dark` is returned, otherwise return `light`. - -* `rgbahex(color)` -- returns a string containing 4 part hex color. - - This is used to convert a CSS color into the hex format that IE's filter - method expects when working with an alpha component. - - ```less - .class { - @start: rgbahex(rgba(25, 34, 23, .5)); - @end: rgbahex(rgba(85, 74, 103, .6)); - // abridged example - -ms-filter: - e("gradient(start=@{start},end=@{end})"); - } - ``` - -## PHP Interface - -When working with **lessphp** from PHP, the typical flow is to create a new -instance of `lessc`, configure it how you like, then tell it to compile -something using one built in compile methods. - -Methods: - -* [`compile($string)`](#compiling[) -- Compile a string - -* [`compileFile($inFile, [$outFile])`](#compiling) -- Compile a file to another or return it - -* [`checkedCompile($inFile, $outFile)`](#compiling) -- Compile a file only if it's newer - -* [`cachedCompile($cacheOrFile, [$force])`](#compiling_automatically) -- Conditionally compile while tracking imports - -* [`setFormatter($formatterName)`](#output_formatting) -- Change how CSS output looks - -* [`setPreserveComments($keepComments)`](#preserving_comments) -- Change if comments are kept in output - -* [`registerFunction($name, $callable)`](#custom_functions) -- Add a custom function - -* [`unregisterFunction($name)`](#custom_functions) -- Remove a registered function - -* [`setVariables($vars)`](#setting_variables_from_php) -- Set a variable from PHP - -* [`unsetVariable($name)`](#setting_variables_from_php) -- Remove a PHP variable - -* [`setImportDir($dirs)`](#import_directory) -- Set the search path for imports - -* [`addImportDir($dir)`](#import_directory) -- Append directory to search path for imports - - -### Compiling - -The `compile` method compiles a string of LESS code to CSS. - - ```php - compile(".block { padding: 3 + 4px }"); - ``` - -The `compileFile` method reads and compiles a file. It will either return the -result or write it to the path specified by an optional second argument. - - ```php - echo $less->compileFile("input.less"); - ``` - -The `compileChecked` method is like `compileFile`, but it only compiles if the output -file doesn't exist or it's older than the input file: - - ```php - $less->checkedCompile("input.less", "output.css"); - ``` - -See [Compiling Automatically](#compiling_automatically) for a description of -the more advanced `cachedCompile` method. - -### Output Formatting - -Output formatting controls the indentation of the output CSS. Besides the -default formatter, two additional ones are included and it's also easy to make -your own. - -To use a formatter, the method `setFormatter` is used. Just -pass the name of the formatter: - - ```php - $less = new lessc; - - $less->setFormatter("compressed"); - echo $less->compile("div { color: lighten(blue, 10%) }"); - ``` - -In this example, the `compressed` formatter is used. The formatters are: - - * `lessjs` *(default)* -- Same style used in LESS for JavaScript - - * `compressed` -- Compresses all the unrequired whitespace - - * `classic` -- **lessphp**'s original formatter - -To revert to the default formatter, call `setFormatter` with a value of `null`. - -#### Custom Formatter - -The easiest way to customize the formatter is to create your own instance of an -existing formatter and alter its public properties before passing it off to -**lessphp**. The `setFormatter` method can also take an instance of a -formatter. - -Each of the formatter names corresponds to a class with `lessc_formatter_` -prepended in front of it. Here the classic formatter is customized to use tabs -instead of spaces: - - - ```php - $formatter = new lessc_formatter_classic; - $formatter->indentChar = "\t"; - - $less = new lessc; - $less->setFormatter($formatter); - echo $less->compileFile("myfile.less"); - ``` - -For more information about what can be configured with the formatter consult -the source code. - -### Preserving Comments - -By default, all comments in the source LESS file are stripped when compiling. -You might want to keep the `/* */` comments in the output though. For -example, bundling a license in the file. - -Enable or disable comment preservation by calling `setPreserveComments`: - - ```php - $less = new lessc; - $less->setPreserveComments(true); - echo $less->compile("/* hello! */"); - ``` - -Comments are disabled by default because there is additional overhead, and more -often than not they aren't needed. - - -### Compiling Automatically - -Often, you want to only compile a LESS file only if it has been modified since -last compile. This is very important because compiling is performance intensive -and you should avoid a recompile if it possible. - -The `checkedCompile` compile method will do just that. It will check if the -input file is newer than the output file, or if the output file doesn't exist -yet, and compile only then. - - ```php - $less->checkedCompile("input.less", "output.css"); - ``` - -There's a problem though. `checkedCompile` is very basic, it only checks the -input file's modification time. It is unaware of any files from `@import`. - - -For this reason we also have `cachedCompile`. It's slightly more complex, but -gives us the ability to check changes to all files including those imported. It -takes one argument, either the name of the file we want to compile, or an -existing *cache object*. Its return value is an updated cache object. - -If we don't have a cache object, then we call the function with the name of the -file to get the initial cache object. If we do have a cache object, then we -call the function with it. In both cases, an updated cache object is returned. - -The cache object keeps track of all the files that must be checked in order to -determine if a rebuild is required. - -The cache object is a plain PHP `array`. It stores the last time it compiled in -`$cache["updated"]` and output of the compile in `$cache["compiled"]`. - -Here we demonstrate creating an new cache object, then using it to see if we -have a recompiled version available to be written: - - - ```php - $inputFile = "myfile.less"; - $outputFile = "myfile.css"; - - $less = new lessc; - - // create a new cache object, and compile - $cache = $less->cachedCompile($inputFile); - - file_put_contents($outputFile, $cache["compiled"]); - - // the next time we run, write only if it has updated - $last_updated = $cache["updated"]; - $cache = $less->cachedCompile($cache); - if ($cache["updated"] > $last_updated) { - file_put_contents($outputFile, $cache["compiled"]); - } - - ``` - -In order for the system to fully work, we must save cache object between -requests. Because it's a plain PHP `array`, it's sufficient to -[`serialize`](http://php.net/serialize) it and save it the string somewhere -like a file or in persistent memory. - -An example with saving cache object to a file: - - ```php - function autoCompileLess($inputFile, $outputFile) { - // load the cache - $cacheFile = $inputFile.".cache"; - - if (file_exists($cacheFile)) { - $cache = unserialize(file_get_contents($cacheFile)); - } else { - $cache = $inputFile; - } - - $less = new lessc; - $newCache = $less->cachedCompile($cache); - - if (!is_array($cache) || $newCache["updated"] > $cache["updated"]) { - file_put_contents($cacheFile, serialize($newCache)); - file_put_contents($outputFile, $newCache['compiled']); - } - } - - autoCompileLess('myfile.less', 'myfile.css'); - ``` - -`cachedCompile` method takes an optional second argument, `$force`. Passing in -true will cause the input to always be recompiled. - -### Error Handling - -All of the compile methods will throw an `Exception` if the parsing fails or -there is a compile time error. Compile time errors include things like passing -incorrectly typed values for functions that expect specific things, like the -color manipulation functions. - - ```php - $less = new lessc; - try { - $less->compile("} invalid LESS }}}"); - } catch (Exception $ex) { - echo "lessphp fatal error: ".$ex->getMessage(); - } - ``` -### Setting Variables From PHP - -Before compiling any code you can set initial LESS variables from PHP. The -`setVariables` method lets us do this. It takes an associative array of names -to values. The values must be strings, and will be parsed into correct CSS -values. - - - ```php - $less = new lessc; - - $less->setVariables(array( - "color" => "red", - "base" => "960px" - )); - - echo $less->compile(".magic { color: @color; width: @base - 200; }"); - ``` - -If you need to unset a variable, the `unsetVariable` method is available. It -takes the name of the variable to unset. - - ```php - $less->unsetVariable("color"); - ``` - -Be aware that the value of the variable is a string containing a CSS value. So -if you want to pass a LESS string in, you're going to need two sets of quotes. -One for PHP and one for LESS. - - - ```php - $less->setVariables(array( - "url" => "'http://example.com.com/'" - )); - - echo $less->compile("body { background: url("@{url}/bg.png"); }"); - ``` - -### Import Directory - -When running the `@import` directive, an array of directories called the import -search path is searched through to find the file being asked for. - -By default, when using `compile`, the import search path just contains `""`, -which is equivalent to the current directory of the script. If `compileFile` is -used, then the directory of the file being compiled is used as the starting -import search path. - -Two methods are available for configuring the search path. - -`setImportDir` will overwrite the search path with its argument. If the value -isn't an array it will be converted to one. - - -In this example, `@import "colors";` will look for either -`assets/less/colors.less` or `assets/bootstrap/colors.less` in that order: - - ```php - $less->setImportDir(array("assets/less/", "assets/bootstrap"); - - echo $less->compile('@import "colors";'); - ``` - -`addImportDir` will append a single path to the import search path instead of -overwritting the whole thing. - - ```php - $less->addImportDir("public/stylesheets"); - ``` - -### Custom Functions - -**lessphp** has a simple extension interface where you can implement user -functions that will be exposed in LESS code during the compile. They can be a -little tricky though because you need to work with the **lessphp** type system. - -The two methods we are interested in are `registerFunction` and -`unregisterFunction`. `registerFunction` takes two arguments, a name and a -callable value. `unregisterFunction` just takes the name of an existing -function to remove. - -Here's an example that adds a function called `double` that doubles any numeric -argument: - - ```php - registerFunction("double", "lessphp_double"); - - // gives us a width of 800px - echo $less->compile("div { width: double(400px); }"); - ``` - -The second argument to `registerFunction` is any *callable value* that is -understood by [`call_user_func`](http://php.net/call_user_func). - -If we are using PHP 5.3 or above then we are free to pass a function literal -like so: - - ```php - $less->registerFunction("double", function($arg) { - list($type, $value, $unit) = $arg; - return array($type, $value*2, $unit); - }); - ``` - -Now let's talk about the `double` function itself. - -Although a little verbose, the implementation gives us some insight on the type -system. All values in **lessphp** are stored in an array where the 0th element -is a string representing the type, and the other elements make up the -associated data for that value. - -The best way to get an understanding of the system is to register is dummy -function which does a `var_dump` on the argument. Try passing the function -different values from LESS and see what the results are. - -The return value of the registered function must also be a **lessphp** type, -but if it is a string or numeric value, it will automatically be coerced into -an appropriate typed value. In our example, we reconstruct the value with our -modifications while making sure that we preserve the original type. - -The instance of **lessphp** itself is sent to the registered function as the -second argument in addition to the arguments array. - -## Command Line Interface - -**lessphp** comes with a command line script written in PHP that can be used to -invoke the compiler from the terminal. On Linux an OSX, all you need to do is -place `plessc` and `lessc.inc.php` somewhere in your PATH (or you can run it in -the current directory as well). On windows you'll need a copy of `php.exe` to -run the file. To compile a file, `input.less` to CSS, run: - - ```bash - $ plessc input.less - ``` - -To write to a file, redirect standard out: - - ```bash - $ plessc input.less > output.css - ``` - -To compile code directly on the command line: - - ```bash - $ plessc -r "@color: red; body { color: @color; }" - ``` - -To watch a file for changes, and compile it as needed, use the `-w` flag: - - ```bash - $ plessc -w input-file output-file - ``` - -Errors from watch mode are written to standard out. - - -## License - -Copyright (c) 2012 Leaf Corcoran, - -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. - - -*Also under GPL3 if required, see `LICENSE` file* - diff --git a/library/vendor/lessphp/lessc.inc.php b/library/vendor/lessphp/lessc.inc.php index 411ca2fab..0699de52f 100644 --- a/library/vendor/lessphp/lessc.inc.php +++ b/library/vendor/lessphp/lessc.inc.php @@ -1,7 +1,7 @@ findImport($url); + if ($realPath === null) return false; if ($this->importDisabled) { return array(false, "/* import disabled */"); } + if (isset($this->allParsedFiles[realpath($realPath)])) { + return array(false, null); + } + $this->addParsedFile($realPath); $parser = $this->makeParser($realPath); $root = $parser->parse(file_get_contents($realPath)); @@ -276,6 +283,8 @@ class lessc { foreach ($this->sortProps($block->props) as $prop) { $this->compileProp($prop, $block, $out); } + + $out->lines = array_values(array_unique($out->lines)); } protected function sortProps($props, $split = false) { @@ -450,7 +459,7 @@ class lessc { return $left == $right; } - protected function patternMatch($block, $callingArgs) { + protected function patternMatch($block, $orderedArgs, $keywordArgs) { // match the guards if it has them // any one of the groups must have all its guards pass for a match if (!empty($block->guards)) { @@ -458,7 +467,7 @@ class lessc { foreach ($block->guards as $guardGroup) { foreach ($guardGroup as $guard) { $this->pushEnv(); - $this->zipSetArgs($block->args, $callingArgs); + $this->zipSetArgs($block->args, $orderedArgs, $keywordArgs); $negate = false; if ($guard[0] == "negate") { @@ -487,24 +496,34 @@ class lessc { } } - $numCalling = count($callingArgs); - if (empty($block->args)) { - return $block->isVararg || $numCalling == 0; + return $block->isVararg || empty($orderedArgs) && empty($keywordArgs); + } + + $remainingArgs = $block->args; + if ($keywordArgs) { + $remainingArgs = array(); + foreach ($block->args as $arg) { + if ($arg[0] == "arg" && isset($keywordArgs[$arg[1]])) { + continue; + } + + $remainingArgs[] = $arg; + } } $i = -1; // no args // try to match by arity or by argument literal - foreach ($block->args as $i => $arg) { + foreach ($remainingArgs as $i => $arg) { switch ($arg[0]) { case "lit": - if (empty($callingArgs[$i]) || !$this->eq($arg[1], $callingArgs[$i])) { + if (empty($orderedArgs[$i]) || !$this->eq($arg[1], $orderedArgs[$i])) { return false; } break; case "arg": // no arg and no default value - if (!isset($callingArgs[$i]) && !isset($arg[2])) { + if (!isset($orderedArgs[$i]) && !isset($arg[2])) { return false; } break; @@ -519,14 +538,19 @@ class lessc { } else { $numMatched = $i + 1; // greater than becuase default values always match - return $numMatched >= $numCalling; + return $numMatched >= count($orderedArgs); } } - protected function patternMatchAll($blocks, $callingArgs) { + protected function patternMatchAll($blocks, $orderedArgs, $keywordArgs, $skip=array()) { $matches = null; foreach ($blocks as $block) { - if ($this->patternMatch($block, $callingArgs)) { + // skip seen blocks that don't have arguments + if (isset($skip[$block->id]) && !isset($block->args)) { + continue; + } + + if ($this->patternMatch($block, $orderedArgs, $keywordArgs)) { $matches[] = $block; } } @@ -535,7 +559,7 @@ class lessc { } // attempt to find blocks matched by path and args - protected function findBlocks($searchIn, $path, $args, $seen=array()) { + protected function findBlocks($searchIn, $path, $orderedArgs, $keywordArgs, $seen=array()) { if ($searchIn == null) return null; if (isset($seen[$searchIn->id])) return null; $seen[$searchIn->id] = true; @@ -545,7 +569,7 @@ class lessc { if (isset($searchIn->children[$name])) { $blocks = $searchIn->children[$name]; if (count($path) == 1) { - $matches = $this->patternMatchAll($blocks, $args); + $matches = $this->patternMatchAll($blocks, $orderedArgs, $keywordArgs, $seen); if (!empty($matches)) { // This will return all blocks that match in the closest // scope that has any matching block, like lessjs @@ -555,7 +579,7 @@ class lessc { $matches = array(); foreach ($blocks as $subBlock) { $subMatches = $this->findBlocks($subBlock, - array_slice($path, 1), $args, $seen); + array_slice($path, 1), $orderedArgs, $keywordArgs, $seen); if (!is_null($subMatches)) { foreach ($subMatches as $sm) { @@ -567,39 +591,51 @@ class lessc { return count($matches) > 0 ? $matches : null; } } - if ($searchIn->parent === $searchIn) return null; - return $this->findBlocks($searchIn->parent, $path, $args, $seen); + return $this->findBlocks($searchIn->parent, $path, $orderedArgs, $keywordArgs, $seen); } // sets all argument names in $args to either the default value // or the one passed in through $values - protected function zipSetArgs($args, $values) { - $i = 0; + protected function zipSetArgs($args, $orderedValues, $keywordValues) { $assignedValues = array(); - foreach ($args as $a) { + + $i = 0; + foreach ($args as $a) { if ($a[0] == "arg") { - if ($i < count($values) && !is_null($values[$i])) { - $value = $values[$i]; + if (isset($keywordValues[$a[1]])) { + // has keyword arg + $value = $keywordValues[$a[1]]; + } elseif (isset($orderedValues[$i])) { + // has ordered arg + $value = $orderedValues[$i]; + $i++; } elseif (isset($a[2])) { + // has default value $value = $a[2]; - } else $value = null; + } else { + $this->throwError("Failed to assign arg " . $a[1]); + $value = null; // :( + } $value = $this->reduce($value); $this->set($a[1], $value); $assignedValues[] = $value; + } else { + // a lit + $i++; } - $i++; } // check for a rest $last = end($args); if ($last[0] == "rest") { - $rest = array_slice($values, count($args) - 1); + $rest = array_slice($orderedValues, count($args) - 1); $this->set($last[1], $this->reduce(array("list", " ", $rest))); } - $this->env->arguments = $assignedValues; + // wow is this the only true use of PHP's + operator for arrays? + $this->env->arguments = $assignedValues + $orderedValues; } // compile a prop and update $lines or $blocks appropriately @@ -624,8 +660,28 @@ class lessc { case 'mixin': list(, $path, $args, $suffix) = $prop; - $args = array_map(array($this, "reduce"), (array)$args); - $mixins = $this->findBlocks($block, $path, $args); + $orderedArgs = array(); + $keywordArgs = array(); + foreach ((array)$args as $arg) { + $argval = null; + switch ($arg[0]) { + case "arg": + if (!isset($arg[2])) { + $orderedArgs[] = $this->reduce(array("variable", $arg[1])); + } else { + $keywordArgs[$arg[1]] = $this->reduce($arg[2]); + } + break; + + case "lit": + $orderedArgs[] = $this->reduce($arg[1]); + break; + default: + $this->throwError("Unknown arg type: " . $arg[0]); + } + } + + $mixins = $this->findBlocks($block, $path, $orderedArgs, $keywordArgs); if ($mixins === null) { // fwrite(STDERR,"failed to find block: ".implode(" > ", $path)."\n"); @@ -633,6 +689,10 @@ class lessc { } foreach ($mixins as $mixin) { + if ($mixin === $block && !$orderedArgs) { + continue; + } + $haveScope = false; if (isset($mixin->parent->scope)) { $haveScope = true; @@ -644,7 +704,7 @@ class lessc { if (isset($mixin->args)) { $haveArgs = true; $this->pushEnv(); - $this->zipSetArgs($mixin->args, $args); + $this->zipSetArgs($mixin->args, $orderedArgs, $keywordArgs); } $oldParent = $mixin->parent; @@ -701,7 +761,9 @@ class lessc { list(,$importId) = $prop; $import = $this->env->imports[$importId]; if ($import[0] === false) { - $out->lines[] = $import[1]; + if (isset($import[1])) { + $out->lines[] = $import[1]; + } } else { list(, $bottom, $parser, $importDir) = $import; $this->compileImportedProps($bottom, $block, $out, $parser, $importDir); @@ -789,6 +851,60 @@ class lessc { } } + protected function lib_pow($args) { + list($base, $exp) = $this->assertArgs($args, 2, "pow"); + return pow($this->assertNumber($base), $this->assertNumber($exp)); + } + + protected function lib_pi() { + return pi(); + } + + protected function lib_mod($args) { + list($a, $b) = $this->assertArgs($args, 2, "mod"); + return $this->assertNumber($a) % $this->assertNumber($b); + } + + protected function lib_tan($num) { + return tan($this->assertNumber($num)); + } + + protected function lib_sin($num) { + return sin($this->assertNumber($num)); + } + + protected function lib_cos($num) { + return cos($this->assertNumber($num)); + } + + protected function lib_atan($num) { + $num = atan($this->assertNumber($num)); + return array("number", $num, "rad"); + } + + protected function lib_asin($num) { + $num = asin($this->assertNumber($num)); + return array("number", $num, "rad"); + } + + protected function lib_acos($num) { + $num = acos($this->assertNumber($num)); + return array("number", $num, "rad"); + } + + protected function lib_sqrt($num) { + return sqrt($this->assertNumber($num)); + } + + protected function lib_extract($value) { + list($list, $idx) = $this->assertArgs($value, 2, "extract"); + $idx = $this->assertNumber($idx); + // 1 indexed + if ($list[0] == "list" && isset($list[2][$idx - 1])) { + return $list[2][$idx - 1]; + } + } + protected function lib_isnumber($value) { return $this->toBool($value[0] == "number"); } @@ -1013,19 +1129,24 @@ class lessc { } // mixes two colors by weight - // mix(@color1, @color2, @weight); + // mix(@color1, @color2, [@weight: 50%]); // http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html#mix-instance_method protected function lib_mix($args) { - if ($args[0] != "list" || count($args[2]) < 3) + if ($args[0] != "list" || count($args[2]) < 2) $this->throwError("mix expects (color1, color2, weight)"); - list($first, $second, $weight) = $args[2]; + list($first, $second) = $args[2]; $first = $this->assertColor($first); $second = $this->assertColor($second); $first_a = $this->lib_alpha($first); $second_a = $this->lib_alpha($second); - $weight = $weight[1] / 100.0; + + if (isset($args[2][2])) { + $weight = $args[2][2][1] / 100.0; + } else { + $weight = 0.5; + } $w = $weight * 2 - 1; $a = $first_a - $second_a; @@ -1076,6 +1197,25 @@ class lessc { $this->throwError($error); } + protected function assertArgs($value, $expectedArgs, $name="") { + if ($expectedArgs == 1) { + return $value; + } else { + if ($value[0] !== "list" || $value[1] != ",") $this->throwError("expecting list"); + $values = $value[2]; + $numValues = count($values); + if ($expectedArgs != $numValues) { + if ($name) { + $name = $name . ": "; + } + + $this->throwError("${name}expecting $expectedArgs arguments, got $numValues"); + } + + return $values; + } + } + protected function toHSL($color) { if ($color[0] == 'hsl') return $color; @@ -1220,6 +1360,10 @@ class lessc { $var = $this->compileValue($reduced); $res = $this->reduce(array("variable", $this->vPrefix . $var)); + if ($res[0] == "raw_color") { + $res = $this->coerceColor($res); + } + if (empty($value[2])) $res = $this->lib_e($res); return $res; @@ -1681,7 +1825,6 @@ class lessc { $this->importDir = (array)$this->importDir; $this->importDir[] = $pi['dirname'].'/'; - $this->allParsedFiles = array(); $this->addParsedFile($fname); $out = $this->compile(file_get_contents($fname), $fname); @@ -2065,7 +2208,7 @@ class lessc_parser { static protected $supressDivisionProps = array('/border-radius$/i', '/^font$/i'); - protected $blockDirectives = array("font-face", "keyframes", "page", "-moz-document"); + protected $blockDirectives = array("font-face", "keyframes", "page", "-moz-document", "viewport", "-moz-viewport", "-o-viewport", "-ms-viewport"); protected $lineDirectives = array("charset"); /** @@ -2304,7 +2447,7 @@ class lessc_parser { // mixin if ($this->mixinTags($tags) && - ($this->argumentValues($argv) || true) && + ($this->argumentDef($argv, $isVararg) || true) && ($this->keyword($suffix) || true) && $this->end()) { $tags = $this->fixTags($tags); @@ -2653,7 +2796,6 @@ class lessc_parser { } if (!empty($rejectStrs) && in_array($tok, $rejectStrs)) { - $ount = null; break; } @@ -2773,38 +2915,18 @@ class lessc_parser { return false; } - // consume a list of property values delimited by ; and wrapped in () - protected function argumentValues(&$args, $delim = ',') { - $s = $this->seek(); - if (!$this->literal('(')) return false; - - $values = array(); - while (true) { - if ($this->expressionList($value)) $values[] = $value; - if (!$this->literal($delim)) break; - else { - if ($value == null) $values[] = null; - $value = null; - } - } - - if (!$this->literal(')')) { - $this->seek($s); - return false; - } - - $args = $values; - return true; - } - // consume an argument definition list surrounded by () // each argument is a variable name with optional value // or at the end a ... or a variable named followed by ... - protected function argumentDef(&$args, &$isVararg, $delim = ',') { + // arguments are separated by , unless a ; is in the list, then ; is the + // delimiter. + protected function argumentDef(&$args, &$isVararg) { $s = $this->seek(); if (!$this->literal('(')) return false; $values = array(); + $delim = ","; + $method = "expressionList"; $isVararg = false; while (true) { @@ -2813,28 +2935,77 @@ class lessc_parser { break; } - if ($this->variable($vname)) { - $arg = array("arg", $vname); - $ss = $this->seek(); - if ($this->assign() && $this->expressionList($value)) { - $arg[] = $value; - } else { - $this->seek($ss); - if ($this->literal("...")) { - $arg[0] = "rest"; - $isVararg = true; + if ($this->$method($value)) { + if ($value[0] == "variable") { + $arg = array("arg", $value[1]); + $ss = $this->seek(); + + if ($this->assign() && $this->$method($rhs)) { + $arg[] = $rhs; + } else { + $this->seek($ss); + if ($this->literal("...")) { + $arg[0] = "rest"; + $isVararg = true; + } } + + $values[] = $arg; + if ($isVararg) break; + continue; + } else { + $values[] = array("lit", $value); } - $values[] = $arg; - if ($isVararg) break; - continue; } - if ($this->value($literal)) { - $values[] = array("lit", $literal); - } - if (!$this->literal($delim)) break; + if (!$this->literal($delim)) { + if ($delim == "," && $this->literal(";")) { + // found new delim, convert existing args + $delim = ";"; + $method = "propertyValue"; + + // transform arg list + if (isset($values[1])) { // 2 items + $newList = array(); + foreach ($values as $i => $arg) { + switch($arg[0]) { + case "arg": + if ($i) { + $this->throwError("Cannot mix ; and , as delimiter types"); + } + $newList[] = $arg[2]; + break; + case "lit": + $newList[] = $arg[1]; + break; + case "rest": + $this->throwError("Unexpected rest before semicolon"); + } + } + + $newList = array("list", ", ", $newList); + + switch ($values[0][0]) { + case "arg": + $newArg = array("arg", $values[0][1], $newList); + break; + case "lit": + $newArg = array("lit", $newList); + break; + } + + } elseif ($values) { // 1 item + $newArg = $values[0]; + } + + if ($newArg) { + $values = array($newArg); + } + } else { + break; + } + } } if (!$this->literal(')')) { @@ -2876,32 +3047,69 @@ class lessc_parser { } // a bracketed value (contained within in a tag definition) - protected function tagBracket(&$value) { + protected function tagBracket(&$parts, &$hasExpression) { // speed shortcut if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] != "[") { return false; } $s = $this->seek(); - if ($this->literal('[') && $this->to(']', $c, true) && $this->literal(']', false)) { - $value = '['.$c.']'; - // whitespace? - if ($this->whitespace()) $value .= " "; - // escape parent selector, (yuck) - $value = str_replace($this->lessc->parentSelector, "$&$", $value); - return true; - } + $hasInterpolation = false; - $this->seek($s); - return false; - } + if ($this->literal("[", false)) { + $attrParts = array("["); + // keyword, string, operator + while (true) { + if ($this->literal("]", false)) { + $this->count--; + break; // get out early + } - protected function tagExpression(&$value) { - $s = $this->seek(); - if ($this->literal("(") && $this->expression($exp) && $this->literal(")")) { - $value = array('exp', $exp); - return true; + if ($this->match('\s+', $m)) { + $attrParts[] = " "; + continue; + } + if ($this->string($str)) { + // escape parent selector, (yuck) + foreach ($str[2] as &$chunk) { + $chunk = str_replace($this->lessc->parentSelector, "$&$", $chunk); + } + + $attrParts[] = $str; + $hasInterpolation = true; + continue; + } + + if ($this->keyword($word)) { + $attrParts[] = $word; + continue; + } + + if ($this->interpolation($inter, false)) { + $attrParts[] = $inter; + $hasInterpolation = true; + continue; + } + + // operator, handles attr namespace too + if ($this->match('[|-~\$\*\^=]+', $m)) { + $attrParts[] = $m[0]; + continue; + } + + break; + } + + if ($this->literal("]", false)) { + $attrParts[] = "]"; + foreach ($attrParts as $part) { + $parts[] = $part; + } + $hasExpression = $hasExpression || $hasInterpolation; + return true; + } + $this->seek($s); } $this->seek($s); @@ -2917,13 +3125,9 @@ class lessc_parser { $s = $this->seek(); - if (!$simple && $this->tagExpression($tag)) { - return true; - } - $hasExpression = false; $parts = array(); - while ($this->tagBracket($first)) $parts[] = $first; + while ($this->tagBracket($parts, $hasExpression)); $oldWhite = $this->eatWhiteDefault; $this->eatWhiteDefault = false; @@ -2933,9 +3137,7 @@ class lessc_parser { $parts[] = $m[1]; if ($simple) break; - while ($this->tagBracket($brack)) { - $parts[] = $brack; - } + while ($this->tagBracket($parts, $hasExpression)); continue; } @@ -3062,7 +3264,7 @@ class lessc_parser { protected function end() { if ($this->literal(';')) { return true; - } elseif ($this->count == strlen($this->buffer) || $this->buffer{$this->count} == '}') { + } elseif ($this->count == strlen($this->buffer) || $this->buffer[$this->count] == '}') { // if there is end of file or a closing block next then we don't need a ; return true; } @@ -3326,7 +3528,7 @@ class lessc_parser { break; case '"': case "'": - if (preg_match('/'.$min[0].'.*?'.$min[0].'/', $text, $m, 0, $count)) + if (preg_match('/'.$min[0].'.*?(?, 2012 - -$exe = array_shift($argv); // remove filename - -$HELP = << 0 && preg_match('/^-([-hvrwncXT]$|[f]=)/', $argv[0])) { - array_shift($argv); -} - -function has() { - global $opts; - foreach (func_get_args() as $arg) { - if (isset($opts[$arg])) return true; - } - return false; -} - -if (has("h", "help")) { - exit($HELP); -} - -error_reporting(E_ALL); -$path = realpath(dirname(__FILE__)).'/'; - -require $path."lessc.inc.php"; - -$VERSION = lessc::$VERSION; - -$fa = "Fatal Error: "; -function err($msg) { - fwrite(STDERR, $msg."\n"); -} - -if (php_sapi_name() != "cli") { - err($fa.$argv[0]." must be run in the command line."); - exit(1); -} - -function make_less($fname = null) { - global $opts; - $l = new lessc($fname); - - if (has("f")) { - $format = $opts["f"]; - if ($format != "default") $l->setFormatter($format); - } - - if (has("c")) { - $l->setPreserveComments(true); - } - - return $l; -} - -function process($data, $import = null) { - global $fa; - - $l = make_less(); - if ($import) $l->importDir = $import; - - try { - echo $l->parse($data); - exit(0); - } catch (exception $ex) { - err($fa."\n".str_repeat('=', 20)."\n". - $ex->getMessage()); - exit(1); - } -} - -if (has("v")) { - exit($VERSION."\n"); -} - -if (has("r")) { - if (!empty($argv)) { - $data = $argv[0]; - } else { - $data = ""; - while (!feof(STDIN)) { - $data .= fread(STDIN, 8192); - } - } - exit(process($data)); -} - -if (has("w")) { - // need two files - if (!is_file($in = array_shift($argv)) || - null == $out = array_shift($argv)) - { - err($fa.$exe." -w infile outfile"); - exit(1); - } - - echo "Watching ".$in. - (has("n") ? ' with notifications' : ''). - ", press Ctrl + c to exit.\n"; - - $cache = $in; - $last_action = 0; - while (true) { - clearstatcache(); - - // check if anything has changed since last fail - $updated = false; - if (is_array($cache)) { - foreach ($cache['files'] as $fname=>$_) { - if (filemtime($fname) > $last_action) { - $updated = true; - break; - } - } - } else $updated = true; - - // try to compile it - if ($updated) { - $last_action = time(); - - try { - $cache = lessc::cexecute($cache); - echo "Writing updated file: ".$out."\n"; - if (!file_put_contents($out, $cache['compiled'])) { - err($fa."Could not write to file ".$out); - exit(1); - } - } catch (exception $ex) { - echo "\nFatal Error:\n".str_repeat('=', 20)."\n". - $ex->getMessage()."\n\n"; - - if (has("n")) { - `notify-send -u critical "compile failed" "{$ex->getMessage()}"`; - } - } - } - - sleep(1); - } - exit(0); -} - -if (!$fname = array_shift($argv)) { - echo $HELP; - exit(1); -} - -function dumpValue($node, $depth = 0) { - if (is_object($node)) { - $indent = str_repeat(" ", $depth); - $out = array(); - foreach ($node->props as $prop) { - $out[] = $indent . dumpValue($prop, $depth + 1); - } - $out = implode("\n", $out); - if (!empty($node->tags)) { - $out = "+ ".implode(", ", $node->tags)."\n".$out; - } - return $out; - } elseif (is_array($node)) { - if (empty($node)) return "[]"; - $type = $node[0]; - if ($type == "block") - return dumpValue($node[1], $depth); - - $out = array(); - foreach ($node as $value) { - $out[] = dumpValue($value, $depth); - } - return "{ ".implode(", ", $out)." }"; - } else { - if (is_string($node) && preg_match("/[\s,]/", $node)) { - return '"'.$node.'"'; - } - return $node; // normal value - } -} - - -function stripValue($o, $toStrip) { - if (is_array($o) || is_object($o)) { - $isObject = is_object($o); - $o = (array)$o; - foreach ($toStrip as $removeKey) { - if (!empty($o[$removeKey])) { - $o[$removeKey] = "*stripped*"; - } - } - - foreach ($o as $k => $v) { - $o[$k] = stripValue($v, $toStrip); - } - - if ($isObject) { - $o = (object)$o; - } - } - - return $o; -} - -function dumpWithoutParent($o, $alsoStrip=array()) { - $toStrip = array_merge(array("parent"), $alsoStrip); - print_r(stripValue($o, $toStrip)); -} - -try { - $less = make_less($fname); - if (has("T", "X")) { - $parser = new lessc_parser($less, $fname); - $tree = $parser->parse(file_get_contents($fname)); - if (has("X")) - $out = print_r($tree, 1); - else - $out = dumpValue($tree)."\n"; - } else { - $out = $less->parse(); - } - - if (!$fout = array_shift($argv)) { - echo $out; - } else { - file_put_contents($fout, $out); - } - -} catch (exception $ex) { - err($fa.$ex->getMessage()); - exit(1); -} - -?> diff --git a/library/vendor/lessphp/tests/ApiTest.php b/library/vendor/lessphp/tests/ApiTest.php deleted file mode 100644 index 3725dd56c..000000000 --- a/library/vendor/lessphp/tests/ApiTest.php +++ /dev/null @@ -1,189 +0,0 @@ -less = new lessc(); - $this->less->importDir = array(__DIR__ . "/inputs/test-imports"); - } - - public function testPreserveComments() { - $input = <<assertEquals($this->compile($input), trim($outputWithoutComments)); - $this->less->setPreserveComments(true); - $this->assertEquals($this->compile($input), trim($outputWithComments)); - } - - public function testOldInterface() { - $this->less = new lessc(__DIR__ . "/inputs/hi.less"); - $out = $this->less->parse(array("hello" => "10px")); - $this->assertEquals(trim($out), trim(' -div:before { - content: "hi!"; -}')); - - } - - public function testInjectVars() { - $out = $this->less->parse(".magic { color: @color; width: @base - 200; }", - array( - 'color' => 'red', - 'base' => '960px' - )); - - $this->assertEquals(trim($out), trim(" -.magic { - color: red; - width: 760px; -}")); - - } - - public function testDisableImport() { - $this->less->importDisabled = true; - $this->assertEquals( - "/* import disabled */", - $this->compile("@import 'file3';")); - } - - public function testUserFunction() { - $this->less->registerFunction("add-two", function($list) { - list($a, $b) = $list[2]; - return $a[1] + $b[1]; - }); - - $this->assertEquals( - $this->compile("result: add-two(10, 20);"), - "result: 30;"); - - return $this->less; - } - - /** - * @depends testUserFunction - */ - public function testUnregisterFunction($less) { - $less->unregisterFunction("add-two"); - - $this->assertEquals( - $this->compile("result: add-two(10, 20);"), - "result: add-two(10,20);"); - } - - - - public function testFormatters() { - $src = " - div, pre { - color: blue; - span, .big, hello.world { - height: 20px; - color:#ffffff + #000; - } - }"; - - $this->less->setFormatter("compressed"); - $this->assertEquals( - $this->compile($src), "div,pre{color:blue;}div span,div .big,div hello.world,pre span,pre .big,pre hello.world{height:20px;color:#fff;}"); - - // TODO: fix the output order of tags - $this->less->setFormatter("lessjs"); - $this->assertEquals( - $this->compile($src), -"div, -pre { - color: blue; -} -div span, -div .big, -div hello.world, -pre span, -pre .big, -pre hello.world { - height: 20px; - color: #ffffff; -}"); - - $this->less->setFormatter("classic"); - $this->assertEquals( - $this->compile($src), -trim("div, pre { color:blue; } -div span, div .big, div hello.world, pre span, pre .big, pre hello.world { - height:20px; - color:#ffffff; -} -")); - - } - - public function compile($str) { - return trim($this->less->parse($str)); - } - -} diff --git a/library/vendor/lessphp/tests/InputTest.php b/library/vendor/lessphp/tests/InputTest.php deleted file mode 100644 index cb0e82f09..000000000 --- a/library/vendor/lessphp/tests/InputTest.php +++ /dev/null @@ -1,71 +0,0 @@ -less = new lessc(); - $this->less->importDir = array(__DIR__ . "/" . self::$inputDir . "/test-imports"); - } - - /** - * @dataProvider fileNameProvider - */ - public function testInputFile($inFname) { - if ($pattern = getenv("BUILD")) { - return $this->buildInput($inFname); - } - - $outFname = self::outputNameFor($inFname); - - if (!is_readable($outFname)) { - $this->fail("$outFname is missing, ". - "consider building tests with BUILD=true"); - } - - $input = file_get_contents($inFname); - $output = file_get_contents($outFname); - - $this->assertEquals($output, $this->less->parse($input)); - } - - public function fileNameProvider() { - return array_map(function($a) { return array($a); }, - self::findInputNames()); - } - - // only run when env is set - public function buildInput($inFname) { - $css = $this->less->parse(file_get_contents($inFname)); - file_put_contents(self::outputNameFor($inFname), $css); - } - - static public function findInputNames($pattern="*.less") { - $files = glob(__DIR__ . "/" . self::$inputDir . "/" . $pattern); - return array_filter($files, "is_file"); - } - - static public function outputNameFor($input) { - $front = _quote(__DIR__ . "/"); - $out = preg_replace("/^$front/", "", $input); - - $in = _quote(self::$inputDir . "/"); - $out = preg_replace("/$in/", self::$outputDir . "/", $out); - $out = preg_replace("/.less$/", ".css", $out); - - return __DIR__ . "/" . $out; - } -} diff --git a/library/vendor/lessphp/tests/README.md b/library/vendor/lessphp/tests/README.md deleted file mode 100644 index 1f7e04301..000000000 --- a/library/vendor/lessphp/tests/README.md +++ /dev/null @@ -1,13 +0,0 @@ -lessphp uses [phpunit](https://github.com/sebastianbergmann/phpunit/) for it's tests - -`InputTest.php` iterates through all the less files in `inputs/`, compiles them, -then compares the result with the respective file in `outputs/`. - -From the root you can run `make` to run all the tests. - -## bootstrap.sh - -Clones twitter bootsrap, compiles it with lessc and lessphp, cleans up results -with sort.php, and outputs diff. To run it, you need to have git and lessc -installed. - diff --git a/library/vendor/lessphp/tests/bootstrap.sh b/library/vendor/lessphp/tests/bootstrap.sh deleted file mode 100755 index db0ae3a20..000000000 --- a/library/vendor/lessphp/tests/bootstrap.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -echo "This script clones Twitter Bootstrap, compiles it with lessc and lessphp," -echo "cleans up results with sort.php, and outputs diff. To run it, you need to" -echo "have git and lessc installed." -echo "" - -if [ -z "$input" ]; then - input="bootstrap/less/bootstrap.less" -fi -dest=$(basename "$input") -dest="${dest%.*}" - -if [ -z "$@" ]; then - diff_tool="diff -b -u -t -B" -else - diff_tool=$@ -fi - -mkdir -p tmp - -if [ ! -d 'bootstrap/' ]; then - echo ">> Cloning bootstrap to bootstrap/" - git clone https://github.com/twitter/bootstrap -fi - -echo ">> lessc compilation ($input)" -lessc "$input" "tmp/$dest.lessc.css" - -echo ">> lessphp compilation ($input)" -../plessc "$input" "tmp/$dest.lessphp.css" -echo ">> Cleanup and convert" - -php sort.php "tmp/$dest.lessc.css" > "tmp/$dest.lessc.clean.css" -php sort.php "tmp/$dest.lessphp.css" > "tmp/$dest.lessphp.clean.css" - -echo ">> Doing diff" -$diff_tool "tmp/$dest.lessc.clean.css" "tmp/$dest.lessphp.clean.css" diff --git a/library/vendor/lessphp/tests/inputs/accessors.less.disable b/library/vendor/lessphp/tests/inputs/accessors.less.disable deleted file mode 100644 index 37f5c8e8b..000000000 --- a/library/vendor/lessphp/tests/inputs/accessors.less.disable +++ /dev/null @@ -1,36 +0,0 @@ -/* accessors */ - -#defaults { - @width: 960px; - @color: black; - .something { - @space: 10px; - @hello { - color: green; - } - } -} - -.article { color: #294366; } - -.comment { - width: #defaults[@width]; - color: .article['color']; - padding: #defaults > .something[@space]; -} - -.wow { - height: .comment['width']; - background-color: .comment['color']; - color: #defaults > .something > @hello['color']; - - padding: #defaults > non-existant['padding']; - margin: #defaults > .something['non-existant']; -} - -.mix { - #defaults; - font-size: .something[@space]; -} - - diff --git a/library/vendor/lessphp/tests/inputs/arity.less b/library/vendor/lessphp/tests/inputs/arity.less deleted file mode 100644 index a3adad612..000000000 --- a/library/vendor/lessphp/tests/inputs/arity.less +++ /dev/null @@ -1,77 +0,0 @@ - -// simple arity - -.hello(@a) { - color: one; -} - -.hello(@a, @b) { - color: two; -} - -.hello(@a, @b, @c) { - color: three; -} - - -.world(@a, @b, @c) { - color: three; -} - -.world(@a, @b) { - color: two; -} - -.world(@a) { - color: one; -} - -.one { - .hello(1); - .world(1); -} - -.two { - .hello(1, 1); - .world(1, 1); -} - -.three { - .hello(1, 1, 1); - .world(1, 1, 1); -} - - -// arity with default values - -.foo(@a, @b: cool) { - color: two; -} - -.foo(@a, @b: cool, @c: yeah) { - color: three; -} - - -.baz(@a, @b, @c: yeah) { - color: three; -} - -.baz(@a, @b: cool) { - color: two; -} - - -.multi-foo { - .foo(1); - .foo(1, 1); - .foo(1,1,1); -} - -.multi-baz { - .baz(1); - .baz(1, 1); - .baz(1,1,1); -} - - diff --git a/library/vendor/lessphp/tests/inputs/attributes.less b/library/vendor/lessphp/tests/inputs/attributes.less deleted file mode 100644 index 7ede4fc4e..000000000 --- a/library/vendor/lessphp/tests/inputs/attributes.less +++ /dev/null @@ -1,41 +0,0 @@ -* { color: blue; } -E { color: blue; } -E[foo] { color: blue; } -[foo] { color: blue; } -[foo] .helloWorld { color: blue; } -[foo].helloWorld { color: blue; } -E[foo="barbar"] { color: blue; } -E[foo~="hello#$@%@$#^"] { color: blue; } -E[foo^="color: green;"] { color: blue; } -E[foo$="239023"] { color: blue; } -E[foo*="29302"] { color: blue; } -E[foo|="239032"] { color: blue; } -E:root { color: blue; } - -E:nth-child(odd) { color: blue; } -E:nth-child(2n+1) { color: blue; } -E:nth-child(5) { color: blue; } -E:nth-last-child(-n+2) { color: blue; } -E:nth-of-type(2n) { color: blue; } -E:nth-last-of-type(n) { color: blue; } - -E:first-child { color: blue; } -E:last-child { color: blue; } -E:first-of-type { color: blue; } -E:last-of-type { color: blue; } -E:only-child { color: blue; } -E:only-of-type { color: blue; } -E:empty { color: blue; } - -E:lang(en) { color: blue; } -E::first-line { color: blue; } -E::before { color: blue; } - -E#id { color: blue; } -E:not(:link) { color: blue; } - -E F { color: blue; } -E > F { color: blue; } -E + F { color: blue; } -E ~ F { color: blue; } - diff --git a/library/vendor/lessphp/tests/inputs/builtins.less b/library/vendor/lessphp/tests/inputs/builtins.less deleted file mode 100644 index f0ce68a7f..000000000 --- a/library/vendor/lessphp/tests/inputs/builtins.less +++ /dev/null @@ -1,73 +0,0 @@ -// builtin - -@something: "hello world"; -@color: #112233; -@color2: rgba(44,55,66, .6); - -body { - color: @something; - - @num: 7 / 6; - height: @num + 4; - height: floor(@num) + 4px; - height: ceil(@num) + 4px; - - @num2: 2 / 3; - width: @num2; - width: round(@num2); - width: floor(@num2); - width: ceil(@num2); - width: round(10px / 3); - - color: rgbahex(@color); - color: rgbahex(@color2); - color: argb(@color2); -} - - -format { - @r: 32; - format: %("rgb(%d, %d, %d)", @r, 128, 64); - format-string: %("hello %s", "world"); - format-multiple: %("hello %s %d", "earth", 2); - format-url-encode: %('red is %A', #ff0000); - eformat: e(%("rgb(%d, %d, %d)", @r, 128, 64)); -} - - -#functions { - str: isstring("hello"); - str: isstring(one, two); - - num: isnumber(2323px); - num: isnumber(2323); - num: isnumber(4/5); - num: isnumber("hello"); - - col: iscolor(red); - col: iscolor(hello); - col: iscolor(rgba(0,0,0,0.3)); - col: iscolor(#fff); - - key: iskeyword(hello); - key: iskeyword(3D); - - px: ispixel(10px); - px: ispixel(10); - - per: ispercentage(10%); - per: ispercentage(10); - - em: isem(10em); - em: isem(10); -} - - -#unit { - @unit: "em"; - height: unit(10px); - height: unit(10px, "s"); - height: unit(10px, @unit); - height: unit(0.07407s) * 100%; -} - diff --git a/library/vendor/lessphp/tests/inputs/colors.less b/library/vendor/lessphp/tests/inputs/colors.less deleted file mode 100644 index c9f3d14d3..000000000 --- a/library/vendor/lessphp/tests/inputs/colors.less +++ /dev/null @@ -1,153 +0,0 @@ - -body { - color:rgb(red(#f00), red(#0F0), red(#00f)); - color:rgb(red(#f00), green(#0F0), blue(#00f)); - color:rgb(red(#0ff), green(#f0f), blue(#ff0)); - - color: hsl(34, 50%, 40%); - color: hsla(34, 50%, 40%, 0.3); - - lighten: lighten(#efefef, 10%); - lighten: lighten(rgb(23, 53, 231), 22%); - lighten: lighten(rgba(212, 103, 88, 0.5), 10%); - - darken: darken(#efefef, 10%); - darken: darken(rgb(23, 53, 231), 22%); - darken: darken(rgba(23, 53, 231, 0.5), 10%); - - saturate: saturate(#efefef, 10%); - saturate: saturate(rgb(23, 53, 231), 22%); - saturate: saturate(rgba(23, 53, 231, 0.5), 10%); - - desaturate: desaturate(#efefef, 10%); - desaturate: desaturate(rgb(23, 53, 231), 22%); - desaturate: desaturate(rgba(23, 53, 231, 0.5), 10%); - - spin: spin(#efefef, 12); - spin: spin(rgb(23, 53, 231), 15); - spin: spin(rgba(23, 53, 231, 0.5), 19); - - spin: spin(#efefef, -12); - spin: spin(rgb(23, 53, 231), -15); - spin: spin(rgba(23, 53, 231, 0.5), -19); - - one: fadein(#abcdef, 10%); - one: fadeout(#abcdef, -10%); - - two: fadeout(#029f23, 10%); - two: fadein(#029f23, -10%); - - - three: fadein(rgba(1,2,3, 0.5), 10%); - three: fadeout(rgba(1,2,3, 0.5), -10%); - - four: fadeout(rgba(1,2,3, 0), 10%); - four: fadein(rgba(1,2,3, 0), -10%); - - hue: hue(rgb(34,20,40)); - sat: saturation(rgb(34,20,40)); - lit: lightness(rgb(34,20,40)); - - @old: #34fa03; - @new: hsl(hue(@old), 45%, 90%); - what: @new; - - zero: saturate(#123456, -100%); - zero: saturate(#123456, 100%); - zero: saturate(#000000, 100%); - zero: saturate(#ffffff, 100%); - - zero: lighten(#123456, -100%); - zero: lighten(#123456, 100%); - zero: lighten(#000000, 100%); - zero: lighten(#ffffff, 100%); - - zero: spin(#123456, -100); - zero: spin(#123456, 100); - zero: spin(#000000, 100); - zero: spin(#ffffff, 100); -} - - -alpha { - // g: alpha(red); - g: alpha(rgba(0,0,0,0)); - g: alpha(rgb(155,55,0)); -} - -fade { - f: fade(red, 50%); - f: fade(#fff, 20%); - f: fade(rgba(34,23,64,0.4), 50%); -} - -@a: rgb(255,255,255); -@b: rgb(0,0,0); - -.mix { - color: mix(@a, @b, 50%); - color: mix(rgba(5,3,1,0.3), rgba(6,3,2, 0.8), 50%); -} - -.contrast { - color: contrast(#000, red, blue); - color: contrast(#fff, red, blue); -} - -.percent { - per: percentage(0.5); -} - -// color keywords - -.colorz { - color: whitesmoke - 10; - color: spin(red, 34); - color: spin(blah); -} - - - -// purposfuly whacky to match less.js - -@color: #fcf8e3; - -body { - start: @color; - spin: spin(@color, -10); // #fcf4e3 - chained: darken(spin(@color, -10), 3%); // gives #fbeed5, should be #fbefd5 - direct: darken(#fcf4e3, 3%); // #fbefd5 -} - -// spin around -pre { - @errorBackground: #f2dede; - spin: spin(@errorBackground, -10); -} - -dd { - @white: #fff; - background-color: mix(@white, darken(@white, 10%), 60%); -} - -// math - -.ops { - c: red * 0.3; - c: green / 2; - c: purple % 7; - c: 4 * salmon; - c: 1 + salmon; - - c: 132 / red; - c: 132 - red; - c: 132- red; -} - -.transparent { - r: red(transparent); - g: green(transparent); - b: blue(transparent); - a: alpha(transparent); -} - diff --git a/library/vendor/lessphp/tests/inputs/compile_on_mixin.less b/library/vendor/lessphp/tests/inputs/compile_on_mixin.less deleted file mode 100644 index 79d628f49..000000000 --- a/library/vendor/lessphp/tests/inputs/compile_on_mixin.less +++ /dev/null @@ -1,39 +0,0 @@ - -@mixin { - height: 22px; - ul { - height: 20px; - li { - @color: red; - height: 10px; - div span, link { - margin: 10px; - color: @color; - } - } - - div, p { - border: 1px; - &.hello { - color: green; - } - - :what { - color: blue; - } - } - - - a { - b { - color: blue; - } - } - } -} - - - -body { - @mixin; -} diff --git a/library/vendor/lessphp/tests/inputs/directives.less b/library/vendor/lessphp/tests/inputs/directives.less deleted file mode 100644 index 27d29ae29..000000000 --- a/library/vendor/lessphp/tests/inputs/directives.less +++ /dev/null @@ -1,15 +0,0 @@ - -@hello: "utf-8"; -@charset @hello; - -@-moz-document url-prefix(){ - div { - color: red; - } -} - -@page :left { margin-left: 4cm; } -@page :right { margin-left: 3cm; } -@page { margin: 2cm } - - diff --git a/library/vendor/lessphp/tests/inputs/escape.less b/library/vendor/lessphp/tests/inputs/escape.less deleted file mode 100644 index 02d92d6f0..000000000 --- a/library/vendor/lessphp/tests/inputs/escape.less +++ /dev/null @@ -1,20 +0,0 @@ - -body { - @hello: "world"; - border: e("this is simple"); - border: e(this is simple); // bug in lessjs - border: e("this is simple", "cool lad"); - border: e(1232); - border: e(@hello); - border: e("one" + 'more'); // no string addition lessjs - border: e(); // syntax error lessjs - - line-height: ~"eating rice"; - line-height: ~"string cheese"; - line-height: a b c ~"string me" d e f; - line-height: ~"string @{hello}"; -} - -.class { - filter: ~"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.png')"; -} diff --git a/library/vendor/lessphp/tests/inputs/font_family.less b/library/vendor/lessphp/tests/inputs/font_family.less deleted file mode 100644 index c7186b57b..000000000 --- a/library/vendor/lessphp/tests/inputs/font_family.less +++ /dev/null @@ -1,28 +0,0 @@ - -@font-directory: 'fonts/'; -@some-family: Gentium; - -@font-face: maroon; // won't collide with @font-face { } - -@font-face { - font-family: Graublau Sans Web; - src: url(@{font-directory}GraublauWeb.otf) format("opentype"); -} - -@font-face { - font-family: @some-family; - src: url('@{font-directory}Gentium.ttf'); -} - -@font-face { - font-family: @some-family; - src: url("@{font-directory}GentiumItalic.ttf"); - font-style: italic; -} - -h2 { - font-family: @some-family; - crazy: @font-face; -} - - diff --git a/library/vendor/lessphp/tests/inputs/guards.less b/library/vendor/lessphp/tests/inputs/guards.less deleted file mode 100644 index 20bdf240e..000000000 --- a/library/vendor/lessphp/tests/inputs/guards.less +++ /dev/null @@ -1,88 +0,0 @@ - -.simple(@hi) when (@hi) { - color: yellow; -} - - -.something(@hi) when (@hi = cool) { - color: red; -} - -.another(@x) when (@x > 10) { - color: green; -} - - -.flipped(@x) when (@x =< 10) { - color: teal; -} - -.yeah(@arg) when (isnumber(@arg)) { - color: purple; -} - - -.yeah(@arg) when (ispixel(@arg)) { - color: silver; -} - - -.hello(@arg) when not (@arg) { - color: orange; -} - -dd { - .simple(true); - .simple(2344px); -} - -b { - .something(cool); - .something(birthday); -} - -img { - .another(12); - .another(2); - - .flipped(12); - .flipped(2); -} - -body { - .yeah("world"); - .yeah(232px); - .yeah(232); - - .hello(true); -} - -.something(@x) when (@x) and (@y), not (@x = what) { - color: blue; -} - -div { - @y: true; - .something(true); - -} - -pre { - .something(what); -} - - -.coloras(@g) when (iscolor(@g)) { - color: true @g; -} - -link { - .coloras(red); - .coloras(10px); - .coloras(ffjref); - .coloras(#fff); - .coloras(#fffddd); - .coloras(rgb(0,0,0)); - .coloras(rgba(0,0,0, .34)); -} - diff --git a/library/vendor/lessphp/tests/inputs/hacks.less b/library/vendor/lessphp/tests/inputs/hacks.less deleted file mode 100644 index e69b7bf98..000000000 --- a/library/vendor/lessphp/tests/inputs/hacks.less +++ /dev/null @@ -1,6 +0,0 @@ -// css hacks - -:root .alert-message, :root .btn { - border-radius: 0 \0; -} - diff --git a/library/vendor/lessphp/tests/inputs/hi.less b/library/vendor/lessphp/tests/inputs/hi.less deleted file mode 100644 index 9a3d8198a..000000000 --- a/library/vendor/lessphp/tests/inputs/hi.less +++ /dev/null @@ -1,5 +0,0 @@ - -div:before { - content: "hi!"; -} - diff --git a/library/vendor/lessphp/tests/inputs/ie.less b/library/vendor/lessphp/tests/inputs/ie.less deleted file mode 100644 index fd069ecd1..000000000 --- a/library/vendor/lessphp/tests/inputs/ie.less +++ /dev/null @@ -1,12 +0,0 @@ - -foo { - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr=#c0ff3300, endColorstr=#ff000000); - filter:progid:DXImageTransform.Microsoft.gradient(GradientType=1, startColorstr=#c0ff3300, endColorstr=#ff000000); -} - - -foo { - filter: alpha(opacity=20); - filter: alpha(opacity=20, enabled=true); - filter: blaznicate(foo=bar, baz=bang bip, bart=#fa4600); -} diff --git a/library/vendor/lessphp/tests/inputs/import.less b/library/vendor/lessphp/tests/inputs/import.less deleted file mode 100644 index c3e178453..000000000 --- a/library/vendor/lessphp/tests/inputs/import.less +++ /dev/null @@ -1,56 +0,0 @@ - -@import 'file1.less'; // file found and imported - -@import "not-found"; - -@import "something.css" media; -@import url("something.css") media; -@import url(something.css) media, screen, print; - -@color: maroon; - -@import url(file2); // found and imported - -body { - line-height: 10em; - @colors; -} - -div { - @color: fuchsia; - @import "file2"; -} - - -.mixin-import() { - @import "file3"; -} - -.one { - .mixin-import(); - color: blue; -} - -.two { - .mixin-import(); -} - - -#merge-import-mixins { - @import "a"; - @import "b"; - div { .just-a-class; } -} - - -@import "inner/file1"; - - -// test bubbling variables up from imports, while preserving order - -pre { - color: @someValue; -} - -@import "file3"; - diff --git a/library/vendor/lessphp/tests/inputs/interpolation.less b/library/vendor/lessphp/tests/inputs/interpolation.less deleted file mode 100644 index 58ffa2fc5..000000000 --- a/library/vendor/lessphp/tests/inputs/interpolation.less +++ /dev/null @@ -1,33 +0,0 @@ - -@cool-hello: "yes"; -@cool-yes: "okay"; -@var: "hello"; - -div { - color: ~"@{cool-hello}"; - color: ~"@{cool-@{var}}"; - color: ~"@{cool-@{cool-@{var}}}"; -} - -// interpolation in selectors - -@hello: 10; -@world: "yeah"; - -@{hello}@{world} { - color: blue; -} - -@{hello} { - color: blue; -} - -hello world @{hello} { - color: red; -} - -#@{world} { - color: "hello @{hello}"; -} - - diff --git a/library/vendor/lessphp/tests/inputs/keyframes.less b/library/vendor/lessphp/tests/inputs/keyframes.less deleted file mode 100644 index e65a38b95..000000000 --- a/library/vendor/lessphp/tests/inputs/keyframes.less +++ /dev/null @@ -1,52 +0,0 @@ -@keyframes 'bounce' { - from { - top: 100px; - animation-timing-function: ease-out; - } - - 25% { - top: 50px; - animation-timing-function: ease-in; - } - - 50% { - top: 100px; - animation-timing-function: ease-out; - } - - 75% { - top: 75px; - animation-timing-function: ease-in; - } - - to { - top: 100px; - } -} - -@-webkit-keyframes flowouttoleft { - 0% { -webkit-transform: translateX(0) scale(1); } - 60%, 70% { -webkit-transform: translateX(0) scale(.7); } - 100% { -webkit-transform: translateX(-100%) scale(.7); } -} - -div { - animation-name: 'diagonal-slide'; - animation-duration: 5s; - animation-iteration-count: 10; -} - -@keyframes 'diagonal-slide' { - - from { - left: 0; - top: 0; - } - - to { - left: 100px; - top: 100px; - } - -} - diff --git a/library/vendor/lessphp/tests/inputs/math.less b/library/vendor/lessphp/tests/inputs/math.less deleted file mode 100644 index bcc383a8d..000000000 --- a/library/vendor/lessphp/tests/inputs/math.less +++ /dev/null @@ -1,121 +0,0 @@ - -.unary { - // all operators are parsable as unary operators, anything - // but - throws an error right now though, - - // this gives two numbers - sub: 10 -5; - // add: 10 +5; // error - // div: 10 /5; // error - // mul: 10 *5; // error -} - -.spaces { - // we can make the parser do math by leaving out the - // space after the first value, or putting spaces on both sides - - sub: 10-5; - sub: 10 - 5; - - add: 10+5; - add: 10 + 5; - - // div: 10/5; // this wont work, read on - div: 10 / 5; - - mul: 10*5; - mul: 10 * 5; -} - -// these properties have divison not in parenthases -.supress-division { - border-radius: 10px / 10px; - border-radius: 10px/10px; - border-radius: hello (10px/10px) world; - @x: 10px; - font: @x/30 sans-serif; - font: 10px / 20px sans-serif; - font: 10px/20px sans-serif; - border-radius:0 15px 15px 15px / 0 50% 50% 50%; -} - - -.parens { - // if you are unsure, then just wrap the expression in parentheses and it will - // always evaluate. - - // notice we no longer have unary operators, and these will evaluate - sub: (10 -5); - add: (10 +5); - div: (10 /5); - div: (10/5); // no longer interpreted as the shorthand - mul: (10 *5); -} - -.keyword-names { - // watch out when doing math with keywords, - is a valid keyword character - @a: 100; - @b: 25; - @a-: "hello"; - height: @a-@b; // here we get "hello" 25, not 75 -} - - -.negation { - hello: -(1px); - hello: 0-(1px); - - @something: 10; - hello: -@something; -} - - -// and now here are the tests - -.test { - single: (5); - single: 5+(5); - single: (5)+((5)); - - parens: (5 +(5)) -2; - // parens: ((5 +(5)) -2); // FAILS - fixme - - math: (5 + 5)*(2 / 1); - math: (5+5)*(2/1); - - width: 2 * (4 * (2 + (1 + 6))) - 1; - height: ((2+3)*(2+3) / (9-4)) + 1; - padding: (2px + 4px) 1em 2px 2; - - @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); -} - -.percents { - color: 100 * 10%; - color: 10% * 100; - color: 10% * 10%; - - color: 100px * 10%; // lessjs makes this px - color: 10% * 100px; // lessjs makes this % - - color: 20% + 10%; - color: 20% - 10%; - - color: 20% / 10%; -} - -.misc { - x: 10px * 4em; - y: 10 * 4em; -} - - -.cond { - y: 10 < 10; - y: 10 >= 10; -} - diff --git a/library/vendor/lessphp/tests/inputs/media.less b/library/vendor/lessphp/tests/inputs/media.less deleted file mode 100644 index 8c16a3cf6..000000000 --- a/library/vendor/lessphp/tests/inputs/media.less +++ /dev/null @@ -1,68 +0,0 @@ -@media screen, 3D { - P { color: green; } -} -@media print { - body { font-size: 10pt } -} -@media screen { - body { font-size: 13px } -} -@media screen, print { - body { line-height: 1.2 } -} - -@media all and (min-width: 0px) { - body { line-height: 1.2 } -} - -@media all and (min-width: 0) { - body { line-height: 1.2 } -} - -@media - screen and (min-width: 102.5em) and (max-width: 117.9375em), - screen and (min-width: 150em) { - body { color: blue } -} - - -@media screen and (min-height: 100px + 10px) { - body { color: red; } -} - -@cool: 100px; - -@media screen and (height: @cool) and (width: @cool + 10), (size: @cool + 20) { - body { color: red; } -} - - -// media bubbling - -@media test { - div { - height: 20px; - @media (hello) { - color: red; - - pre { - color: orange; - } - } - } -} - -// should not cross boundary -@media yeah { - @page { - @media cool { - color: red; - } - } -} - -// variable in query -@mobile: ~"(max-width: 599px)"; -@media @mobile { - .helloworld { color: blue } -} diff --git a/library/vendor/lessphp/tests/inputs/misc.less b/library/vendor/lessphp/tests/inputs/misc.less deleted file mode 100644 index f81eff4ba..000000000 --- a/library/vendor/lessphp/tests/inputs/misc.less +++ /dev/null @@ -1,93 +0,0 @@ - -@color: #fff; -@base_path: "/assets/images/"; -@images: @base_path + "test/"; -.topbar { background: url(@{images}topbar.png); } -.hello { test: empty-function(@images, 40%, to(@color)); } - -.css3 { - background-image: -webkit-gradient(linear, 0% 0%, 0% 90%, - from(#E9A000), to(#A37000)); -} - - -/** - -Here is a block comment - -**/ - - -// this is a comment - -.test, /*hello*/.world { - border: 1px solid red; // world - /* another property */ - color: url(http://mage-page.com); - string: "hello /* this is not a comment */"; - world: "// neither is this"; - string: 'hello /* this is not a comment */' /*what if this is a comment */; - world: '// neither is this' // hell world; - ; - what-/*something?*/ever: 100px; - background: url(/*no comment here*/); -} - - -.urls { - @var: "http://google.com"; - background: url(@var); - background: url(@{var}); - background: url("@{var}"); -} - -.mix(@arg) { color: @arg; } -@aaa: aaa; -@bbb: bbb; -// make sure the opening selector isn't too greedy -.cool {.mix("@{aaa}, @{bbb}")} -.cool(); - -.cool("{hello"); -.cool('{hello'); - - -// merging of mixins -.span-17 { float: left; } -.span-17 { width: 660px; } - -.x {.span-17;} - -.hi { - pre { - color: red; - } -} - -.hi { - pre { - color: blue; - } -} - -.rad { - .hi; -} - - -hello { - numbers: 1.0 0.1 .1 1.; - numbers: 1.0s 0.1s .1s 1.s; - numbers: -1.0s -0.1s -.1s -1.s; - numbers: -1.0 -0.1 -.1 -1.; -} - - -#string { - hello: 'what\'s going on here'; - hello: 'blah blag @{ blah blah'; - - join: 3434 + "hello"; - join: 3434 + hello; -} - diff --git a/library/vendor/lessphp/tests/inputs/mixin_functions.less b/library/vendor/lessphp/tests/inputs/mixin_functions.less deleted file mode 100644 index fc9d57901..000000000 --- a/library/vendor/lessphp/tests/inputs/mixin_functions.less +++ /dev/null @@ -1,40 +0,0 @@ - -@outer: 10px; -@class(@var:22px, @car: 400px + @outer) { - margin: @var; - height: @car; -} - -@group { - @f(@color) { - color: @color; - } - .cool { - border-bottom: 1px solid green; - } -} - -.class(@width:200px) { - padding: @width; -} - -body { - .class(2.0em); - @group > @f(red); - @class(10px, 10px + 2); - @group > .cool; -} - - -@lots(@a: 10px, @b: 20px, @c: 30px, @d: 40px, @e: 4px, @f:3px, @g:2px, @h: 1px) { - padding: @a @b @c @d; - margin: @e @f @g @h; -} - -.skip_args { - @class(,12px); - @lots(,,,88px,,12px); - @group > @f(red,,,,); - @group > @f(red); -} - diff --git a/library/vendor/lessphp/tests/inputs/mixin_merging.less.disable b/library/vendor/lessphp/tests/inputs/mixin_merging.less.disable deleted file mode 100644 index 6b25e421f..000000000 --- a/library/vendor/lessphp/tests/inputs/mixin_merging.less.disable +++ /dev/null @@ -1,100 +0,0 @@ - -@tester { - p, div { height: 10px; } -} - -#test1 { - div { color: red; } - @tester; -} - - -@cool { - a,b,i { width: 1px; } -} - -#test2 { - b { color: red; } - @cool; -} - -#test3 { - @cool; - b { color: red; } -} - -@cooler { - a { margin: 1px; } -} - -#test4 { - a, div, html { color: blue; } - @cooler; -} - -@hi { - img, strong { float: right; } -} - -#test5 { - img, strong { padding: 2px; } - @hi; -} - -@nested { - div, span { - a { - color: red; - } - } -} - -#test6 { - div, span { - a { - line-height: 10px; - } - } - @nested; -} - -@broken-nesting { - div, span { - strong, b { - color: red; - } - } - -} - -#test7 { - div { - strong { - margin: 1px; - } - } - @broken-nesting; -} - - -@another-nest { - a,b { - i { - color: red; - } - - s { - color: blue; - } - } -} - -#test8 { - a, b { - i,s { - background: red; - } - } - @another-nest; -} - diff --git a/library/vendor/lessphp/tests/inputs/mixins.less b/library/vendor/lessphp/tests/inputs/mixins.less deleted file mode 100644 index 166188a99..000000000 --- a/library/vendor/lessphp/tests/inputs/mixins.less +++ /dev/null @@ -1,159 +0,0 @@ - -@rounded-corners { - border-radius: 10px; -} - -.bold { - @font-size: 20px; - font-size: @font-size; - font-weight: bold; -} - -body #window { - @rounded-corners; - .bold; - line-height: @font-size * 1.5; -} - -#bundle { - .button { - display: block; - border: 1px solid black; - background-color: grey; - &:hover { background-color: white } - } -} -#header a { - color: orange; - #bundle > .button; // mixin the button class -} - -div { - @abstract { - hello: world; - b { - color: blue; - } - } - - @abstract > b; - @abstract; -} - -@poop { - big: baby; -} - -body { - div; -} - -// not using > to list mixins - -.hello { - .world { - color: blue; - } -} - -.foobar { - .hello .world; -} - - -.butter { - .this .one .isnt .found; -} - - -// arguments - -.spam(@something: 100, @dad: land) { - @wow: 23434; - foo: @arguments; - bar: @arguments; -} - -.eggs { - .spam(1px, 2px); - .spam(); -} - -.first(@one, @two, @three, @four: cool) { - cool: @arguments; -} - -#hello { - .first(one, two, three); -} - -#hello-important { - .first(one, two, three) !important; -} - -.rad(@name) { - cool: @arguments; -} - -#world { - @hello: "world"; - .rad("@{hello}"); -} - -.second(@x, @y:skip, @z: me) { - things: @arguments; -} - -#another { - .second(red, blue, green); - .second(red blue green); -} - - -.another(@x, @y:skip, @z:me) { - .cool { - color: @arguments; - } -} - -#day { - .another(one,two, three); - .another(one two three); -} - - -.to-be-important() { - color: red; - @color: red; - height: 20px; - - pre { - color: @color; - } -} - -.mix-suffix { - .to-be-important() !important; -} - - - - -#search-all { - .red() { - color:#f00 !important; - } -} - -#search-all { - .green() { - color: #0f0 !important; - } -} - -.search-test { - #search-all > .red(); - #search-all > .green(); -} - - diff --git a/library/vendor/lessphp/tests/inputs/nested.less b/library/vendor/lessphp/tests/inputs/nested.less deleted file mode 100644 index 0b62ea19b..000000000 --- a/library/vendor/lessphp/tests/inputs/nested.less +++ /dev/null @@ -1,60 +0,0 @@ -#header { - color: black; - - .navigation { - font-size: 12px; - .border { - .outside { - color: blue; - } - } - } - .logo { - width: 300px; - &:hover { text-decoration: none } - } -} - -a { b { ul { li { color: green; } } } } - -this { will { not { show { } } } } - -.cool { - div & { color: green; } - p & span { color: yellow; } -} - -another { - .cool; -} - -b { - & .something { - color: blue; - } - - &.something { - color: blue; - } -} - -.foo { - .bar, .baz { - & .qux { - display: block; - } - .qux & { - display: inline; - } - .qux & .biz { - display: none; - } - } -} - -b { - hello [x="&yeah"] { - color: red; - } -} - diff --git a/library/vendor/lessphp/tests/inputs/pattern_matching.less b/library/vendor/lessphp/tests/inputs/pattern_matching.less deleted file mode 100644 index e875473d3..000000000 --- a/library/vendor/lessphp/tests/inputs/pattern_matching.less +++ /dev/null @@ -1,167 +0,0 @@ - -.demo (light, @color) { - color: lighten(@color, 10%); -} -.demo (@_, @color) { - display: block; -} - -@switch: light; - -.class { - .demo(@switch, #888); -} - -// by arity - -.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); -} - -.hola(hello, @hello...) { - color: blue; -} - -#hola { - .hola(hello, world); - .hola(jello, world); -} - -.resty(@hello, @world, @the_rest...) { - padding: @hello @world; - rest: @the_rest; -} - -#nnn { - .body(10, 10, 10, 10, 10); - .body(10, 10, 10); - .body(10, 10); - .body(10); - .body(); -} - -.defaults(@aa, @bb:e343, @cc: "heah", ...) { - height: @aa; -} - -#defaults_1 { - .defaults(); - .defaults(one); - .defaults(two, one); - .defaults(three, two, one); - .defaults(four, three, two, one); -} - - -.thing() { color: green; } -.thing(...) { color: blue; } -.thing { color: red; } - -#aa { - .thing(); -} - -#bb { - .thing; -} - - -#cc { - .thing(1); -} - - - diff --git a/library/vendor/lessphp/tests/inputs/scopes.less b/library/vendor/lessphp/tests/inputs/scopes.less deleted file mode 100644 index 0ddbfac20..000000000 --- a/library/vendor/lessphp/tests/inputs/scopes.less +++ /dev/null @@ -1,40 +0,0 @@ - - -@a: 10; -@some { - @b: @a + 10; - div { - @c: @b + 10; - other { - @d: @c + 10; - world { - @e: @d + 10; - height: @e; - } - } - } -} - - -body { - @some; -} - -@some; - -.test(@x: 10) { - height: @x; - .test(@y: 11) { - height: @y; - .test(@z: 12) { - height: @z; - } - .test; - } - .test; -} - -pre { - .test; -} - diff --git a/library/vendor/lessphp/tests/inputs/selector_expressions.less b/library/vendor/lessphp/tests/inputs/selector_expressions.less deleted file mode 100644 index a16c1d23a..000000000 --- a/library/vendor/lessphp/tests/inputs/selector_expressions.less +++ /dev/null @@ -1,29 +0,0 @@ - -@color: blue; - -(~"something @{color}"), world { - color: blue; -} - -.div { - @color: red; - (3434) { - height: 100px; - } - - (~"cool @{color}") { - height: 4000px; - } -} - -.heck(@a) { color: @a+10 } - -.spanX (@index) when (@index > 0) { - (~".span@{index}") { .heck(@index) } - .spanX(@index - 1); -} -.spanX (0) {} - -.spanX (5); - - diff --git a/library/vendor/lessphp/tests/inputs/site_demos.less b/library/vendor/lessphp/tests/inputs/site_demos.less deleted file mode 100644 index 136a99ac8..000000000 --- a/library/vendor/lessphp/tests/inputs/site_demos.less +++ /dev/null @@ -1,120 +0,0 @@ -// these are the demos from the lessphp homepage - -default { - @base: 24px; - @border-color: #B2B; - - .underline { border-bottom: 1px solid green } - - #header { - color: black; - border: 1px solid @border-color + #222222; - - .navigation { - font-size: @base / 2; - a { - .underline; - } - } - .logo { - width: 300px; - &:hover { text-decoration: none } - } - } -} - -variables { - @a: 2; - @x: @a * @a; - @y: @x + 1; - @z: @x * 2 + @y; - - @nice-blue: #5B83AD; - @light-blue: @nice-blue + #111; - - @b: @a * 10; - @c: #888; - @fonts: "Trebuchet MS", Verdana, sans-serif; - - .variables { - width: @z + 1cm; // 14cm - height: @b + @x + 0px; // 24px - color: @c; - background: @light-blue; - font-family: @fonts; - } -} - -mixins { - .bordered { - border-top: dotted 1px black; - border-bottom: solid 2px black; - } - #menu a { - color: #111; - .bordered; - } - - .post a { - color: red; - .bordered; - } -} - -nested-rules { - #header { - color: black; - - .navigation { - font-size: 12px; - } - .logo { - width: 300px; - &:hover { text-decoration: none } - } - } -} - -namespaces { - #bundle { - .button { - display: block; - border: 1px solid black; - background-color: grey; - &:hover { background-color: white } - } - } - #header a { - color: orange; - #bundle > .button; // mixin the button class - } -} - -mixin-functions { - @outer: 10px; - @class(@var:22px, @car: 400px + @outer) { - margin: @var; - height: @car; - } - - @group { - @f(@color) { - color: @color; - } - .cool { - border-bottom: 1px solid green; - } - } - - .class(@width:200px) { - padding: @width; - } - - body { - .class(2.0em); - @group > @f(red); - @class(10px, 10px + 2); - @group > .cool; - } -} - diff --git a/library/vendor/lessphp/tests/inputs/test-imports/a.less b/library/vendor/lessphp/tests/inputs/test-imports/a.less deleted file mode 100644 index a00464dbb..000000000 --- a/library/vendor/lessphp/tests/inputs/test-imports/a.less +++ /dev/null @@ -1,6 +0,0 @@ -.just-a-class { background: red; } - -.some-mixin() { - height: 200px; -} - diff --git a/library/vendor/lessphp/tests/inputs/test-imports/b.less b/library/vendor/lessphp/tests/inputs/test-imports/b.less deleted file mode 100644 index 599ed3a46..000000000 --- a/library/vendor/lessphp/tests/inputs/test-imports/b.less +++ /dev/null @@ -1,12 +0,0 @@ -.just-a-class { background: blue; } - -.hello { - .some-mixin(); -} - - -@media cool { - color: red; - .some-mixin(); -} - diff --git a/library/vendor/lessphp/tests/inputs/test-imports/file1.less b/library/vendor/lessphp/tests/inputs/test-imports/file1.less deleted file mode 100644 index 658de0c53..000000000 --- a/library/vendor/lessphp/tests/inputs/test-imports/file1.less +++ /dev/null @@ -1,16 +0,0 @@ - - -/** - * This is a test import file - */ - -@colors { - div.bright { - color: red; - } - - div.sad { - color: blue; - } -} - diff --git a/library/vendor/lessphp/tests/inputs/test-imports/file2.less b/library/vendor/lessphp/tests/inputs/test-imports/file2.less deleted file mode 100644 index 2cae8dce0..000000000 --- a/library/vendor/lessphp/tests/inputs/test-imports/file2.less +++ /dev/null @@ -1,6 +0,0 @@ - -b { - color: @color; - padding: 16px; -} - diff --git a/library/vendor/lessphp/tests/inputs/test-imports/file3.less b/library/vendor/lessphp/tests/inputs/test-imports/file3.less deleted file mode 100644 index 28b643ea9..000000000 --- a/library/vendor/lessphp/tests/inputs/test-imports/file3.less +++ /dev/null @@ -1,7 +0,0 @@ - -h2 { - background: url("../images/logo.png") no-repeat; -} - -@someValue: hello-from-file-3; - diff --git a/library/vendor/lessphp/tests/inputs/test-imports/inner/file1.less b/library/vendor/lessphp/tests/inputs/test-imports/inner/file1.less deleted file mode 100644 index df654a7ee..000000000 --- a/library/vendor/lessphp/tests/inputs/test-imports/inner/file1.less +++ /dev/null @@ -1,6 +0,0 @@ - -.inner { - content: "inner/file1.less" -} - -@import "file2"; // should get the one in inner diff --git a/library/vendor/lessphp/tests/inputs/test-imports/inner/file2.less b/library/vendor/lessphp/tests/inputs/test-imports/inner/file2.less deleted file mode 100644 index f40d3c67b..000000000 --- a/library/vendor/lessphp/tests/inputs/test-imports/inner/file2.less +++ /dev/null @@ -1,4 +0,0 @@ - -.inner { - content: "inner/file2.less" -} diff --git a/library/vendor/lessphp/tests/inputs/variables.less b/library/vendor/lessphp/tests/inputs/variables.less deleted file mode 100644 index 6c4ef8fb4..000000000 --- a/library/vendor/lessphp/tests/inputs/variables.less +++ /dev/null @@ -1,45 +0,0 @@ -@a: 2; -@x: @a * @a; -@y: @x + 1; -@z: @y + @x * 2; -@m: @z % @y; - -@nice-blue: #5B83AD; -@light-blue: @nice-blue + #111; - -@rgb-color: rgb(20%, 15%, 80%); -@rgba-color: rgba(23,68,149,0.5); - -@b: @a * 10px; -@c: #888; -@fonts: "Trebuchet MS", Verdana, sans-serif; - -.variables { - width: @z + 1cm; // 14cm - height: @b + @x + 0px; // 24px - margin-top: -@b; // -20px - margin-bottom: 10 - -@b; // 30px - @d: @c + #001; - color: @d; - background: @light-blue; - font-family: @fonts; - margin: @m + 0px; // 3px - font: 10px/12px serif; - font: 120%/120% serif; -} - -.external { - color: @c; - border: 1px solid @rgb-color; - background: @rgba-color; - padding: @nonexistant + 4px; -} - -@hello: 44px; -@something: "hello"; -@cool: something; - -color: @@something; -color: @@@cool; - - diff --git a/library/vendor/lessphp/tests/outputs/accessors.css b/library/vendor/lessphp/tests/outputs/accessors.css deleted file mode 100644 index e6c01a72c..000000000 --- a/library/vendor/lessphp/tests/outputs/accessors.css +++ /dev/null @@ -1,14 +0,0 @@ -.article { color:#294366; } -.comment { - width:960px; - color:#294366; - padding:10px; -} -.wow { - height:960px; - background-color:#294366; - color:green; - padding:; - margin:; -} -.mix { font-size:10px; } \ No newline at end of file diff --git a/library/vendor/lessphp/tests/outputs/arity.css b/library/vendor/lessphp/tests/outputs/arity.css deleted file mode 100644 index 185df5cd1..000000000 --- a/library/vendor/lessphp/tests/outputs/arity.css +++ /dev/null @@ -1,25 +0,0 @@ -.one { - color: one; - color: one; -} -.two { - color: two; - color: two; -} -.three { - color: three; - color: three; -} -.multi-foo { - color: two; - color: three; - color: two; - color: three; - color: three; -} -.multi-baz { - color: two; - color: three; - color: two; - color: three; -} diff --git a/library/vendor/lessphp/tests/outputs/attributes.css b/library/vendor/lessphp/tests/outputs/attributes.css deleted file mode 100644 index fb0e176cf..000000000 --- a/library/vendor/lessphp/tests/outputs/attributes.css +++ /dev/null @@ -1,105 +0,0 @@ -* { - color: blue; -} -E { - color: blue; -} -E[foo] { - color: blue; -} -[foo] { - color: blue; -} -[foo] .helloWorld { - color: blue; -} -[foo].helloWorld { - color: blue; -} -E[foo="barbar"] { - color: blue; -} -E[foo~="hello#$@%@$#^"] { - color: blue; -} -E[foo^="color: green;"] { - color: blue; -} -E[foo$="239023"] { - color: blue; -} -E[foo*="29302"] { - color: blue; -} -E[foo|="239032"] { - color: blue; -} -E:root { - color: blue; -} -E:nth-child(odd) { - color: blue; -} -E:nth-child(2n+1) { - color: blue; -} -E:nth-child(5) { - color: blue; -} -E:nth-last-child(-n+2) { - color: blue; -} -E:nth-of-type(2n) { - color: blue; -} -E:nth-last-of-type(n) { - color: blue; -} -E:first-child { - color: blue; -} -E:last-child { - color: blue; -} -E:first-of-type { - color: blue; -} -E:last-of-type { - color: blue; -} -E:only-child { - color: blue; -} -E:only-of-type { - color: blue; -} -E:empty { - color: blue; -} -E:lang(en) { - color: blue; -} -E::first-line { - color: blue; -} -E::before { - color: blue; -} -E#id { - color: blue; -} -E:not(:link) { - color: blue; -} -E F { - color: blue; -} -E > F { - color: blue; -} -E + F { - color: blue; -} -E ~ F { - color: blue; -} diff --git a/library/vendor/lessphp/tests/outputs/builtins.css b/library/vendor/lessphp/tests/outputs/builtins.css deleted file mode 100644 index c8f74d609..000000000 --- a/library/vendor/lessphp/tests/outputs/builtins.css +++ /dev/null @@ -1,47 +0,0 @@ -body { - color: "hello world"; - height: 5.1666666666667; - height: 5px; - height: 6px; - width: 0.66666666666667; - width: 1; - width: 0; - width: 1; - width: 3px; - color: #ff112233; - color: #992c3742; - color: #992c3742; -} -format { - format: "rgb(32, 128, 64)"; - format-string: "hello world"; - format-multiple: "hello earth 2"; - format-url-encode: 'red is %A'; - eformat: rgb(32, 128, 64); -} -#functions { - str: true; - str: false; - num: true; - num: true; - num: true; - num: false; - col: true; - col: false; - col: true; - col: true; - key: true; - key: false; - px: true; - px: false; - per: true; - per: false; - em: true; - em: false; -} -#unit { - height: 10; - height: 10s; - height: 10em; - height: 7.407%; -} diff --git a/library/vendor/lessphp/tests/outputs/colors.css b/library/vendor/lessphp/tests/outputs/colors.css deleted file mode 100644 index 517f0da32..000000000 --- a/library/vendor/lessphp/tests/outputs/colors.css +++ /dev/null @@ -1,102 +0,0 @@ -body { - color: #ff0000; - color: #ffffff; - color: #000000; - color: #996d33; - color: rgba(153,109,51,0.3); - lighten: #ffffff; - lighten: #7c8df2; - lighten: rgba(222,140,129,0.5); - darken: #d6d6d6; - darken: #0d1e81; - darken: rgba(18,42,185,0.5); - saturate: #f1eded; - saturate: #0025fe; - saturate: rgba(10,44,244,0.5); - desaturate: #efefef; - desaturate: #3349cb; - desaturate: rgba(36,62,218,0.5); - spin: #efefef; - spin: #2d17e7; - spin: rgba(59,23,231,0.5); - spin: #efefef; - spin: #1769e7; - spin: rgba(23,119,231,0.5); - one: #abcdef; - one: #abcdef; - two: rgba(2,159,35,0.9); - two: rgba(2,159,35,0.9); - three: rgba(1,2,3,0.6); - three: rgba(1,2,3,0.6); - four: rgba(1,2,3,0); - four: rgba(1,2,3,0); - hue: 282; - sat: 33; - lit: 12; - what: #dff1da; - zero: #343434; - zero: #003468; - zero: #000000; - zero: #ffffff; - zero: #000000; - zero: #ffffff; - zero: #ffffff; - zero: #ffffff; - zero: #1d5612; - zero: #56124b; - zero: #000000; - zero: #ffffff; -} -alpha { - g: 0; - g: 1; -} -fade { - f: rgba(255,0,0,0.5); - f: rgba(255,255,255,0.2); - f: rgba(34,23,64,0.5); -} -.mix { - color: #808080; - color: rgba(6,3,2,-0.25); -} -.contrast { - color: #0000ff; - color: #ff0000; -} -.percent { - per: 50%; -} -.colorz { - color: #ebebeb; - color: #ff9100; - color: #000000; -} -body { - start: #fcf8e3; - spin: #fcf4e3; - chained: #fbeed5; - direct: #fbefd5; -} -pre { - spin: #f2dee1; -} -dd { - background-color: #f5f5f5; -} -.ops { - c: #4d0000; - c: #004000; - c: #020002; - c: #ffffff; - c: #fb8173; - c: 132 / #ff0000; - c: 132 - #ff0000; - c: 132- #ff0000; -} -.transparent { - r: 0; - g: 0; - b: 0; - a: 0; -} diff --git a/library/vendor/lessphp/tests/outputs/compile_on_mixin.css b/library/vendor/lessphp/tests/outputs/compile_on_mixin.css deleted file mode 100644 index 318526a5e..000000000 --- a/library/vendor/lessphp/tests/outputs/compile_on_mixin.css +++ /dev/null @@ -1,29 +0,0 @@ -body { - height: 22px; -} -body ul { - height: 20px; -} -body ul li { - height: 10px; -} -body ul li div span, -body ul li link { - margin: 10px; - color: red; -} -body ul div, -body ul p { - border: 1px; -} -body ul div.hello, -body ul p.hello { - color: green; -} -body ul div :what, -body ul p :what { - color: blue; -} -body ul a b { - color: blue; -} diff --git a/library/vendor/lessphp/tests/outputs/directives.css b/library/vendor/lessphp/tests/outputs/directives.css deleted file mode 100644 index 05a60a716..000000000 --- a/library/vendor/lessphp/tests/outputs/directives.css +++ /dev/null @@ -1,15 +0,0 @@ -@charset "utf-8"; -@-moz-document url-prefix() { - div { - color: red; - } -} -@page :left { - margin-left: 4cm; -} -@page :right { - margin-left: 3cm; -} -@page { - margin: 2cm; -} diff --git a/library/vendor/lessphp/tests/outputs/escape.css b/library/vendor/lessphp/tests/outputs/escape.css deleted file mode 100644 index a95cdf545..000000000 --- a/library/vendor/lessphp/tests/outputs/escape.css +++ /dev/null @@ -1,16 +0,0 @@ -body { - border: this is simple; - border: this; - border: this is simple; - border: 1232; - border: world; - border: onemore; - border: ; - line-height: eating rice; - line-height: string cheese; - line-height: a b c string me d e f; - line-height: string world; -} -.class { - filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='image.png'); -} diff --git a/library/vendor/lessphp/tests/outputs/font_family.css b/library/vendor/lessphp/tests/outputs/font_family.css deleted file mode 100644 index fc260fd4d..000000000 --- a/library/vendor/lessphp/tests/outputs/font_family.css +++ /dev/null @@ -1,17 +0,0 @@ -@font-face { - font-family: Graublau Sans Web; - src: url(fonts/GraublauWeb.otf) format("opentype"); -} -@font-face { - font-family: Gentium; - src: url('fonts/Gentium.ttf'); -} -@font-face { - font-family: Gentium; - src: url("fonts/GentiumItalic.ttf"); - font-style: italic; -} -h2 { - font-family: Gentium; - crazy: maroon; -} diff --git a/library/vendor/lessphp/tests/outputs/guards.css b/library/vendor/lessphp/tests/outputs/guards.css deleted file mode 100644 index 5a453709e..000000000 --- a/library/vendor/lessphp/tests/outputs/guards.css +++ /dev/null @@ -1,27 +0,0 @@ -dd { - color: yellow; -} -b { - color: red; - color: blue; - color: blue; -} -img { - color: green; - color: teal; -} -body { - color: purple; - color: silver; - color: purple; -} -div { - color: blue; -} -link { - color: true red; - color: true #fff; - color: true #fffddd; - color: true #000000; - color: true rgba(0,0,0,0.34); -} diff --git a/library/vendor/lessphp/tests/outputs/hacks.css b/library/vendor/lessphp/tests/outputs/hacks.css deleted file mode 100644 index b8327eb51..000000000 --- a/library/vendor/lessphp/tests/outputs/hacks.css +++ /dev/null @@ -1,4 +0,0 @@ -:root .alert-message, -:root .btn { - border-radius: 0 \0; -} diff --git a/library/vendor/lessphp/tests/outputs/hi.css b/library/vendor/lessphp/tests/outputs/hi.css deleted file mode 100644 index 3bffcf0b0..000000000 --- a/library/vendor/lessphp/tests/outputs/hi.css +++ /dev/null @@ -1,3 +0,0 @@ -div:before { - content: "hi!"; -} diff --git a/library/vendor/lessphp/tests/outputs/ie.css b/library/vendor/lessphp/tests/outputs/ie.css deleted file mode 100644 index 4e005e55c..000000000 --- a/library/vendor/lessphp/tests/outputs/ie.css +++ /dev/null @@ -1,9 +0,0 @@ -foo { - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr=#c0ff3300,endColorstr=#ff000000); - filter: progid:DXImageTransform.Microsoft.gradient(GradientType=1,startColorstr=#c0ff3300,endColorstr=#ff000000); -} -foo { - filter: alpha(opacity=20); - filter: alpha(opacity=20,enabled=true); - filter: blaznicate(foo=bar,baz=bang bip,bart=#fa4600); -} diff --git a/library/vendor/lessphp/tests/outputs/import.css b/library/vendor/lessphp/tests/outputs/import.css deleted file mode 100644 index 1998692ee..000000000 --- a/library/vendor/lessphp/tests/outputs/import.css +++ /dev/null @@ -1,61 +0,0 @@ -@import "not-found"; -@import "something.css" media; -@import url("something.css") media; -@import url(something.css) media, screen, print; -b { - color: maroon; - padding: 16px; -} -body { - line-height: 10em; -} -body div.bright { - color: red; -} -body div.sad { - color: blue; -} -div b { - color: fuchsia; - padding: 16px; -} -.one { - color: blue; -} -.one h2 { - background: url("../images/logo.png") no-repeat; -} -.two h2 { - background: url("../images/logo.png") no-repeat; -} -#merge-import-mixins .just-a-class { - background: red; -} -#merge-import-mixins .just-a-class { - background: blue; -} -#merge-import-mixins .hello { - height: 200px; -} -@media cool { - #merge-import-mixins { - color: red; - height: 200px; - } -} -#merge-import-mixins div { - background: red; - background: blue; -} -.inner { - content: "inner/file1.less"; -} -.inner { - content: "inner/file2.less"; -} -pre { - color: hello-from-file-3; -} -h2 { - background: url("../images/logo.png") no-repeat; -} diff --git a/library/vendor/lessphp/tests/outputs/interpolation.css b/library/vendor/lessphp/tests/outputs/interpolation.css deleted file mode 100644 index 40873e01b..000000000 --- a/library/vendor/lessphp/tests/outputs/interpolation.css +++ /dev/null @@ -1,17 +0,0 @@ -div { - color: yes; - color: yes; - color: okay; -} -10"yeah" { - color: blue; -} -10 { - color: blue; -} -hello world 10 { - color: red; -} -#"yeah" { - color: "hello 10"; -} diff --git a/library/vendor/lessphp/tests/outputs/keyframes.css b/library/vendor/lessphp/tests/outputs/keyframes.css deleted file mode 100644 index cf62be113..000000000 --- a/library/vendor/lessphp/tests/outputs/keyframes.css +++ /dev/null @@ -1,48 +0,0 @@ -@keyframes 'bounce' { - from { - top: 100px; - animation-timing-function: ease-out; - } - 25% { - top: 50px; - animation-timing-function: ease-in; - } - 50% { - top: 100px; - animation-timing-function: ease-out; - } - 75% { - top: 75px; - animation-timing-function: ease-in; - } - to { - top: 100px; - } -} -@-webkit-keyframes flowouttoleft { - 0% { - -webkit-transform: translateX(0) scale(1); - } - 60%, - 70% { - -webkit-transform: translateX(0) scale(.7); - } - 100% { - -webkit-transform: translateX(-100%) scale(.7); - } -} -div { - animation-name: 'diagonal-slide'; - animation-duration: 5s; - animation-iteration-count: 10; -} -@keyframes 'diagonal-slide' { - from { - left: 0; - top: 0; - } - to { - left: 100px; - top: 100px; - } -} diff --git a/library/vendor/lessphp/tests/outputs/math.css b/library/vendor/lessphp/tests/outputs/math.css deleted file mode 100644 index ce5e7172c..000000000 --- a/library/vendor/lessphp/tests/outputs/math.css +++ /dev/null @@ -1,69 +0,0 @@ -.unary { - sub: 10 -5; -} -.spaces { - sub: 5; - sub: 5; - add: 15; - add: 15; - div: 2; - mul: 50; - mul: 50; -} -.supress-division { - border-radius: 10px/10px; - border-radius: 10px/10px; - border-radius: hello(10px/10px) world; - font: 10px/30 sans-serif; - font: 10px/20px sans-serif; - font: 10px/20px sans-serif; - border-radius: 0 15px 15px 15px/0 50% 50% 50%; -} -.parens { - sub: 5; - add: 15; - div: 2; - div: 2; - mul: 50; -} -.keyword-names { - height: "hello" 25; -} -.negation { - hello: -1px; - hello: -1px; - hello: -10; -} -.test { - single: 5; - single: 10; - single: 10; - parens: 10 -2; - math: 20; - math: 20; - width: 71; - height: 6; - padding: 6px 1em 2px 2; - padding: 8 4 4 4px; - width: 96; - height: 113; - margin: 12; -} -.percents { - color: 1000%; - color: 1000%; - color: 100%; - color: 1000px; - color: 1000%; - color: 30%; - color: 10%; - color: 2%; -} -.misc { - x: 40px; - y: 40em; -} -.cond { - y: false; - y: true; -} diff --git a/library/vendor/lessphp/tests/outputs/media.css b/library/vendor/lessphp/tests/outputs/media.css deleted file mode 100644 index 99da8c315..000000000 --- a/library/vendor/lessphp/tests/outputs/media.css +++ /dev/null @@ -1,70 +0,0 @@ -@media screen,3D { - P { - color: green; - } -} -@media print { - body { - font-size: 10pt; - } -} -@media screen { - body { - font-size: 13px; - } -} -@media screen,print { - body { - line-height: 1.2; - } -} -@media all and (min-width: 0px) { - body { - line-height: 1.2; - } -} -@media all and (min-width: 0) { - body { - line-height: 1.2; - } -} -@media screen and (min-width: 102.5em) and (max-width: 117.9375em),screen and (min-width: 150em) { - body { - color: blue; - } -} -@media screen and (min-height: 110px) { - body { - color: red; - } -} -@media screen and (height: 100px) and (width: 110px),(size: 120px) { - body { - color: red; - } -} -@media test { - div { - height: 20px; - } -} -@media test and (hello) { - div { - color: red; - } - div pre { - color: orange; - } -} -@media yeah { - @page { - @media cool { - color: red; - } - } -} -@media (max-width: 599px) { - .helloworld { - color: blue; - } -} diff --git a/library/vendor/lessphp/tests/outputs/misc.css b/library/vendor/lessphp/tests/outputs/misc.css deleted file mode 100644 index 94ec8ffe1..000000000 --- a/library/vendor/lessphp/tests/outputs/misc.css +++ /dev/null @@ -1,63 +0,0 @@ -color: "aaa, bbb"; -.topbar { - background: url(/assets/images/test/topbar.png); -} -.hello { - test: empty-function("/assets/images/test/",40%,to(#fff)); -} -.css3 { - background-image: -webkit-gradient(linear,0% 0%,0% 90%,from(#E9A000),to(#A37000)); -} -.test, -.world { - border: 1px solid red; - color: url(http://mage-page.com); - string: "hello /* this is not a comment */"; - world: "// neither is this"; - string: 'hello /* this is not a comment */'; - world: '// neither is this'; - what-ever: 100px; - background: url(/*no comment here*/); -} -.urls { - background: url("http://google.com"); - background: url(http://google.com); - background: url("http://google.com"); -} -.cool { - color: "aaa, bbb"; -} -.span-17 { - float: left; -} -.span-17 { - width: 660px; -} -.x { - float: left; - width: 660px; -} -.hi pre { - color: red; -} -.hi pre { - color: blue; -} -.rad pre { - color: red; -} -.rad pre { - color: blue; -} -hello { - numbers: 1.0 0.1 .1 1.; - numbers: 1.0s 0.1s .1s 1.s; - numbers: -1s -0.1s -0.1s -1s; - numbers: -1 -0.1 -0.1 -1; -} -#string { - hello: 'what\'s going on here'; - hello: 'blah blag @{ blah blah'; - join: "3434hello"; - join: 3434hello; -} diff --git a/library/vendor/lessphp/tests/outputs/mixin_functions.css b/library/vendor/lessphp/tests/outputs/mixin_functions.css deleted file mode 100644 index c7e584dc5..000000000 --- a/library/vendor/lessphp/tests/outputs/mixin_functions.css +++ /dev/null @@ -1,14 +0,0 @@ -body { - padding: 2.0em; - color: red; - margin: 10px; - height: 12px; - border-bottom: 1px solid green; -} -.skip_args { - margin: 22px; - height: 12px; - padding: 10px 20px 30px 88px; - margin: 4px 12px 2px 1px; - color: red; -} diff --git a/library/vendor/lessphp/tests/outputs/mixin_merging.css b/library/vendor/lessphp/tests/outputs/mixin_merging.css deleted file mode 100644 index 9ec360c21..000000000 --- a/library/vendor/lessphp/tests/outputs/mixin_merging.css +++ /dev/null @@ -1,42 +0,0 @@ -#test1 div { - color:red; - height:10px; -} -#test1 p { height:10px; } -#test2 b { - color:red; - width:1px; -} -#test2 a, #test2 i { width:1px; } -#test3 a, #test3 i { width:1px; } -#test3 b { - width:1px; - color:red; -} -#test4 a { - color:blue; - margin:1px; -} -#test4 div, #test4 html { color:blue; } -#test5 img, #test5 strong { - padding:2px; - float:right; -} -#test6 div a, #test6 span a { - line-height:10px; - color:red; -} -#test7 div strong { - margin:1px; - color:red; -} -#test7 div b { color:red; } -#test7 span strong, #test7 span b { color:red; } -#test8 a i, #test8 b i { - background:red; - color:red; -} -#test8 a s, #test8 b s { - background:red; - color:blue; -} \ No newline at end of file diff --git a/library/vendor/lessphp/tests/outputs/mixins.css b/library/vendor/lessphp/tests/outputs/mixins.css deleted file mode 100644 index 91e9bc421..000000000 --- a/library/vendor/lessphp/tests/outputs/mixins.css +++ /dev/null @@ -1,83 +0,0 @@ -.bold { - font-size: 20px; - font-weight: bold; -} -body #window { - border-radius: 10px; - font-size: 20px; - font-weight: bold; - line-height: 30px; -} -#bundle .button { - display: block; - border: 1px solid black; - background-color: grey; -} -#bundle .button:hover { - background-color: white; -} -#header a { - color: orange; - display: block; - border: 1px solid black; - background-color: grey; -} -#header a:hover { - background-color: white; -} -div { - color: blue; - hello: world; -} -div b { - color: blue; -} -body { - color: blue; - hello: world; -} -body b { - color: blue; -} -.hello .world { - color: blue; -} -.foobar { - color: blue; -} -.eggs { - foo: 1px 2px; - bar: 1px 2px; - foo: 100 land; - bar: 100 land; -} -#hello { - cool: one two three cool; -} -#hello-important { - cool: one two three cool !important; -} -#world { - cool: "world"; -} -#another { - things: red blue green; - things: red blue green skip me; -} -#day .cool { - color: one two three; -} -#day .cool { - color: one two three skip me; -} -.mix-suffix { - color: red !important; - height: 20px !important; -} -.mix-suffix pre { - color: red; -} -.search-test { - color: #f00 !important; - color: #0f0 !important; -} diff --git a/library/vendor/lessphp/tests/outputs/nested.css b/library/vendor/lessphp/tests/outputs/nested.css deleted file mode 100644 index 454dcfcc2..000000000 --- a/library/vendor/lessphp/tests/outputs/nested.css +++ /dev/null @@ -1,51 +0,0 @@ -#header { - color: black; -} -#header .navigation { - font-size: 12px; -} -#header .navigation .border .outside { - color: blue; -} -#header .logo { - width: 300px; -} -#header .logo:hover { - text-decoration: none; -} -a b ul li { - color: green; -} -div .cool { - color: green; -} -p .cool span { - color: yellow; -} -div another { - color: green; -} -p another span { - color: yellow; -} -b .something { - color: blue; -} -b.something { - color: blue; -} -.foo .bar .qux, -.foo .baz .qux { - display: block; -} -.qux .foo .bar, -.qux .foo .baz { - display: inline; -} -.qux .foo .bar .biz, -.qux .foo .baz .biz { - display: none; -} -b hello [x="&yeah"] { - color: red; -} diff --git a/library/vendor/lessphp/tests/outputs/nesting.css b/library/vendor/lessphp/tests/outputs/nesting.css deleted file mode 100644 index 908c1d814..000000000 --- a/library/vendor/lessphp/tests/outputs/nesting.css +++ /dev/null @@ -1,6 +0,0 @@ -#header .navigation .border .outside { color:blue; } -#header .navigation { font-size:12px; } -#header .logo:hover { text-decoration:none; } -#header .logo { width:300px; } -#header { color:black; } -a b ul li { color:green; } \ No newline at end of file diff --git a/library/vendor/lessphp/tests/outputs/pattern_matching.css b/library/vendor/lessphp/tests/outputs/pattern_matching.css deleted file mode 100644 index 215371b0a..000000000 --- a/library/vendor/lessphp/tests/outputs/pattern_matching.css +++ /dev/null @@ -1,72 +0,0 @@ -.class { - color: #a2a2a2; - display: block; -} -.zero { - zero: 0; - one: 1; - two: 2; - three: 3; -} -.one { - one: 1; - one-req: 1; - two: 2; - three: 3; -} -.two { - two: 2; - three: 3; -} -.three { - three-req: 3; - three: 3; -} -.left { - left: 1; -} -.right { - right: 1; -} -.border-right { - color: black; - border-right: 4px; -} -.border-left { - color: black; - border-left: 4px; -} -.only-right { - right: 33; -} -.only-left { - left: 33; -} -.left-right { - both: 330; -} -#hola { - color: blue; -} -#defaults_1 { - height: one; - height: two; - height: three; - height: four; -} -.thing { - color: red; -} -#aa { - color: green; - color: blue; - color: red; -} -#bb { - color: green; - color: blue; - color: red; -} -#cc { - color: blue; -} diff --git a/library/vendor/lessphp/tests/outputs/scopes.css b/library/vendor/lessphp/tests/outputs/scopes.css deleted file mode 100644 index ea2a45731..000000000 --- a/library/vendor/lessphp/tests/outputs/scopes.css +++ /dev/null @@ -1,11 +0,0 @@ -body div other world { - height: 50; -} -div other world { - height: 50; -} -pre { - height: 10; - height: 11; - height: 12; -} diff --git a/library/vendor/lessphp/tests/outputs/selector_expressions.css b/library/vendor/lessphp/tests/outputs/selector_expressions.css deleted file mode 100644 index 197c2d2ba..000000000 --- a/library/vendor/lessphp/tests/outputs/selector_expressions.css +++ /dev/null @@ -1,25 +0,0 @@ -something blue, -world { - color: blue; -} -.div 3434 { - height: 100px; -} -.div cool red { - height: 4000px; -} -.span5 { - color: 15; -} -.span4 { - color: 14; -} -.span3 { - color: 13; -} -.span2 { - color: 12; -} -.span1 { - color: 11; -} diff --git a/library/vendor/lessphp/tests/outputs/site_demos.css b/library/vendor/lessphp/tests/outputs/site_demos.css deleted file mode 100644 index 3428ad3aa..000000000 --- a/library/vendor/lessphp/tests/outputs/site_demos.css +++ /dev/null @@ -1,76 +0,0 @@ -default .underline { - border-bottom: 1px solid green; -} -default #header { - color: black; - border: 1px solid #dd44dd; -} -default #header .navigation { - font-size: 12px; -} -default #header .navigation a { - border-bottom: 1px solid green; -} -default #header .logo { - width: 300px; -} -default #header .logo:hover { - text-decoration: none; -} -variables .variables { - width: 14cm; - height: 24px; - color: #888; - background: #6c94be; - font-family: "Trebuchet MS", Verdana, sans-serif; -} -mixins .bordered { - border-top: dotted 1px black; - border-bottom: solid 2px black; -} -mixins #menu a { - color: #111; - border-top: dotted 1px black; - border-bottom: solid 2px black; -} -mixins .post a { - color: red; - border-top: dotted 1px black; - border-bottom: solid 2px black; -} -nested-rules #header { - color: black; -} -nested-rules #header .navigation { - font-size: 12px; -} -nested-rules #header .logo { - width: 300px; -} -nested-rules #header .logo:hover { - text-decoration: none; -} -namespaces #bundle .button { - display: block; - border: 1px solid black; - background-color: grey; -} -namespaces #bundle .button:hover { - background-color: white; -} -namespaces #header a { - color: orange; - display: block; - border: 1px solid black; - background-color: grey; -} -namespaces #header a:hover { - background-color: white; -} -mixin-functions body { - padding: 2.0em; - color: red; - margin: 10px; - height: 12px; - border-bottom: 1px solid green; -} diff --git a/library/vendor/lessphp/tests/outputs/variables.css b/library/vendor/lessphp/tests/outputs/variables.css deleted file mode 100644 index 70c0a30b2..000000000 --- a/library/vendor/lessphp/tests/outputs/variables.css +++ /dev/null @@ -1,20 +0,0 @@ -color: 44px; -color: 44px; -.variables { - width: 14cm; - height: 24px; - margin-top: -20px; - margin-bottom: 30px; - color: #888899; - background: #6c94be; - font-family: "Trebuchet MS", Verdana, sans-serif; - margin: 3px; - font: 10px/12px serif; - font: 120%/120% serif; -} -.external { - color: #888; - border: 1px solid #3326cc; - background: rgba(23,68,149,0.5); - padding: 4px; -} diff --git a/library/vendor/lessphp/tests/sort.php b/library/vendor/lessphp/tests/sort.php deleted file mode 100644 index 70b907eac..000000000 --- a/library/vendor/lessphp/tests/sort.php +++ /dev/null @@ -1,57 +0,0 @@ -coerceColor($value); - } - - return parent::compileValue($value); - } -} - -class SortingFormatter extends lessc_formatter_lessjs { - function sortKey($block) { - if (!isset($block->sortKey)) { - sort($block->selectors, SORT_STRING); - $block->sortKey = implode(",", $block->selectors); - } - - return $block->sortKey; - } - - function sortBlock($block) { - usort($block->children, function($a, $b) { - $sort = strcmp($this->sortKey($a), $this->sortKey($b)); - if ($sort == 0) { - // TODO - } - return $sort; - }); - - } - - function block($block) { - $this->sortBlock($block); - return parent::block($block); - } - -} - -$less = new lesscNormalized(); -$less->setFormatter(new SortingFormatter); -echo $less->parse(file_get_contents($fname)); -