forked from leafo/lessphp
-
Notifications
You must be signed in to change notification settings - Fork 11
/
lessc.inc.php
47 lines (43 loc) · 1.49 KB
/
lessc.inc.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
require __DIR__ . '/vendor/autoload.php';
/**
* lesserphp
* https://www.maswaba.de/lesserphp
*
* LESS CSS compiler, adapted from http://lesscss.org
*
* Copyright 2013, Leaf Corcoran <[email protected]>
* Copyright 2016, Marcus Schwarz <[email protected]>
* Licensed under MIT or GPLv3, see LICENSE
* @package LesserPhp
*/
/**
* The LESS compiler and parser.
*
* Converting LESS to CSS is a three stage process. The incoming file is parsed
* by `lessc_parser` into a syntax tree, then it is compiled into another tree
* representing the CSS structure by `lessc`. The CSS tree is fed into a
* formatter, like `lessc_formatter` which then outputs CSS as a string.
*
* During the first compile, all values are *reduced*, which means that their
* types are brought to the lowest form before being dump as strings. This
* handles math equations, variable dereferences, and the like.
*
* The `parse` function of `lessc` is the entry point.
*
* In summary:
*
* The `lessc` class creates an instance of the parser, feeds it LESS code,
* then transforms the resulting tree to a CSS tree. This class also holds the
* evaluation context, such as all available mixins and variables at any given
* time.
*
* The `lessc_parser` class is only concerned with parsing its input.
*
* The `lessc_formatter` takes a CSS tree, and dumps it to a formatted string,
* handling things like indentation.
*/
class lessc extends \LesserPhp\Compiler
{
// for compatibilty reasons with older copies of lessphp
}