Parse and compile Less files into CSS.
More...
|
| | __construct ( $env=null) |
|
| Reset ( $options=null) |
| | Reset the parser state completely.
|
|
| SetOptions ( $options) |
| | Set one or more compiler options.
|
|
| SetOption ( $option, $value) |
| | Set one compiler option.
|
| | registerFunction ( $name, $callback) |
| | Registers a new custom function.
|
| | unregisterFunction ( $name) |
| | Removed an already registered function.
|
| | getCss () |
| | Get the current css buffer.
|
|
| findValueOf ( $varName) |
| | getVariables () |
| | Get an array of the found variables in the parsed input.
|
|
| findVarByName ( $var_name) |
| | parse ( $str, $file_uri=null) |
| | Parse a Less string.
|
| | parseFile ( $filename, $uri_root='', $returnRoot=false) |
| | Parse a Less string from a given file.
|
| | ModifyVars ( $vars) |
| | Allows a user to set variables values.
|
| | SetFileInfo ( $filename, $uri_root='') |
| | SetCacheDir ( $dir) |
| | SetImportDirs ( $dirs) |
| | Set a list of directories or callbacks the parser should use for determining import paths.
|
| | getParsedFiles () |
| | parseNode ( $str, array $parseList, $currentIndex, $fileInfo) |
| | Used after initial parsing to create nodes on the fly.
|
| | parseConditionAnd ( $needsParens) |
| | negatedCondition ( $needsParens) |
| | parenthesisCondition ( $needsParens) |
| | atomicCondition () |
| | Error ( $msg) |
|
| CacheEnabled () |
|
|
static | serializeVars ( $vars) |
|
static | round ( $input, $precision=0) |
| | Round numbers similarly to javascript eg: 1.499999 to 1 instead of 2.
|
|
static | WinPath ( $path) |
|
static | AbsPath ( $path, $winPath=false) |
|
|
static | $default_options |
|
static | $options = [] |
|
static | $has_extends = false |
|
static | $next_id = 0 |
|
static | $contentsMap = [] |
Parse and compile Less files into CSS.
◆ __construct()
| Less_Parser::__construct |
( |
| $env = null | ) |
|
- Parameters
-
| Less_Environment | array | null | $env | |
◆ atomicCondition()
| Less_Parser::atomicCondition |
( |
| ) |
|
- See also
- less-3.13.1.js#Parser.atomicCondition
◆ Error()
| Less_Parser::Error |
( |
| $msg | ) |
|
◆ getCss()
Get the current css buffer.
- Returns
- string
◆ getParsedFiles()
| Less_Parser::getParsedFiles |
( |
| ) |
|
- Since
- 4.3.0
- Returns
- string[]
◆ getVariables()
| Less_Parser::getVariables |
( |
| ) |
|
Get an array of the found variables in the parsed input.
- Returns
- array
◆ ModifyVars()
| Less_Parser::ModifyVars |
( |
| $vars | ) |
|
Allows a user to set variables values.
- Parameters
-
- Returns
- $this
◆ negatedCondition()
| Less_Parser::negatedCondition |
( |
| $needsParens | ) |
|
- See also
- less-3.13.1.js#Parser.negatedCondition
◆ parenthesisCondition()
| Less_Parser::parenthesisCondition |
( |
| $needsParens | ) |
|
- See also
- less-3.13.1.js#Parser.parenthesisCondition
◆ parse()
| Less_Parser::parse |
( |
| $str, |
|
|
| $file_uri = null ) |
Parse a Less string.
- Exceptions
-
- Parameters
-
| string | $str | The string to convert |
| string | null | $file_uri | The url of the file |
- Returns
- $this
◆ parseConditionAnd()
| Less_Parser::parseConditionAnd |
( |
| $needsParens | ) |
|
- See also
- less-3.13.1.js#Parser.conditionAnd
◆ parseFile()
| Less_Parser::parseFile |
( |
| $filename, |
|
|
| $uri_root = '', |
|
|
| $returnRoot = false ) |
Parse a Less string from a given file.
- Exceptions
-
- Parameters
-
| string | $filename | The file to parse |
| string | $uri_root | The url of the file |
| bool | $returnRoot | Indicates whether the return value should be a css string a root node |
- Returns
- Less_Tree_Ruleset|$this
◆ parseNode()
| Less_Parser::parseNode |
( |
| $str, |
|
|
array | $parseList, |
|
|
| $currentIndex, |
|
|
| $fileInfo ) |
Used after initial parsing to create nodes on the fly.
- Parameters
-
| string | $str | string to parse |
| string[] | $parseList | array of parsers to run input through e.g. ["value", "important"] |
| int | $currentIndex | start number to begin indexing |
| array | $fileInfo | fileInfo to attach to created nodes |
- Returns
- array
- See also
- less-3.13.1.js#Parser.parseNode
◆ registerFunction()
| Less_Parser::registerFunction |
( |
| $name, |
|
|
| $callback ) |
Registers a new custom function.
- Parameters
-
| string | $name | function name |
| callable | $callback | callback |
◆ SetCacheDir()
| Less_Parser::SetCacheDir |
( |
| $dir | ) |
|
- Deprecated
- 1.5.1.2 Use Less_Cache::SetCacheDir instead.
◆ SetFileInfo()
| Less_Parser::SetFileInfo |
( |
| $filename, |
|
|
| $uri_root = '' ) |
- Parameters
-
| string | $filename | |
| string | $uri_root | |
◆ SetImportDirs()
| Less_Parser::SetImportDirs |
( |
| $dirs | ) |
|
Set a list of directories or callbacks the parser should use for determining import paths.
Import closures are called with a single $path argument containing the unquoted @import string an input LESS file. The string is unchanged, except for a statically appended ".less" suffix if the basename does not yet contain a dot. If a dot is present in the filename, you are responsible for choosing whether to expand "foo.bar" to "foo.bar.less". If your callback can handle this import statement, return an array with an absolute file path and an optional URI path, or return void/null to indicate that your callback does not handle this import statement.
Example:
function ( $path ) {
if ( $path === 'virtual/something.less' ) {
return [ '/srv/elsewhere/thing.less', null ];
}
}
- Parameters
-
| array | $dirs | The key should be a server directory from which LESS files may be imported. The value is an optional public URL or URL base path that corresponds to the same directory (use empty string otherwise). The value may also be a closure, in which case the key is ignored. |
◆ unregisterFunction()
| Less_Parser::unregisterFunction |
( |
| $name | ) |
|
Removed an already registered function.
- Parameters
-
The documentation for this class was generated from the following file: