Property | Type | Description | |
---|---|---|---|
$defaultValue | |||
$emptyList | |||
$emptyMap | |||
$emptyString | |||
$false | |||
$null | |||
$nullString | |||
$selfSelector | |||
$true | |||
$with | |||
$without |
Method | Description | |
---|---|---|
__construct ( ) | Constructor | |
addFeature ( string $name ) | Add feature | |
addImportPath ( string $path ) | Add import path | |
addParsedFile ( string $path ) | Adds to list of parsed files | |
assertColor ( array $value ) : array | Assert value is a color | |
assertList ( array $value ) : array | Assert value is a list | |
assertMap ( array $value ) : array | Assert value is a map | |
assertNumber ( array $value ) : integer | float | Assert value is a number | |
compile ( string $code, string $path = null ) : string | Compile scss | |
compileValue ( array $value ) : string | Compiles a primitive value into a CSS property value. | |
findImport ( string $url ) : string | null | Return the file path for an import url if it exists | |
get ( string $name, boolean $shouldThrow = true, Leafo\ScssPhp\Compiler\Environment $env = null ) : mixed | Get variable | |
getParsedFiles ( ) : array | Returns list of parsed files | |
getVariables ( ) : array | Returns list of variables | |
normalizeValue ( array $value ) : array | Normalize value | |
registerFunction ( string $name, callable $func, array $prototype = null ) | Register function | |
setEncoding ( string $encoding ) | Set encoding | |
setFormatter ( string $formatterName ) | Set formatter | |
setIgnoreErrors ( boolean $ignoreErrors ) : |
Ignore errors? | |
setImportPaths ( string | array $path ) | Set import paths | |
setLineNumberStyle ( string $lineNumberStyle ) | Set line number style | |
setNumberPrecision ( integer $numberPrecision ) | Set number precision | |
setVariables ( array $variables ) | Set variables | |
throwError ( string $msg ) | Throw error (exception) | |
toBool ( mixed $thing ) : array | Cast to boolean | |
toHSL ( integer $red, integer $green, integer $blue ) : array | Convert RGB to HSL | |
toRGB ( integer $hue, integer $saturation, integer $lightness ) : array | Convert HSL to RGB | |
unregisterFunction ( string $name ) | Unregister function | |
unsetVariable ( string $name ) | Unset variable |
Method | Description | |
---|---|---|
adjustHsl ( $color, $idx, $amount ) | ||
alterColor ( $args, $fn ) | helper function for adjust_color, change_color, and scale_color | |
applyArguments ( array $argDef, array $argValues ) | Apply argument values per definition | |
callNativeFunction ( string $name, array $args, array &$returnValue ) : boolean | Call built-in and registered (PHP) functions | |
callScssFunction ( string $name, $argValues, array &$returnValue ) : boolean | Call SCSS @function | |
coerceColor ( array $value ) : array | null | Coerce value to color | |
coerceForExpression ( array $value ) : array | null | Coerce color for expression | |
coerceList ( array $item, $delim = ',' ) : array | Coerce something to list | |
coerceMap ( array $item ) : array | Coerce something to map | |
coercePercent ( array $value ) : integer | float | Coerce value to a percentage | |
coerceString ( array $value ) : array | null | Coerce value to string | |
collapseSelectors ( array $selectors ) : string | Collapse selectors | |
combineSelectorSingle ( array $base, array $other ) : array | Combine selector single | |
compileAtRoot ( Leafo\ScssPhp\Block $block ) | Compile at-root | |
compileBlock ( Leafo\ScssPhp\Block $block ) | Recursively compiles a block. | |
compileChild ( array $child, Leafo\ScssPhp\Formatter\OutputBlock $out ) : array | Compile child; returns a value to halt execution | |
compileChildren ( array $stms, Leafo\ScssPhp\Formatter\OutputBlock $out ) : array | Compile children and return result | |
compileChildrenNoReturn ( array $stms, Leafo\ScssPhp\Formatter\OutputBlock $out ) | Compile children and throw exception if unexpected @return | |
compileComment ( array $block ) | Compile root level comment | |
compileDirective ( Leafo\ScssPhp\Block $block ) | Compile directive | |
compileImport ( array $rawPath, array $out, boolean $once = false ) : boolean | Compile import; returns true if the value was something that could be imported | |
compileKeyframeBlock ( Leafo\ScssPhp\Block $block, array $selectors ) | Compile keyframe block | |
compileMedia ( Leafo\ScssPhp\Block $media ) | Compile media | |
compileMediaQuery ( array $queryList ) : string | Compile media query | |
compileNestedBlock ( Leafo\ScssPhp\Block $block, array $selectors ) | Compile nested block | |
compileRoot ( Leafo\ScssPhp\Block $rootBlock ) | Compile root | |
compileSelector ( array $selector ) : string | Compile selector to string; self(&) should have been replaced by now | |
compileSelectorPart ( arary $piece ) : string | Compile selector part | |
compileStringContent ( array $string ) : string | Compile string content | |
evalSelector ( array $selector ) : array | Evaluate selector | |
evalSelectorPart ( array $part ) : array | Evaluate selector part; replaces all the interpolates, stripping quotes | |
evalSelectors ( array $selectors ) : array | Evaluate selectors | |
expToString ( array $exp ) : array | Reduce expression to string | |
extractInterpolation ( array $list ) : array | Extract interpolation; it doesn't need to be recursive, compileValue will handle that | |
extractRelationshipFromFragment ( array $fragment ) : array | Extract a relationship from the fragment. | |
fileExists ( string $name ) : boolean | Does file exist? | |
fixColor ( array $c ) : array | Make sure a color's components don't go out of bounds | |
flattenList ( array $list ) : string | Flatten list | |
flattenSelectorSingle ( array $single ) : array | Flatten selector single; joins together .classes and #ids | |
flattenSelectors ( Leafo\ScssPhp\Formatter\OutputBlock $block, string $parentKey = null ) | Flatten selectors | |
getBuiltinFunction ( string $name ) : array | Get built-in function | |
getNormalizedNumbers ( array $args ) : array | Helper to normalize args containing numbers | |
getStoreEnv ( ) : Leafo\ScssPhp\Compiler\Environment | Get store environment | |
handleImportLoop ( string $name ) | Handle import loop | |
has ( string $name, Leafo\ScssPhp\Compiler\Environment $env = null ) : boolean | Has variable? | |
hasSelectorPlaceholder ( array $selector ) : boolean | Has selector placeholder? | |
importFile ( string $path, array $out ) | Import file | |
injectVariables ( array $args ) | Inject variables | |
isImmediateRelationshipCombinator ( string $value ) : boolean | Is the value a direct relationship combinator? | |
isSelfExtend ( array $target, array $origin ) : boolean | Is self extend? | |
isTruthy ( array $value ) : array | Is truthy? | |
joinSelectors ( array $parent, array $child ) : array | Join selectors; looks for & to replace, or append parent before child | |
libAbs ( $args ) | ||
libAdjustColor ( $args ) | ||
libAdjustHue ( $args ) | ||
libAlpha ( $args ) | ||
libAppend ( $args ) | ||
libBlue ( $args ) | ||
libCall ( $args, $kwargs ) | protected static $libCall = ['name', 'args. | |
libCeil ( $args ) | ||
libChangeColor ( $args ) | ||
libComparable ( $args ) | ||
libComplement ( $args ) | ||
libCounter ( array $args ) | Workaround IE7's content counter bug. | |
libDarken ( $args ) | ||
libDesaturate ( $args ) | ||
libFadeIn ( $args ) | ||
libFadeOut ( $args ) | ||
libFeatureExists ( $args ) | ||
libFloor ( $args ) | ||
libFunctionExists ( $args ) | ||
libGlobalVariableExists ( $args ) | ||
libGrayscale ( $args ) | ||
libGreen ( $args ) | ||
libHsl ( $args ) | ||
libHsla ( $args ) | ||
libHue ( $args ) | ||
libIeHexStr ( $args ) | ||
libIf ( $args ) | ||
libIndex ( $args ) | ||
libInspect ( $args ) | ||
libInvert ( $args ) | ||
libJoin ( $args ) | ||
libKeywords ( $args ) | ||
libLength ( $args ) | ||
libLighten ( $args ) | ||
libLightness ( $args ) | ||
libListSeparator ( $args ) | protected static $libListSeparator = ['list. | |
libMapGet ( $args ) | ||
libMapHasKey ( $args ) | ||
libMapKeys ( $args ) | ||
libMapMerge ( $args ) | ||
libMapRemove ( $args ) | ||
libMapValues ( $args ) | ||
libMax ( $args ) | ||
libMin ( $args ) | ||
libMix ( $args ) | ||
libMixinExists ( $args ) | ||
libNth ( $args ) | ||
libOpacify ( $args ) | ||
libOpacity ( $args ) | ||
libPercentage ( $args ) | ||
libQuote ( $args ) | ||
libRandom ( $args ) | ||
libRed ( $args ) | ||
libRgb ( $args ) | ||
libRgba ( $args ) | ||
libRound ( $args ) | ||
libSaturate ( $args ) | ||
libSaturation ( $args ) | ||
libScaleColor ( $args ) | ||
libSetNth ( $args ) | ||
libStrIndex ( $args ) | ||
libStrInsert ( $args ) | ||
libStrLength ( $args ) | ||
libStrSlice ( $args ) | ||
libToLowerCase ( $args ) | ||
libToUpperCase ( $args ) | ||
libTransparentize ( $args ) | ||
libTypeOf ( $args ) | ||
libUniqueId ( ) | ||
libUnit ( $args ) | ||
libUnitless ( $args ) | ||
libUnquote ( $args ) | ||
libVariableExists ( $args ) | ||
libZip ( $args ) | ||
listSeparatorForJoin ( $list1, $sep ) | ||
makeOutputBlock ( string $type, array $selectors = null ) : Leafo\ScssPhp\Formatter\OutputBlock | Make output block | |
matchExtends ( array $selector, array &$out, integer $from, boolean $initial = true ) | Match extends | |
matchExtendsSingle ( array $rawSingle, array &$outOrigin ) : boolean | Match extends single | |
mediaParent ( Leafo\ScssPhp\Formatter\OutputBlock $scope ) : Leafo\ScssPhp\Formatter\OutputBlock | Media parent | |
mergeDirectRelationships ( $selectors1, $selectors2 ) | ||
mergeMediaTypes ( array $type1, array $type2 ) : array | null | Merge media types | |
missingSelectors ( ) | Report missing selectors | |
multiplyMedia ( Leafo\ScssPhp\Compiler\Environment $env = null, array $childQueries = null ) : array | Multiply media | |
multiplySelectors ( Leafo\ScssPhp\Compiler\Environment $env ) : array | Find the final set of selectors | |
normalizeName ( string $name ) : string | Normalize name | |
opAdd ( array $left, array $right ) : array | Add strings | |
opAddNumberNumber ( array $left, array $right ) : array | Add numbers | |
opAnd ( array $left, array $right, boolean $shouldEval ) : array | Boolean and | |
opCmpNumberNumber ( array $left, array $right ) : array | Three-way comparison, aka spaceship operator | |
opColorColor ( string $op, array $left, array $right ) : array | Compare colors | |
opColorNumber ( string $op, array $left, array $right ) : array | Compare color and number | |
opDivNumberNumber ( array $left, array $right ) : array | Divide numbers | |
opEq ( array $left, array $right ) : array | Compare number1 == number2 | |
opGtNumberNumber ( array $left, array $right ) : array | Compare number1 > number2 | |
opGteNumberNumber ( array $left, array $right ) : array | Compare number1 >= number2 | |
opLtNumberNumber ( array $left, array $right ) : array | Compare number1 < number2 | |
opLteNumberNumber ( array $left, array $right ) : array | Compare number1 <= number2 | |
opModNumberNumber ( array $left, array $right ) : array | Mod numbers | |
opMulNumberNumber ( array $left, array $right ) : array | Multiply numbers | |
opNeq ( array $left, array $right ) : array | Compare number1 != number2 | |
opNumberColor ( string $op, array $left, array $right ) : array | Compare number and color | |
opOr ( array $left, array $right, boolean $shouldEval ) : array | Boolean or | |
opSubNumberNumber ( array $left, array $right ) : array | Subtract numbers | |
parserFactory ( string $path ) : |
Instantiate parser | |
popEnv ( ) | Pop environment | |
pushEnv ( Leafo\ScssPhp\Block $block = null ) : Leafo\ScssPhp\Compiler\Environment | Push environment | |
pushExtends ( array $target, array $origin, stdClass $block ) | Push extends | |
reduce ( array $value, boolean $inExp = false ) : array | Reduce value | |
set ( string $name, mixed $value, boolean $shadow = false, Leafo\ScssPhp\Compiler\Environment $env = null ) | Set variable | |
setExisting ( string $name, mixed $value, Leafo\ScssPhp\Compiler\Environment $env ) | Set existing variable | |
setRaw ( string $name, mixed $value, Leafo\ScssPhp\Compiler\Environment $env ) | Set raw variable | |
shouldEval ( array $value ) : boolean | Should $value cause its operand to eval | |
sortArgs ( array $prototype, array $args ) : array | Sorts keyword arguments |
Method | Description | |
---|---|---|
coerceValue ( mixed $value ) : array | Coerce a php value into a scss one | |
compactEnv ( Leafo\ScssPhp\Compiler\Environment $env ) : array | Convert env linked list to stack | |
compileWith ( array $with ) : integer | Compile @at-root's with: inclusion / without: exclusion into filter flags | |
extractEnv ( array $envs ) : Leafo\ScssPhp\Compiler\Environment | Convert env stack to singly linked list | |
filterWithout ( array $envs, integer $without ) : Leafo\ScssPhp\Compiler\Environment | Filter env stack | |
fncall ( string $name, array $argValues ) : array | null | Function caller | |
hueToRGB ( float $m1, float $m2, float $h ) : float | Hue to RGB helper | |
isWithout ( integer $without, Leafo\ScssPhp\Block $block ) : boolean | Filter WITH rules | |
spliceTree ( array $envs, Leafo\ScssPhp\Block $block, integer $without ) : array | Splice parse tree |
public addParsedFile ( string $path ) | ||
$path | string |
protected alterColor ( $args, $fn ) |
protected applyArguments ( array $argDef, array $argValues ) | ||
$argDef | array | |
$argValues | array |
public assertColor ( array $value ) : array | ||
$value | array | |
return | array |
public assertList ( array $value ) : array | ||
$value | array | |
return | array |
protected coerceList ( array $item, $delim = ',' ) : array | ||
$item | array | |
return | array |
protected collapseSelectors ( array $selectors ) : string | ||
$selectors | array | |
return | string |
protected compileAtRoot ( Leafo\ScssPhp\Block $block ) | ||
$block | Leafo\ScssPhp\Block |
protected compileBlock ( Leafo\ScssPhp\Block $block ) | ||
$block | Leafo\ScssPhp\Block |
protected compileChild ( array $child, Leafo\ScssPhp\Formatter\OutputBlock $out ) : array | ||
$child | array | |
$out | Leafo\ScssPhp\Formatter\OutputBlock | |
return | array |
protected compileChildren ( array $stms, Leafo\ScssPhp\Formatter\OutputBlock $out ) : array | ||
$stms | array | |
$out | Leafo\ScssPhp\Formatter\OutputBlock | |
return | array |
protected compileChildrenNoReturn ( array $stms, Leafo\ScssPhp\Formatter\OutputBlock $out ) | ||
$stms | array | |
$out | Leafo\ScssPhp\Formatter\OutputBlock |
protected compileComment ( array $block ) | ||
$block | array |
protected compileDirective ( Leafo\ScssPhp\Block $block ) | ||
$block | Leafo\ScssPhp\Block |
protected compileKeyframeBlock ( Leafo\ScssPhp\Block $block, array $selectors ) | ||
$block | Leafo\ScssPhp\Block | |
$selectors | array |
protected compileMedia ( Leafo\ScssPhp\Block $media ) | ||
$media | Leafo\ScssPhp\Block |
protected compileMediaQuery ( array $queryList ) : string | ||
$queryList | array | |
return | string |
protected compileNestedBlock ( Leafo\ScssPhp\Block $block, array $selectors ) | ||
$block | Leafo\ScssPhp\Block | |
$selectors | array |
protected compileRoot ( Leafo\ScssPhp\Block $rootBlock ) | ||
$rootBlock | Leafo\ScssPhp\Block |
protected compileSelector ( array $selector ) : string | ||
$selector | array | |
return | string |
protected compileSelectorPart ( arary $piece ) : string | ||
$piece | arary | |
return | string |
protected compileStringContent ( array $string ) : string | ||
$string | array | |
return | string |
public compileValue ( array $value ) : string | ||
$value | array | |
return | string |
protected evalSelector ( array $selector ) : array | ||
$selector | array | |
return | array |
protected evalSelectorPart ( array $part ) : array | ||
$part | array | |
return | array |
protected evalSelectors ( array $selectors ) : array | ||
$selectors | array | |
return | array |
protected expToString ( array $exp ) : array | ||
$exp | array | |
return | array |
protected extractInterpolation ( array $list ) : array | ||
$list | array | |
return | array |
protected extractRelationshipFromFragment ( array $fragment ) : array | ||
$fragment | array | The selector fragment maybe ending with a direction relationship combinator. |
return | array | The selector without the relationship fragment if any, the relationship fragment. |
protected fileExists ( string $name ) : boolean | ||
$name | string | |
return | boolean |
protected flattenList ( array $list ) : string | ||
$list | array | |
return | string |
protected flattenSelectorSingle ( array $single ) : array | ||
$single | array | |
return | array |
protected flattenSelectors ( Leafo\ScssPhp\Formatter\OutputBlock $block, string $parentKey = null ) | ||
$block | Leafo\ScssPhp\Formatter\OutputBlock | |
$parentKey | string |
protected getBuiltinFunction ( string $name ) : array | ||
$name | string | Normalized name |
return | array |
protected getNormalizedNumbers ( array $args ) : array | ||
$args | array | |
return | array |
public getParsedFiles ( ) : array | ||
return | array |
protected getStoreEnv ( ) : Leafo\ScssPhp\Compiler\Environment | ||
return | Leafo\ScssPhp\Compiler\Environment |
protected handleImportLoop ( string $name ) | ||
$name | string |
protected hasSelectorPlaceholder ( array $selector ) : boolean | ||
$selector | array | |
return | boolean |
protected importFile ( string $path, array $out ) | ||
$path | string | |
$out | array |
protected injectVariables ( array $args ) | ||
$args | array |
protected isImmediateRelationshipCombinator ( string $value ) : boolean | ||
$value | string | |
return | boolean |
protected libCounter ( array $args ) | ||
$args | array |
protected makeOutputBlock ( string $type, array $selectors = null ) : Leafo\ScssPhp\Formatter\OutputBlock | ||
$type | string | |
$selectors | array | |
return | Leafo\ScssPhp\Formatter\OutputBlock |
protected mediaParent ( Leafo\ScssPhp\Formatter\OutputBlock $scope ) : Leafo\ScssPhp\Formatter\OutputBlock | ||
$scope | Leafo\ScssPhp\Formatter\OutputBlock | |
return | Leafo\ScssPhp\Formatter\OutputBlock |
protected mergeDirectRelationships ( $selectors1, $selectors2 ) |
protected multiplyMedia ( Leafo\ScssPhp\Compiler\Environment $env = null, array $childQueries = null ) : array | ||
$env | Leafo\ScssPhp\Compiler\Environment | |
$childQueries | array | |
return | array |
protected multiplySelectors ( Leafo\ScssPhp\Compiler\Environment $env ) : array | ||
$env | Leafo\ScssPhp\Compiler\Environment | |
return | array |
protected normalizeName ( string $name ) : string | ||
$name | string | |
return | string |
public normalizeValue ( array $value ) : array | ||
$value | array | |
return | array |
protected parserFactory ( string $path ) : |
||
$path | string | |
return |
protected pushEnv ( Leafo\ScssPhp\Block $block = null ) : Leafo\ScssPhp\Compiler\Environment | ||
$block | Leafo\ScssPhp\Block | |
return | Leafo\ScssPhp\Compiler\Environment |
protected pushExtends ( array $target, array $origin, stdClass $block ) | ||
$target | array | |
$origin | array | |
$block | stdClass |
protected setExisting ( string $name, mixed $value, Leafo\ScssPhp\Compiler\Environment $env ) | ||
$name | string | |
$value | mixed | |
$env | Leafo\ScssPhp\Compiler\Environment |
public setFormatter ( string $formatterName ) | ||
$formatterName | string |
public setIgnoreErrors ( boolean $ignoreErrors ) : |
||
$ignoreErrors | boolean | |
return |
public setImportPaths ( string | array $path ) | ||
$path | string | array |
public setLineNumberStyle ( string $lineNumberStyle ) | ||
$lineNumberStyle | string |
public setNumberPrecision ( integer $numberPrecision ) | ||
$numberPrecision | integer |
public setVariables ( array $variables ) | ||
$variables | array |
protected shouldEval ( array $value ) : boolean | ||
$value | array | |
return | boolean |
public throwError ( string $msg ) | ||
$msg | string | Message with optional sprintf()-style vararg parameters |
public unregisterFunction ( string $name ) | ||
$name | string |
protected static $libTransparentize |