MediaWiki  REL1_24
lessc Class Reference

lessphp v0.4.0@2cc77e3c7b http://leafo.net/lessphp More...

List of all members.

Public Member Functions

 __construct ($fname=null)
 Initialize any static state, can initialize parser for a file $opts isn't used yet.
 addImportDir ($dir)
 addParsedFile ($file)
 allParsedFiles ()
 assertArgs ($value, $expectedArgs, $name="")
 assertColor ($value, $error="expected color value")
 assertNumber ($value, $error="expecting number")
 cachedCompile ($in, $force=false)
 Execute lessphp on a .less file or a lessphp cache structure.
 checkedCompile ($in, $out)
 colorArgs ($args)
 Helper function to get arguments for color manipulation functions.
 compile ($string, $name=null)
 compileFile ($fname, $outFname=null)
 compileValue ($value)
 Compiles a primitive value into a CSS property value.
 lib_blue ($color)
 lib_green ($color)
 lib_red ($color)
 parse ($str=null, $initialVariables=null)
 registerFunction ($name, $func)
 setFormatter ($name)
 setImportDir ($dirs)
 setPreserveComments ($preserve)
 setVariables ($variables)
 throwError ($msg=null)
 Uses the current value of $this->count to show line and line number.
 toBool ($a)
 unregisterFunction ($name)
 unsetVariable ($name)

Static Public Member Functions

static ccompile ($in, $out, $less=null)
static cexecute ($in, $force=false, $less=null)
static compressList ($items, $delim)
static preg_quote ($what)

Public Attributes

 $importDir = ''
 $importDisabled = false
 $mPrefix = '$'
 $parentSelector = '&'
 $vPrefix = '@'

Static Public Attributes

static $FALSE = array("keyword", "false")
static $TRUE = array("keyword", "true")
static $VERSION = "v0.4.0"

Protected Member Functions

 clamp ($v, $max=1, $min=0)
 coerceColor ($value)
 coerceString ($value)
 compileBlock ($block)
 Recursively compiles a block.
 compileCSSBlock ($block)
 compileImportedProps ($props, $block, $out, $sourceParser, $importDir)
 compileMedia ($media)
 compileMediaQuery ($queries)
 compileNestedBlock ($block, $selectors)
 compileProp ($prop, $block, $out)
 compileProps ($block, $out)
 compileRoot ($root)
 compileSelectors ($selectors)
 deduplicate ($lines)
 Deduplicate lines in a block.
 eq ($left, $right)
 evaluate ($exp)
 expandParentSelectors (&$tag, $replace)
 fileExists ($name)
 findBlocks ($searchIn, $path, $orderedArgs, $keywordArgs, $seen=array())
 findClosestSelectors ()
 findImport ($url)
 fixColor ($c)
 flattenList ($value)
 funcToColor ($func)
 Convert the rgb, rgba, hsl color literals of function type as returned by the parser into values of color type.
 get ($name)
 injectVariables ($args)
 lib__sprintf ($args)
 lib_acos ($num)
 lib_alpha ($value)
 lib_argb ($color)
 lib_asin ($num)
 lib_atan ($num)
 lib_ceil ($arg)
 lib_contrast ($args)
 lib_cos ($num)
 lib_darken ($args)
 lib_data_uri ($value)
 Given an url, decide whether to output a regular link or the base64-encoded contents of the file.
 lib_desaturate ($args)
 lib_e ($arg)
 lib_extract ($value)
 lib_fade ($args)
 lib_fadein ($args)
 lib_fadeout ($args)
 lib_floor ($arg)
 lib_hue ($color)
 lib_iscolor ($value)
 lib_isem ($value)
 lib_iskeyword ($value)
 lib_isnumber ($value)
 lib_ispercentage ($value)
 lib_ispixel ($value)
 lib_isrem ($value)
 lib_isstring ($value)
 lib_lighten ($args)
 lib_lightness ($color)
 lib_luma ($color)
 lib_mix ($args)
 lib_mod ($args)
 lib_percentage ($arg)
 lib_pi ()
 lib_pow ($args)
 lib_rgbahex ($color)
 lib_round ($arg)
 lib_saturate ($args)
 lib_saturation ($color)
 lib_sin ($num)
 lib_spin ($args)
 lib_sqrt ($num)
 lib_tan ($num)
 lib_unit ($arg)
 makeOutputBlock ($type, $selectors=null)
 makeParser ($name)
 mediaParent ($scope)
 multiplyMedia ($env, $childQueries=null)
 multiplySelectors ($selectors)
 newFormatter ()
 op_color_color ($op, $left, $right)
 op_color_number ($op, $lft, $rgt)
 op_number_color ($op, $lft, $rgt)
 op_number_number ($op, $left, $right)
 patternMatch ($block, $orderedArgs, $keywordArgs)
 patternMatchAll ($blocks, $orderedArgs, $keywordArgs, $skip=array())
 popEnv ()
 pushEnv ($block=null)
 reduce ($value, $forExpression=false)
 set ($name, $value)
 sortProps ($props, $split=false)
 stringConcatenate ($left, $right)
 toHSL ($color)
 toRGB ($color)
 Converts a hsl array into a color value in rgb.
 toRGB_helper ($comp, $temp1, $temp2)
 tryImport ($importPath, $parentBlock, $out)
 zipSetArgs ($args, $orderedValues, $keywordValues)

Protected Attributes

 $allParsedFiles = array()
 $libFunctions = array()
 $numberPrecision = null
 $preserveComments = false
 $registeredVars = array()
 $sourceLoc = null
 $sourceParser = null

Static Protected Attributes

static $cssColors
static $nextImportId = 0

Detailed Description

lessphp v0.4.0@2cc77e3c7b http://leafo.net/lessphp

LESS CSS compiler, adapted from http://lesscss.org

For ease of distribution, lessphp 0.4.0 is under a dual license. You are free to pick which one suits your needs.

MIT LICENSE

Copyright 2013, Leaf Corcoran <[email protected]>

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.

GPL VERSION 3

Please refer to http://www.gnu.org/licenses/gpl-3.0.html for the full text of the GPL version 3 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.

Definition at line 68 of file lessc.inc.php.


Constructor & Destructor Documentation

lessc::__construct ( fname = null)

Initialize any static state, can initialize parser for a file $opts isn't used yet.

Definition at line 1903 of file lessc.inc.php.

References $fname.


Member Function Documentation

lessc::addImportDir ( dir)

Definition at line 2107 of file lessc.inc.php.

References $dir, and array().

lessc::addParsedFile ( file)

Definition at line 2116 of file lessc.inc.php.

References $file, and allParsedFiles().

Referenced by compileFile(), and tryImport().

Definition at line 2112 of file lessc.inc.php.

Referenced by addParsedFile(), cachedCompile(), and tryImport().

lessc::assertArgs ( value,
expectedArgs,
name = "" 
)

Definition at line 1319 of file lessc.inc.php.

References $name, $value, and throwError().

Referenced by lib_extract(), lib_mod(), and lib_pow().

lessc::assertColor ( value,
error = "expected color value" 
)
lessc::cachedCompile ( in,
force = false 
)

Execute lessphp on a .less file or a lessphp cache structure.

The lessphp cache structure contains information about a specific less file having been parsed. It can be used as a hint for future calls to determine whether or not a rebuild is required.

The cache structure contains two important keys that may be used externally:

compiled: The final compiled CSS updated: The time (in seconds) the CSS was last compiled

The cache structure is a plain-ol' PHP associative array and can be serialized and unserialized without a hitch.

Parameters:
mixed$inInput
bool$forceForce rebuild?
Returns:
array lessphp cache structure

Definition at line 1990 of file lessc.inc.php.

References $fname, $in, $out, allParsedFiles(), array(), as, and compileFile().

static lessc::ccompile ( in,
out,
less = null 
) [static]

Definition at line 2132 of file lessc.inc.php.

References $in, and $out.

static lessc::cexecute ( in,
force = false,
less = null 
) [static]

Definition at line 2139 of file lessc.inc.php.

References $in.

lessc::checkedCompile ( in,
out 
)

Definition at line 1962 of file lessc.inc.php.

References $in, $out, and compileFile().

lessc::clamp ( v,
max = 1,
min = 0 
) [protected]
lessc::coerceString ( value) [protected]

Definition at line 1622 of file lessc.inc.php.

References $value, and array().

Referenced by stringConcatenate(), and tryImport().

lessc::colorArgs ( args)

Helper function to get arguments for color manipulation functions.

takes a list that contains a color like thing and a percentage

Definition at line 1129 of file lessc.inc.php.

References array(), assertColor(), and list.

Referenced by lib_darken(), lib_desaturate(), lib_fade(), lib_fadein(), lib_fadeout(), lib_lighten(), lib_saturate(), and lib_spin().

lessc::compile ( string,
name = null 
)

Definition at line 1910 of file lessc.inc.php.

References $name, $out, compileBlock(), empty, injectVariables(), makeParser(), and newFormatter().

Referenced by compileFile(), and parse().

lessc::compileBlock ( block) [protected]

Recursively compiles a block.

A block is analogous to a CSS block in most cases. A single LESS document is encapsulated in a block when parsed, but it does not have parent tags so all of it's children appear on the root level when compiled.

Blocks are made up of props and children.

Props are property instructions, array tuples which describe an action to be taken, eg. write a property, set a variable, mixin a block.

The children of a block are just all the blocks that are defined within. This is used to look up mixins when performing a mixin.

Compiling the block involves pushing a fresh environment on the stack, and iterating through the props, compiling each one.

See lessc::compileProp()

Definition at line 217 of file lessc.inc.php.

References $name, array(), compileCSSBlock(), compileMedia(), compileNestedBlock(), compileRoot(), compileValue(), empty, reduce(), and throwError().

Referenced by compile(), and compileProp().

lessc::compileCSSBlock ( block) [protected]
lessc::compileFile ( fname,
outFname = null 
)

Definition at line 1936 of file lessc.inc.php.

References $fname, $out, addParsedFile(), array(), and compile().

Referenced by cachedCompile(), checkedCompile(), and parse().

lessc::compileImportedProps ( props,
block,
out,
sourceParser,
importDir 
) [protected]

Definition at line 179 of file lessc.inc.php.

References $importDir, $out, array(), as, and compileProp().

Referenced by compileProp(), and tryImport().

lessc::compileMediaQuery ( queries) [protected]

Definition at line 383 of file lessc.inc.php.

References $out, $queries, $query, array(), as, compileValue(), empty, and reduce().

Referenced by compileMedia().

lessc::compileNestedBlock ( block,
selectors 
) [protected]

Definition at line 291 of file lessc.inc.php.

References compileProps(), makeOutputBlock(), popEnv(), and pushEnv().

Referenced by compileBlock().

lessc::compileProps ( block,
out 
) [protected]

Definition at line 309 of file lessc.inc.php.

References $out, as, compileProp(), deduplicate(), and sortProps().

Referenced by compileCSSBlock(), compileMedia(), compileNestedBlock(), and compileRoot().

lessc::compileRoot ( root) [protected]

Definition at line 302 of file lessc.inc.php.

References compileProps(), makeOutputBlock(), popEnv(), and pushEnv().

Referenced by compileBlock().

lessc::compileSelectors ( selectors) [protected]

Definition at line 504 of file lessc.inc.php.

References $out, $s, $value, array(), as, compileValue(), list, and reduce().

Referenced by compileCSSBlock().

lessc::compileValue ( value)

Compiles a primitive value into a CSS property value.

Values in lessphp are typed by being wrapped in arrays, their format is typically:

array(type, contents [, additional_contents]*)

The input is expected to be reduced. This function will not work on things like expressions and variables.

Definition at line 850 of file lessc.inc.php.

References $content, $name, $value, array(), as, coerceColor(), empty, list, and throwError().

Referenced by compileBlock(), compileMediaQuery(), compileProp(), compileSelectors(), lib__sprintf(), lib_e(), lib_unit(), reduce(), and tryImport().

static lessc::compressList ( items,
delim 
) [static]

Definition at line 112 of file lessc.inc.php.

References array().

Referenced by lessc_parser\expressionList(), lessc_parser\propertyValue(), and reduce().

lessc::deduplicate ( lines) [protected]

Deduplicate lines in a block.

Comments are not deduplicated. If a duplicate rule is detected, the comments immediately preceding each occurence are consolidated.

Definition at line 321 of file lessc.inc.php.

References $lines, array(), and as.

Referenced by compileProps().

lessc::eq ( left,
right 
) [protected]

Definition at line 519 of file lessc.inc.php.

References $right.

Referenced by evaluate(), and patternMatch().

lessc::evaluate ( exp) [protected]

Definition at line 1646 of file lessc.inc.php.

References $fname, $out, $right, array(), coerceColor(), eq(), list, reduce(), stringConcatenate(), and toBool().

Referenced by reduce().

lessc::expandParentSelectors ( &$  tag,
replace 
) [protected]

Definition at line 446 of file lessc.inc.php.

References $count, and as.

Referenced by multiplySelectors().

lessc::fileExists ( name) [protected]

Definition at line 108 of file lessc.inc.php.

References $name.

Referenced by findImport().

lessc::findBlocks ( searchIn,
path,
orderedArgs,
keywordArgs,
seen = array() 
) [protected]

Definition at line 623 of file lessc.inc.php.

References $matches, $name, $path, array(), as, empty, and patternMatchAll().

Referenced by compileProp().

lessc::findClosestSelectors ( ) [protected]

Definition at line 457 of file lessc.inc.php.

Referenced by compileMedia(), and multiplySelectors().

lessc::findImport ( url) [protected]

Definition at line 97 of file lessc.inc.php.

References $dir, $file, array(), as, and fileExists().

Referenced by lib_data_uri(), and tryImport().

lessc::fixColor ( c) [protected]

Definition at line 1708 of file lessc.inc.php.

References as.

Referenced by funcToColor(), lib_mix(), and op_color_color().

lessc::flattenList ( value) [protected]

Definition at line 1633 of file lessc.inc.php.

References $value.

Referenced by tryImport().

lessc::funcToColor ( func) [protected]

Convert the rgb, rgba, hsl color literals of function type as returned by the parser into values of color type.

Definition at line 1423 of file lessc.inc.php.

References $fname, array(), as, clamp(), fixColor(), reduce(), and toRGB().

Referenced by reduce().

lessc::get ( name) [protected]

Definition at line 1863 of file lessc.inc.php.

References $name, array(), and throwError().

lessc::injectVariables ( args) [protected]

Definition at line 1884 of file lessc.inc.php.

References $name, $parser, $value, as, and pushEnv().

Referenced by compile().

lessc::lib__sprintf ( args) [protected]

Definition at line 1066 of file lessc.inc.php.

References array(), as, coerceColor(), compileValue(), lib_e(), and reduce().

lessc::lib_acos ( num) [protected]

Definition at line 950 of file lessc.inc.php.

References array(), and assertNumber().

lessc::lib_alpha ( value) [protected]

Definition at line 1212 of file lessc.inc.php.

References $value, and coerceColor().

Referenced by lib_contrast(), and lib_mix().

lessc::lib_argb ( color) [protected]

Definition at line 1010 of file lessc.inc.php.

References lib_rgbahex().

lessc::lib_asin ( num) [protected]

Definition at line 945 of file lessc.inc.php.

References array(), and assertNumber().

lessc::lib_atan ( num) [protected]

Definition at line 940 of file lessc.inc.php.

References array(), and assertNumber().

lessc::lib_blue ( color)

Definition at line 1778 of file lessc.inc.php.

References coerceColor(), and throwError().

lessc::lib_ceil ( arg) [protected]

Definition at line 1099 of file lessc.inc.php.

References $value, array(), and assertNumber().

lessc::lib_contrast ( args) [protected]

Definition at line 1269 of file lessc.inc.php.

References $t, array(), assertColor(), assertNumber(), coerceColor(), lib_alpha(), and lib_luma().

lessc::lib_cos ( num) [protected]

Definition at line 936 of file lessc.inc.php.

References assertNumber().

lessc::lib_darken ( args) [protected]

Definition at line 1140 of file lessc.inc.php.

References clamp(), colorArgs(), list, toHSL(), and toRGB().

lessc::lib_data_uri ( value) [protected]

Given an url, decide whether to output a regular link or the base64-encoded contents of the file.

Parameters:
array$valueeither an argument list (two strings) or a single string
Returns:
string formatted url(), either as a link or base64-encoded

Definition at line 1020 of file lessc.inc.php.

References $mime, $value, and findImport().

lessc::lib_desaturate ( args) [protected]

Definition at line 1164 of file lessc.inc.php.

References clamp(), colorArgs(), list, toHSL(), and toRGB().

lessc::lib_e ( arg) [protected]

Definition at line 1048 of file lessc.inc.php.

References array(), compileValue(), and throwError().

Referenced by lib__sprintf(), lib_unit(), reduce(), and tryImport().

lessc::lib_extract ( value) [protected]

Definition at line 959 of file lessc.inc.php.

References $value, assertArgs(), assertNumber(), and list.

lessc::lib_fade ( args) [protected]

Definition at line 1219 of file lessc.inc.php.

References clamp(), colorArgs(), and list.

lessc::lib_fadein ( args) [protected]

Definition at line 1189 of file lessc.inc.php.

References clamp(), colorArgs(), and list.

lessc::lib_fadeout ( args) [protected]

Definition at line 1183 of file lessc.inc.php.

References clamp(), colorArgs(), and list.

lessc::lib_floor ( arg) [protected]

Definition at line 1094 of file lessc.inc.php.

References $value, array(), and assertNumber().

lessc::lib_green ( color)

Definition at line 1769 of file lessc.inc.php.

References coerceColor(), and throwError().

lessc::lib_hue ( color) [protected]

Definition at line 1195 of file lessc.inc.php.

References assertColor(), and toHSL().

lessc::lib_iscolor ( value) [protected]

Definition at line 976 of file lessc.inc.php.

References $value, coerceColor(), and toBool().

lessc::lib_isem ( value) [protected]

Definition at line 992 of file lessc.inc.php.

References $value, and toBool().

lessc::lib_iskeyword ( value) [protected]

Definition at line 980 of file lessc.inc.php.

References $value, and toBool().

lessc::lib_isnumber ( value) [protected]

Definition at line 968 of file lessc.inc.php.

References $value, and toBool().

lessc::lib_ispercentage ( value) [protected]

Definition at line 988 of file lessc.inc.php.

References $value, and toBool().

lessc::lib_ispixel ( value) [protected]

Definition at line 984 of file lessc.inc.php.

References $value, and toBool().

lessc::lib_isrem ( value) [protected]

Definition at line 996 of file lessc.inc.php.

References $value, and toBool().

lessc::lib_isstring ( value) [protected]

Definition at line 972 of file lessc.inc.php.

References $value, and toBool().

lessc::lib_lighten ( args) [protected]

Definition at line 1148 of file lessc.inc.php.

References clamp(), colorArgs(), list, toHSL(), and toRGB().

lessc::lib_lightness ( color) [protected]

Definition at line 1205 of file lessc.inc.php.

References assertColor(), and toHSL().

lessc::lib_luma ( color) [protected]

Definition at line 1302 of file lessc.inc.php.

References coerceColor().

Referenced by lib_contrast().

lessc::lib_mix ( args) [protected]

Definition at line 1233 of file lessc.inc.php.

References array(), assertColor(), fixColor(), lib_alpha(), list, and throwError().

lessc::lib_mod ( args) [protected]

Definition at line 923 of file lessc.inc.php.

References assertArgs(), assertNumber(), and list.

lessc::lib_percentage ( arg) [protected]

Definition at line 1225 of file lessc.inc.php.

References array(), and assertNumber().

lessc::lib_pi ( ) [protected]

Definition at line 919 of file lessc.inc.php.

lessc::lib_pow ( args) [protected]

Definition at line 914 of file lessc.inc.php.

References assertArgs(), assertNumber(), and list.

lessc::lib_red ( color)

Definition at line 1760 of file lessc.inc.php.

References coerceColor(), and throwError().

lessc::lib_rgbahex ( color) [protected]

Definition at line 1000 of file lessc.inc.php.

References coerceColor(), and throwError().

Referenced by lib_argb().

lessc::lib_round ( arg) [protected]

Definition at line 1104 of file lessc.inc.php.

References $value, array(), and assertNumber().

lessc::lib_saturate ( args) [protected]

Definition at line 1156 of file lessc.inc.php.

References clamp(), colorArgs(), list, toHSL(), and toRGB().

lessc::lib_saturation ( color) [protected]

Definition at line 1200 of file lessc.inc.php.

References assertColor(), and toHSL().

lessc::lib_sin ( num) [protected]

Definition at line 932 of file lessc.inc.php.

References assertNumber().

lessc::lib_spin ( args) [protected]

Definition at line 1172 of file lessc.inc.php.

References colorArgs(), list, toHSL(), and toRGB().

lessc::lib_sqrt ( num) [protected]

Definition at line 955 of file lessc.inc.php.

References assertNumber().

lessc::lib_tan ( num) [protected]

Definition at line 928 of file lessc.inc.php.

References assertNumber().

lessc::lib_unit ( arg) [protected]

Definition at line 1115 of file lessc.inc.php.

References array(), assertNumber(), compileValue(), lib_e(), and list.

lessc::makeOutputBlock ( type,
selectors = null 
) [protected]

Definition at line 1828 of file lessc.inc.php.

References $type, and array().

Referenced by compileCSSBlock(), compileMedia(), compileNestedBlock(), and compileRoot().

lessc::makeParser ( name) [protected]

Definition at line 2061 of file lessc.inc.php.

References $name, and $parser.

Referenced by compile(), and tryImport().

lessc::mediaParent ( scope) [protected]

Definition at line 280 of file lessc.inc.php.

References empty.

Referenced by compileMedia().

lessc::multiplyMedia ( env,
childQueries = null 
) [protected]

Definition at line 419 of file lessc.inc.php.

References $out, $queries, array(), as, and empty.

Referenced by compileMedia().

lessc::multiplySelectors ( selectors) [protected]

Definition at line 473 of file lessc.inc.php.

References $count, $out, $s, array(), as, expandParentSelectors(), and findClosestSelectors().

Referenced by compileCSSBlock().

lessc::newFormatter ( ) [protected]

Definition at line 2072 of file lessc.inc.php.

References empty.

Referenced by compile().

lessc::op_color_color ( op,
left,
right 
) [protected]

Definition at line 1730 of file lessc.inc.php.

References $out, $right, array(), as, fixColor(), and throwError().

Referenced by op_color_number().

lessc::op_color_number ( op,
lft,
rgt 
) [protected]

Definition at line 1723 of file lessc.inc.php.

References op_color_color().

Referenced by op_number_color().

lessc::op_number_color ( op,
lft,
rgt 
) [protected]

Definition at line 1717 of file lessc.inc.php.

References op_color_number().

lessc::op_number_number ( op,
left,
right 
) [protected]

Definition at line 1789 of file lessc.inc.php.

References $right, $value, array(), empty, throwError(), and toBool().

lessc::parse ( str = null,
initialVariables = null 
)

Definition at line 2036 of file lessc.inc.php.

References $out, compile(), compileFile(), empty, and setVariables().

lessc::patternMatch ( block,
orderedArgs,
keywordArgs 
) [protected]

Definition at line 523 of file lessc.inc.php.

References $TRUE, array(), as, empty, eq(), popEnv(), pushEnv(), reduce(), and zipSetArgs().

Referenced by patternMatchAll().

lessc::patternMatchAll ( blocks,
orderedArgs,
keywordArgs,
skip = array() 
) [protected]

Definition at line 606 of file lessc.inc.php.

References $matches, as, and patternMatch().

Referenced by findBlocks().

static lessc::preg_quote ( what) [static]
lessc::pushEnv ( block = null) [protected]
lessc::registerFunction ( name,
func 
)

Definition at line 2087 of file lessc.inc.php.

References $name.

lessc::set ( name,
value 
) [protected]

Definition at line 1857 of file lessc.inc.php.

References $name, and $value.

lessc::setFormatter ( name)

Definition at line 2068 of file lessc.inc.php.

References $name.

lessc::setImportDir ( dirs)

Definition at line 2103 of file lessc.inc.php.

References $dirs, and array().

lessc::setPreserveComments ( preserve)

Definition at line 2083 of file lessc.inc.php.

lessc::setVariables ( variables)

Definition at line 2095 of file lessc.inc.php.

Referenced by parse().

lessc::sortProps ( props,
split = false 
) [protected]

Definition at line 339 of file lessc.inc.php.

References $vars, array(), and as.

Referenced by compileProp(), compileProps(), and tryImport().

lessc::stringConcatenate ( left,
right 
) [protected]

Definition at line 1691 of file lessc.inc.php.

References $right, and coerceString().

Referenced by evaluate().

lessc::throwError ( msg = null)

Uses the current value of $this->count to show line and line number.

Definition at line 2123 of file lessc.inc.php.

Referenced by assertArgs(), assertColor(), assertNumber(), compileBlock(), compileProp(), compileValue(), get(), lib_blue(), lib_e(), lib_green(), lib_mix(), lib_red(), lib_rgbahex(), op_color_color(), op_number_number(), reduce(), and zipSetArgs().

lessc::toHSL ( color) [protected]
lessc::toRGB ( color) [protected]

Converts a hsl array into a color value in rgb.

Expects H to be in range of 0 to 360, S and L in 0 to 100

Definition at line 1388 of file lessc.inc.php.

References $out, array(), and toRGB_helper().

Referenced by funcToColor(), lib_darken(), lib_desaturate(), lib_lighten(), lib_saturate(), and lib_spin().

lessc::toRGB_helper ( comp,
temp1,
temp2 
) [protected]

Definition at line 1373 of file lessc.inc.php.

Referenced by toRGB().

lessc::tryImport ( importPath,
parentBlock,
out 
) [protected]

Definition at line 2091 of file lessc.inc.php.

References $name.

lessc::unsetVariable ( name)

Definition at line 2099 of file lessc.inc.php.

References $name.

lessc::zipSetArgs ( args,
orderedValues,
keywordValues 
) [protected]

Definition at line 661 of file lessc.inc.php.

References $last, $value, array(), as, reduce(), and throwError().

Referenced by compileProp(), and patternMatch().


Member Data Documentation

lessc::$allParsedFiles = array() [protected]

Definition at line 87 of file lessc.inc.php.

lessc::$cssColors [static, protected]

Definition at line 2146 of file lessc.inc.php.

lessc::$FALSE = array("keyword", "false") [static]

Definition at line 72 of file lessc.inc.php.

Referenced by toBool().

lessc::$importDir = ''

Definition at line 83 of file lessc.inc.php.

Referenced by compileImportedProps(), and compileProp().

lessc::$importDisabled = false

Definition at line 82 of file lessc.inc.php.

lessc::$libFunctions = array() [protected]

Definition at line 74 of file lessc.inc.php.

lessc::$mPrefix = '$'

Definition at line 79 of file lessc.inc.php.

lessc::$nextImportId = 0 [static, protected]

Definition at line 94 of file lessc.inc.php.

lessc::$numberPrecision = null [protected]

Definition at line 85 of file lessc.inc.php.

lessc::$parentSelector = '&'

Definition at line 80 of file lessc.inc.php.

lessc::$preserveComments = false [protected]

Definition at line 76 of file lessc.inc.php.

lessc::$registeredVars = array() [protected]

Definition at line 75 of file lessc.inc.php.

lessc::$sourceLoc = null [protected]

Definition at line 92 of file lessc.inc.php.

lessc::$sourceParser = null [protected]

Definition at line 91 of file lessc.inc.php.

lessc::$TRUE = array("keyword", "true") [static]

Definition at line 71 of file lessc.inc.php.

Referenced by patternMatch(), and toBool().

lessc::$VERSION = "v0.4.0" [static]

Definition at line 69 of file lessc.inc.php.

lessc::$vPrefix = '@'

Definition at line 78 of file lessc.inc.php.


The documentation for this class was generated from the following file: