MediaWiki  1.23.0
lessc Class Reference

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

Public Member Functions

 __construct ($fname=null)
 Initialize any static state, can initialize parser for a file $opts isn't used yet. More...
 
 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. More...
 
 checkedCompile ($in, $out)
 
 colorArgs ($args)
 Helper function to get arguments for color manipulation functions. More...
 
 compile ($string, $name=null)
 
 compileFile ($fname, $outFname=null)
 
 compileValue ($value)
 Compiles a primitive value into a CSS property value. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 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. More...
 
 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 leafo.nosp@m.t@gm.nosp@m.ail.c.nosp@m.om

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.

Member Function Documentation

◆ __construct()

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.

◆ addImportDir()

lessc::addImportDir (   $dir)

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

References $dir, and array().

◆ addParsedFile()

lessc::addParsedFile (   $file)

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

References $file, and allParsedFiles().

Referenced by compileFile(), and tryImport().

◆ allParsedFiles()

lessc::allParsedFiles ( )

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

References $allParsedFiles.

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

◆ assertArgs()

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().

◆ assertColor()

lessc::assertColor (   $value,
  $error = "expected color value" 
)

◆ assertNumber()

lessc::assertNumber (   $value,
  $error = "expecting number" 
)

◆ cachedCompile()

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().

◆ ccompile()

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

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

References $in, and $out.

◆ cexecute()

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

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

References $in.

◆ checkedCompile()

lessc::checkedCompile (   $in,
  $out 
)

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

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

◆ clamp()

lessc::clamp (   $v,
  $max = 1,
  $min = 0 
)
protected

◆ coerceColor()

lessc::coerceColor (   $value)
protected

◆ coerceString()

lessc::coerceString (   $value)
protected

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

References $value, and array().

Referenced by stringConcatenate(), and tryImport().

◆ colorArgs()

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 $args, array(), assertColor(), and list.

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

◆ compile()

lessc::compile (   $string,
  $name = null 
)

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

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

Referenced by compileFile(), and parse().

◆ compileBlock()

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(), reduce(), and throwError().

Referenced by compile(), and compileProp().

◆ compileCSSBlock()

lessc::compileCSSBlock (   $block)
protected

◆ compileFile()

lessc::compileFile (   $fname,
  $outFname = null 
)

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

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

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

◆ compileImportedProps()

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

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

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

Referenced by compileProp(), and tryImport().

◆ compileMedia()

lessc::compileMedia (   $media)
protected

◆ compileMediaQuery()

lessc::compileMediaQuery (   $queries)
protected

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

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

Referenced by compileMedia().

◆ compileNestedBlock()

lessc::compileNestedBlock (   $block,
  $selectors 
)
protected

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

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

Referenced by compileBlock().

◆ compileProp()

lessc::compileProp (   $prop,
  $block,
  $out 
)
protected

◆ compileProps()

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().

◆ compileRoot()

lessc::compileRoot (   $root)
protected

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

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

Referenced by compileBlock().

◆ compileSelectors()

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().

◆ compileValue()

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 $args, $name, $value, array(), as, coerceColor(), list, and throwError().

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

◆ compressList()

static lessc::compressList (   $items,
  $delim 
)
static

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

References array().

Referenced by lessc_parser::expressionList(), and lessc_parser::propertyValue().

◆ deduplicate()

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 $line, $lines, array(), and as.

Referenced by compileProps().

◆ eq()

lessc::eq (   $left,
  $right 
)
protected

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

References $right.

Referenced by evaluate(), and patternMatch().

◆ evaluate()

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().

◆ expandParentSelectors()

lessc::expandParentSelectors ( $tag,
  $replace 
)
protected

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

References $count, and as.

Referenced by multiplySelectors().

◆ fileExists()

lessc::fileExists (   $name)
protected

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

References $name.

Referenced by findImport().

◆ findBlocks()

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

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

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

Referenced by compileProp().

◆ findClosestSelectors()

lessc::findClosestSelectors ( )
protected

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

Referenced by compileMedia(), and multiplySelectors().

◆ findImport()

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().

◆ fixColor()

lessc::fixColor (   $c)
protected

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

References as.

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

◆ flattenList()

lessc::flattenList (   $value)
protected

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

References $value.

Referenced by tryImport().

◆ funcToColor()

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().

◆ get()

lessc::get (   $name)
protected

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

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

Referenced by reduce().

◆ injectVariables()

lessc::injectVariables (   $args)
protected

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

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

Referenced by compile().

◆ lib__sprintf()

lessc::lib__sprintf (   $args)
protected

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

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

◆ lib_acos()

lessc::lib_acos (   $num)
protected

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

References array(), and assertNumber().

◆ lib_alpha()

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().

◆ lib_argb()

lessc::lib_argb (   $color)
protected

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

References lib_rgbahex().

◆ lib_asin()

lessc::lib_asin (   $num)
protected

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

References array(), and assertNumber().

◆ lib_atan()

lessc::lib_atan (   $num)
protected

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

References array(), and assertNumber().

◆ lib_blue()

lessc::lib_blue (   $color)

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

References coerceColor(), and throwError().

◆ lib_ceil()

lessc::lib_ceil (   $arg)
protected

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

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

◆ lib_contrast()

lessc::lib_contrast (   $args)
protected

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

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

◆ lib_cos()

lessc::lib_cos (   $num)
protected

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

References assertNumber().

◆ lib_darken()

lessc::lib_darken (   $args)
protected

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

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

◆ lib_data_uri()

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().

◆ lib_desaturate()

lessc::lib_desaturate (   $args)
protected

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

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

◆ lib_e()

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().

◆ lib_extract()

lessc::lib_extract (   $value)
protected

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

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

◆ lib_fade()

lessc::lib_fade (   $args)
protected

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

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

◆ lib_fadein()

lessc::lib_fadein (   $args)
protected

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

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

◆ lib_fadeout()

lessc::lib_fadeout (   $args)
protected

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

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

◆ lib_floor()

lessc::lib_floor (   $arg)
protected

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

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

◆ lib_green()

lessc::lib_green (   $color)

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

References coerceColor(), and throwError().

◆ lib_hue()

lessc::lib_hue (   $color)
protected

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

References assertColor(), and toHSL().

◆ lib_iscolor()

lessc::lib_iscolor (   $value)
protected

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

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

◆ lib_isem()

lessc::lib_isem (   $value)
protected

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

References $value, and toBool().

◆ lib_iskeyword()

lessc::lib_iskeyword (   $value)
protected

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

References $value, and toBool().

◆ lib_isnumber()

lessc::lib_isnumber (   $value)
protected

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

References $value, and toBool().

◆ lib_ispercentage()

lessc::lib_ispercentage (   $value)
protected

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

References $value, and toBool().

◆ lib_ispixel()

lessc::lib_ispixel (   $value)
protected

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

References $value, and toBool().

◆ lib_isrem()

lessc::lib_isrem (   $value)
protected

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

References $value, and toBool().

◆ lib_isstring()

lessc::lib_isstring (   $value)
protected

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

References $value, and toBool().

◆ lib_lighten()

lessc::lib_lighten (   $args)
protected

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

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

◆ lib_lightness()

lessc::lib_lightness (   $color)
protected

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

References assertColor(), and toHSL().

◆ lib_luma()

lessc::lib_luma (   $color)
protected

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

References coerceColor().

Referenced by lib_contrast().

◆ lib_mix()

lessc::lib_mix (   $args)
protected

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

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

◆ lib_mod()

lessc::lib_mod (   $args)
protected

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

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

◆ lib_percentage()

lessc::lib_percentage (   $arg)
protected

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

References array(), and assertNumber().

◆ lib_pi()

lessc::lib_pi ( )
protected

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

◆ lib_pow()

lessc::lib_pow (   $args)
protected

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

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

◆ lib_red()

lessc::lib_red (   $color)

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

References coerceColor(), and throwError().

◆ lib_rgbahex()

lessc::lib_rgbahex (   $color)
protected

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

References coerceColor(), and throwError().

Referenced by lib_argb().

◆ lib_round()

lessc::lib_round (   $arg)
protected

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

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

◆ lib_saturate()

lessc::lib_saturate (   $args)
protected

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

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

◆ lib_saturation()

lessc::lib_saturation (   $color)
protected

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

References assertColor(), and toHSL().

◆ lib_sin()

lessc::lib_sin (   $num)
protected

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

References assertNumber().

◆ lib_spin()

lessc::lib_spin (   $args)
protected

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

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

◆ lib_sqrt()

lessc::lib_sqrt (   $num)
protected

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

References assertNumber().

◆ lib_tan()

lessc::lib_tan (   $num)
protected

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

References assertNumber().

◆ lib_unit()

lessc::lib_unit (   $arg)
protected

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

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

◆ makeOutputBlock()

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().

◆ makeParser()

lessc::makeParser (   $name)
protected

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

References $name, $parser, and $preserveComments.

Referenced by compile(), and tryImport().

◆ mediaParent()

lessc::mediaParent (   $scope)
protected

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

Referenced by compileMedia().

◆ multiplyMedia()

lessc::multiplyMedia (   $env,
  $childQueries = null 
)
protected

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

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

Referenced by compileMedia().

◆ multiplySelectors()

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().

◆ newFormatter()

lessc::newFormatter ( )
protected

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

Referenced by compile().

◆ op_color_color()

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().

◆ 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().

◆ op_number_color()

lessc::op_number_color (   $op,
  $lft,
  $rgt 
)
protected

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

References op_color_number().

◆ op_number_number()

lessc::op_number_number (   $op,
  $left,
  $right 
)
protected

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

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

◆ parse()

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

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

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

◆ patternMatch()

lessc::patternMatch (   $block,
  $orderedArgs,
  $keywordArgs 
)
protected

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

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

Referenced by patternMatchAll().

◆ 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().

◆ popEnv()

lessc::popEnv ( )
protected

◆ preg_quote()

static lessc::preg_quote (   $what)
static

◆ pushEnv()

lessc::pushEnv (   $block = null)
protected

◆ reduce()

lessc::reduce (   $value,
  $forExpression = false 
)
protected

◆ registerFunction()

lessc::registerFunction (   $name,
  $func 
)

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

References $name.

◆ set()

lessc::set (   $name,
  $value 
)
protected

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

References $name, and $value.

Referenced by compileProp(), injectVariables(), and zipSetArgs().

◆ setFormatter()

lessc::setFormatter (   $name)

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

References $name.

◆ setImportDir()

lessc::setImportDir (   $dirs)

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

References $dirs, and array().

◆ setPreserveComments()

lessc::setPreserveComments (   $preserve)

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

◆ setVariables()

lessc::setVariables (   $variables)

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

Referenced by parse().

◆ sortProps()

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().

◆ stringConcatenate()

lessc::stringConcatenate (   $left,
  $right 
)
protected

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

References $right, and coerceString().

Referenced by evaluate().

◆ throwError()

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().

◆ toBool()

◆ toHSL()

lessc::toHSL (   $color)
protected

◆ toRGB()

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().

◆ toRGB_helper()

lessc::toRGB_helper (   $comp,
  $temp1,
  $temp2 
)
protected

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

Referenced by toRGB().

◆ tryImport()

lessc::tryImport (   $importPath,
  $parentBlock,
  $out 
)
protected

◆ unregisterFunction()

lessc::unregisterFunction (   $name)

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

References $name.

◆ unsetVariable()

lessc::unsetVariable (   $name)

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

References $name.

◆ zipSetArgs()

lessc::zipSetArgs (   $args,
  $orderedValues,
  $keywordValues 
)
protected

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

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

Referenced by compileProp(), and patternMatch().

Member Data Documentation

◆ $allParsedFiles

lessc::$allParsedFiles = array()
protected

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

Referenced by allParsedFiles().

◆ $cssColors

lessc::$cssColors
staticprotected

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

◆ $FALSE

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

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

◆ $importDir

lessc::$importDir = ''

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

Referenced by compileFile(), compileImportedProps(), and compileProp().

◆ $importDisabled

lessc::$importDisabled = false

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

◆ $libFunctions

lessc::$libFunctions = array()
protected

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

◆ $mPrefix

lessc::$mPrefix = '$'

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

◆ $nextImportId

lessc::$nextImportId = 0
staticprotected

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

◆ $numberPrecision

lessc::$numberPrecision = null
protected

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

◆ $parentSelector

lessc::$parentSelector = '&'

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

◆ $preserveComments

lessc::$preserveComments = false
protected

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

Referenced by makeParser().

◆ $registeredVars

lessc::$registeredVars = array()
protected

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

Referenced by parse().

◆ $sourceLoc

lessc::$sourceLoc = null
protected

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

◆ $sourceParser

lessc::$sourceParser = null
protected

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

Referenced by compileImportedProps().

◆ $TRUE

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

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

◆ $VERSION

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

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

◆ $vPrefix

lessc::$vPrefix = '@'

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

Referenced by compileProp().


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