Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.

Differences Between: [Versions 39 and 311] [Versions 39 and 400] [Versions 39 and 401] [Versions 39 and 402] [Versions 39 and 403]

SCSSPHP

Copyright: 2012-2019 Leaf Corcoran
License: http://opensource.org/licenses/MIT MIT
File Size: 7614 lines (222 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Compiler:: (245 methods):
  __construct()
  getCompileOptions()
  setErrorOuput()
  compile()
  parserFactory()
  isSelfExtend()
  pushExtends()
  makeOutputBlock()
  compileRoot()
  missingSelectors()
  flattenSelectors()
  glueFunctionSelectors()
  matchExtends()
  isPseudoSelector()
  pushOrMergeExtentedSelector()
  matchExtendsSingle()
  extractRelationshipFromFragment()
  combineSelectorSingle()
  compileMedia()
  mediaParent()
  compileDirective()
  compileAtRoot()
  filterScopeWithWithout()
  completeScope()
  findScopeSelectors()
  compileWith()
  filterWithWithout()
  isWith()
  testWithWithout()
  compileKeyframeBlock()
  compileNestedPropertiesBlock()
  compileNestedBlock()
  compileBlock()
  compileCommentValue()
  compileComment()
  evalSelectors()
  evalSelector()
  evalSelectorPart()
  collapseSelectors()
  revertSelfSelector()
  flattenSelectorSingle()
  compileSelector()
  compileSelectorPart()
  hasSelectorPlaceholder()
  pushCallStack()
  popCallStack()
  compileChildren()
  compileChildrenNoReturn()
  evaluateMediaQuery()
  compileMediaQuery()
  mergeDirectRelationships()
  mergeMediaTypes()
  compileImport()
  appendRootDirective()
  appendOutputLine()
  compileChild()
  expToString()
  isTruthy()
  isImmediateRelationshipCombinator()
  shouldEval()
  reduce()
  fncall()
  normalizeName()
  normalizeValue()
  opAddNumberNumber()
  opMulNumberNumber()
  opSubNumberNumber()
  opDivNumberNumber()
  opModNumberNumber()
  opAdd()
  opAnd()
  opOr()
  opColorColor()
  opColorNumber()
  opNumberColor()
  opEq()
  opNeq()
  opGteNumberNumber()
  opGtNumberNumber()
  opLteNumberNumber()
  opLtNumberNumber()
  opCmpNumberNumber()
  toBool()
  compileValue()
  flattenList()
  compileStringContent()
  extractInterpolation()
  multiplySelectors()
  joinSelectors()
  multiplyMedia()
  compactEnv()
  extractEnv()
  pushEnv()
  popEnv()
  getStoreEnv()
  set()
  setExisting()
  setRaw()
  get()
  has()
  injectVariables()
  setVariables()
  unsetVariable()
  getVariables()
  addParsedFile()
  getParsedFiles()
  addImportPath()
  setImportPaths()
  setNumberPrecision()
  setFormatter()
  setLineNumberStyle()
  setSourceMap()
  setSourceMapOptions()
  registerFunction()
  unregisterFunction()
  addFeature()
  importFile()
  findImport()
  setEncoding()
  setIgnoreErrors()
  throwError()
  callStackMessage()
  handleImportLoop()
  callScssFunction()
  callNativeFunction()
  getBuiltinFunction()
  sortNativeFunctionArgs()
  applyArguments()
  coerceValue()
  coerceMap()
  coerceList()
  coerceForExpression()
  coerceColor()
  compileRGBAValue()
  compileColorPartValue()
  coerceString()
  coercePercent()
  assertMap()
  assertList()
  assertColor()
  assertNumber()
  fixColor()
  toHSL()
  hueToRGB()
  toRGB()
  libCall()
  libIf()
  libIndex()
  libRgb()
  libRgba()
  alterColor()
  libAdjustColor()
  libChangeColor()
  libScaleColor()
  libIeHexStr()
  libRed()
  libGreen()
  libBlue()
  libAlpha()
  libOpacity()
  libMix()
  libHsl()
  libHsla()
  libHue()
  libSaturation()
  libLightness()
  adjustHsl()
  libAdjustHue()
  libLighten()
  libDarken()
  libSaturate()
  libDesaturate()
  libGrayscale()
  libComplement()
  libInvert()
  libOpacify()
  libFadeIn()
  libTransparentize()
  libFadeOut()
  libUnquote()
  libQuote()
  libPercentage()
  libRound()
  libFloor()
  libCeil()
  libAbs()
  libMin()
  libMax()
  getNormalizedNumbers()
  libLength()
  libListSeparator()
  libNth()
  libSetNth()
  libMapGet()
  libMapKeys()
  libMapValues()
  libMapRemove()
  libMapHasKey()
  libMapMerge()
  libKeywords()
  libIsBracketed()
  listSeparatorForJoin()
  libJoin()
  libAppend()
  libZip()
  libTypeOf()
  libUnit()
  libUnitless()
  libComparable()
  libStrIndex()
  libStrInsert()
  libStrLength()
  libStrSlice()
  libToLowerCase()
  libToUpperCase()
  libFeatureExists()
  libFunctionExists()
  libGlobalVariableExists()
  libMixinExists()
  libVariableExists()
  libCounter()
  libRandom()
  libUniqueId()
  inspectFormatValue()
  libInspect()
  getSelectorArg()
  formatOutputSelector()
  libIsSuperselector()
  isSuperSelector()
  isSuperPart()
  libSelectorAppend()
  selectorAppend()
  libSelectorExtend()
  libSelectorReplace()
  extendOrReplaceSelectors()
  libSelectorNest()
  libSelectorParse()
  libSelectorUnify()
  unifyCompoundSelectors()
  prependSelectors()
  matchPartInCompound()
  mergeParts()
  checkCompatibleTags()
  findTagName()
  libSimpleSelectors()


Class: Compiler  - X-Ref

SCSS compiler

__construct($cacheOptions = null)   X-Ref
Constructor

param: array|null $cacheOptions

getCompileOptions()   X-Ref
Get compiler options

return: array

setErrorOuput($handle)   X-Ref
Set an alternative error output stream, for testing purpose only

param: resource $handle

compile($code, $path = null)   X-Ref
Compile scss

param: string $code
param: string $path
return: string

parserFactory($path)   X-Ref
Instantiate parser

param: string $path
return: \ScssPhp\ScssPhp\Parser

isSelfExtend($target, $origin)   X-Ref
Is self extend?

param: array $target
param: array $origin
return: boolean

pushExtends($target, $origin, $block)   X-Ref
Push extends

param: array      $target
param: array      $origin
param: array|null $block

makeOutputBlock($type, $selectors = null)   X-Ref
Make output block

param: string $type
param: array  $selectors
return: \ScssPhp\ScssPhp\Formatter\OutputBlock

compileRoot(Block $rootBlock)   X-Ref
Compile root

param: \ScssPhp\ScssPhp\Block $rootBlock

missingSelectors()   X-Ref
Report missing selectors


flattenSelectors(OutputBlock $block, $parentKey = null)   X-Ref
Flatten selectors

param: \ScssPhp\ScssPhp\Formatter\OutputBlock $block
param: string                                 $parentKey

glueFunctionSelectors($parts)   X-Ref
Glue parts of :not( or :nth-child( ... that are in general splitted in selectors parts

param: array $parts
return: array

matchExtends($selector, &$out, $from = 0, $initial = true)   X-Ref
Match extends

param: array   $selector
param: array   $out
param: integer $from
param: boolean $initial

isPseudoSelector($part, &$matches)   X-Ref
Test a part for being a pseudo selector

param: string $part
param: array $matches
return: bool

pushOrMergeExtentedSelector(&$out, $extended)   X-Ref
Push extended selector except if
- this is a pseudo selector
- same as previous
- in a white list
in this case we merge the pseudo selector content

param: array $out
param: array $extended

matchExtendsSingle($rawSingle, &$outOrigin, $initial = true)   X-Ref
Match extends single

param: array $rawSingle
param: array $outOrigin
param: bool $initial
return: boolean

extractRelationshipFromFragment(array $fragment)   X-Ref
Extract a relationship from the fragment.

When extracting the last portion of a selector we will be left with a
fragment which may end with a direction relationship combinator. This
method will extract the relationship fragment and return it along side
the rest.

param: array $fragment The selector fragment maybe ending with a direction relationship combinator.
return: array The selector without the relationship fragment if any, the relationship fragment.

combineSelectorSingle($base, $other)   X-Ref
Combine selector single

param: array $base
param: array $other
return: array

compileMedia(Block $media)   X-Ref
Compile media

param: \ScssPhp\ScssPhp\Block $media

mediaParent(OutputBlock $scope)   X-Ref
Media parent

param: \ScssPhp\ScssPhp\Formatter\OutputBlock $scope
return: \ScssPhp\ScssPhp\Formatter\OutputBlock

compileDirective($directive, OutputBlock $out)   X-Ref
Compile directive

param: \ScssPhp\ScssPhp\Block|array $block
param: \ScssPhp\ScssPhp\Formatter\OutputBlock $out

compileAtRoot(Block $block)   X-Ref
Compile at-root

param: \ScssPhp\ScssPhp\Block $block

filterScopeWithWithout($scope, $with, $without)   X-Ref
Filter at-root scope depending of with/without option

param: \ScssPhp\ScssPhp\Formatter\OutputBlock $scope
param: array                                  $with
param: array                                  $without
return: mixed

completeScope($scope, $previousScope)   X-Ref
found missing selector from a at-root compilation in the previous scope
(if at-root is just enclosing a property, the selector is in the parent tree)

param: \ScssPhp\ScssPhp\Formatter\OutputBlock $scope
param: \ScssPhp\ScssPhp\Formatter\OutputBlock $previousScope
return: mixed

findScopeSelectors($scope, $depth)   X-Ref
Find a selector by the depth node in the scope

param: \ScssPhp\ScssPhp\Formatter\OutputBlock $scope
param: integer                                $depth
return: array

compileWith($withCondition)   X-Ref
Compile @at-root's with: inclusion / without: exclusion into 2 lists uses to filter scope/env later

param: array $withCondition
return: array

filterWithWithout($envs, $with, $without)   X-Ref
Filter env stack

param: array   $envs
param: array $with
param: array $without
return: \ScssPhp\ScssPhp\Compiler\Environment

isWith($block, $with, $without)   X-Ref
Filter WITH rules

param: \ScssPhp\ScssPhp\Block|\ScssPhp\ScssPhp\Formatter\OutputBlock $block
param: array                                                         $with
param: array                                                         $without
return: boolean

testWithWithout($what, $with, $without)   X-Ref
Test a single type of block against with/without lists

param: string $what
param: array  $with
param: array  $without
return: boolean

compileKeyframeBlock(Block $block, $selectors)   X-Ref
Compile keyframe block

param: \ScssPhp\ScssPhp\Block $block
param: array                  $selectors

compileNestedPropertiesBlock(Block $block, OutputBlock $out)   X-Ref
Compile nested properties lines

param: \ScssPhp\ScssPhp\Block $block
param: OutputBlock            $out

compileNestedBlock(Block $block, $selectors)   X-Ref
Compile nested block

param: \ScssPhp\ScssPhp\Block $block
param: array                  $selectors

compileBlock(Block $block)   X-Ref
Recursively compiles a block.

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

Blocks are made up of selectors and children.

The children of a block are just all the blocks that are defined within.

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

param: \ScssPhp\ScssPhp\Block $block

compileCommentValue($value, $pushEnv = false)   X-Ref
Compile the value of a comment that can have interpolation

param: array   $value
param: boolean $pushEnv
return: array|mixed|string

compileComment($block)   X-Ref
Compile root level comment

param: array $block

evalSelectors($selectors)   X-Ref
Evaluate selectors

param: array $selectors
return: array

evalSelector($selector)   X-Ref
Evaluate selector

param: array $selector
return: array

evalSelectorPart($part)   X-Ref
Evaluate selector part; replaces all the interpolates, stripping quotes

param: array $part
return: array

collapseSelectors($selectors, $selectorFormat = false)   X-Ref
Collapse selectors

param: array   $selectors
param: boolean $selectorFormat
return: string

revertSelfSelector($selectors)   X-Ref
No description

flattenSelectorSingle($single)   X-Ref
Flatten selector single; joins together .classes and #ids

param: array $single
return: array

compileSelector($selector)   X-Ref
Compile selector to string; self(&) should have been replaced by now

param: string|array $selector
return: string

compileSelectorPart($piece)   X-Ref
Compile selector part

param: array $piece
return: string

hasSelectorPlaceholder($selector)   X-Ref
Has selector placeholder?

param: array $selector
return: boolean

pushCallStack($name = '')   X-Ref
No description

popCallStack()   X-Ref
No description

compileChildren($stms, OutputBlock $out, $traceName = '')   X-Ref
Compile children and return result

param: array                                  $stms
param: \ScssPhp\ScssPhp\Formatter\OutputBlock $out
param: string                                 $traceName
return: array|null

compileChildrenNoReturn($stms, OutputBlock $out, $selfParent = null, $traceName = '')   X-Ref
Compile children and throw exception if unexpected @return

param: array                                  $stms
param: \ScssPhp\ScssPhp\Formatter\OutputBlock $out
param: \ScssPhp\ScssPhp\Block                 $selfParent
param: string                                 $traceName

evaluateMediaQuery($queryList)   X-Ref
evaluate media query : compile internal value keeping the structure inchanged

param: array $queryList
return: array

compileMediaQuery($queryList)   X-Ref
Compile media query

param: array $queryList
return: array

mergeDirectRelationships($selectors1, $selectors2)   X-Ref
Merge direct relationships between selectors

param: array $selectors1
param: array $selectors2
return: array

mergeMediaTypes($type1, $type2)   X-Ref
Merge media types

param: array $type1
param: array $type2
return: array|null

compileImport($rawPath, OutputBlock $out, $once = false)   X-Ref
Compile import; returns true if the value was something that could be imported

param: array                                  $rawPath
param: \ScssPhp\ScssPhp\Formatter\OutputBlock $out
param: boolean                                $once
return: boolean

appendRootDirective($line, $out, $allowed = [Type::T_COMMENT])   X-Ref
Append a root directive like @import or @charset as near as the possible from the source code
(keeping before comments, @import and @charset coming before in the source code)

param: string                                        $line
param: @param \ScssPhp\ScssPhp\Formatter\OutputBlock $out
param: array                                         $allowed

appendOutputLine(OutputBlock $out, $type, $line)   X-Ref
Append lines to the current output block:
directly to the block or through a child if necessary

param: \ScssPhp\ScssPhp\Formatter\OutputBlock $out
param: string                                 $type
param: string|mixed                           $line

compileChild($child, OutputBlock $out)   X-Ref
Compile child; returns a value to halt execution

param: array                                  $child
param: \ScssPhp\ScssPhp\Formatter\OutputBlock $out
return: array

expToString($exp)   X-Ref
Reduce expression to string

param: array $exp
return: array

isTruthy($value)   X-Ref
Is truthy?

param: array $value
return: boolean

isImmediateRelationshipCombinator($value)   X-Ref
Is the value a direct relationship combinator?

param: string $value
return: boolean

shouldEval($value)   X-Ref
Should $value cause its operand to eval

param: array $value
return: boolean

reduce($value, $inExp = false)   X-Ref
Reduce value

param: array   $value
param: boolean $inExp
return: null|string|array|\ScssPhp\ScssPhp\Node\Number

fncall($name, $argValues)   X-Ref
Function caller

param: string $name
param: array  $argValues
return: array|null

normalizeName($name)   X-Ref
Normalize name

param: string $name
return: string

normalizeValue($value)   X-Ref
Normalize value

param: array $value
return: array

opAddNumberNumber($left, $right)   X-Ref
Add numbers

param: array $left
param: array $right
return: \ScssPhp\ScssPhp\Node\Number

opMulNumberNumber($left, $right)   X-Ref
Multiply numbers

param: array $left
param: array $right
return: \ScssPhp\ScssPhp\Node\Number

opSubNumberNumber($left, $right)   X-Ref
Subtract numbers

param: array $left
param: array $right
return: \ScssPhp\ScssPhp\Node\Number

opDivNumberNumber($left, $right)   X-Ref
Divide numbers

param: array $left
param: array $right
return: array|\ScssPhp\ScssPhp\Node\Number

opModNumberNumber($left, $right)   X-Ref
Mod numbers

param: array $left
param: array $right
return: \ScssPhp\ScssPhp\Node\Number

opAdd($left, $right)   X-Ref
Add strings

param: array $left
param: array $right
return: array|null

opAnd($left, $right, $shouldEval)   X-Ref
Boolean and

param: array   $left
param: array   $right
param: boolean $shouldEval
return: array|null

opOr($left, $right, $shouldEval)   X-Ref
Boolean or

param: array   $left
param: array   $right
param: boolean $shouldEval
return: array|null

opColorColor($op, $left, $right)   X-Ref
Compare colors

param: string $op
param: array  $left
param: array  $right
return: array

opColorNumber($op, $left, $right)   X-Ref
Compare color and number

param: string $op
param: array  $left
param: array  $right
return: array

opNumberColor($op, $left, $right)   X-Ref
Compare number and color

param: string $op
param: array  $left
param: array  $right
return: array

opEq($left, $right)   X-Ref
Compare number1 == number2

param: array $left
param: array $right
return: array

opNeq($left, $right)   X-Ref
Compare number1 != number2

param: array $left
param: array $right
return: array

opGteNumberNumber($left, $right)   X-Ref
Compare number1 >= number2

param: array $left
param: array $right
return: array

opGtNumberNumber($left, $right)   X-Ref
Compare number1 > number2

param: array $left
param: array $right
return: array

opLteNumberNumber($left, $right)   X-Ref
Compare number1 <= number2

param: array $left
param: array $right
return: array

opLtNumberNumber($left, $right)   X-Ref
Compare number1 < number2

param: array $left
param: array $right
return: array

opCmpNumberNumber($left, $right)   X-Ref
Three-way comparison, aka spaceship operator

param: array $left
param: array $right
return: \ScssPhp\ScssPhp\Node\Number

toBool($thing)   X-Ref
Cast to boolean

param: mixed $thing
return: array

compileValue($value)   X-Ref
Compiles a primitive value into a CSS property value.

Values in scssphp 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.

param: array $value
return: string|array

flattenList($list)   X-Ref
Flatten list

param: array $list
return: string

compileStringContent($string)   X-Ref
Compile string content

param: array $string
return: string

extractInterpolation($list)   X-Ref
Extract interpolation; it doesn't need to be recursive, compileValue will handle that

param: array $list
return: array

multiplySelectors(Environment $env, $selfParent = null)   X-Ref
Find the final set of selectors

param: \ScssPhp\ScssPhp\Compiler\Environment $env
param: \ScssPhp\ScssPhp\Block                $selfParent
return: array

joinSelectors($parent, $child, &$stillHasSelf, $selfParentSelectors = null)   X-Ref
Join selectors; looks for & to replace, or append parent before child

param: array   $parent
param: array   $child
param: boolean &$stillHasSelf
param: array   $selfParentSelectors
return: array

multiplyMedia(Environment $env = null, $childQueries = null)   X-Ref
Multiply media

param: \ScssPhp\ScssPhp\Compiler\Environment $env
param: array                                 $childQueries
return: array

compactEnv(Environment $env)   X-Ref
Convert env linked list to stack

param: \ScssPhp\ScssPhp\Compiler\Environment $env
return: array

extractEnv($envs)   X-Ref
Convert env stack to singly linked list

param: array $envs
return: \ScssPhp\ScssPhp\Compiler\Environment

pushEnv(Block $block = null)   X-Ref
Push environment

param: \ScssPhp\ScssPhp\Block $block
return: \ScssPhp\ScssPhp\Compiler\Environment

popEnv()   X-Ref
Pop environment


getStoreEnv()   X-Ref
Get store environment

return: \ScssPhp\ScssPhp\Compiler\Environment

set($name, $value, $shadow = false, Environment $env = null, $valueUnreduced = null)   X-Ref
Set variable

param: string                                $name
param: mixed                                 $value
param: boolean                               $shadow
param: \ScssPhp\ScssPhp\Compiler\Environment $env
param: mixed                                 $valueUnreduced

setExisting($name, $value, Environment $env, $valueUnreduced = null)   X-Ref
Set existing variable

param: string                                $name
param: mixed                                 $value
param: \ScssPhp\ScssPhp\Compiler\Environment $env
param: mixed                                 $valueUnreduced

setRaw($name, $value, Environment $env, $valueUnreduced = null)   X-Ref
Set raw variable

param: string                                $name
param: mixed                                 $value
param: \ScssPhp\ScssPhp\Compiler\Environment $env
param: mixed                                 $valueUnreduced

get($name, $shouldThrow = true, Environment $env = null, $unreduced = false)   X-Ref
Get variable

param: string                                $name
param: boolean                               $shouldThrow
param: \ScssPhp\ScssPhp\Compiler\Environment $env
param: boolean                               $unreduced
return: mixed|null

has($name, Environment $env = null)   X-Ref
Has variable?

param: string                                $name
param: \ScssPhp\ScssPhp\Compiler\Environment $env
return: boolean

injectVariables(array $args)   X-Ref
Inject variables

param: array $args

setVariables(array $variables)   X-Ref
Set variables

param: array $variables

unsetVariable($name)   X-Ref
Unset variable

param: string $name

getVariables()   X-Ref
Returns list of variables

return: array

addParsedFile($path)   X-Ref
Adds to list of parsed files

param: string $path

getParsedFiles()   X-Ref
Returns list of parsed files

return: array

addImportPath($path)   X-Ref
Add import path

param: string|callable $path

setImportPaths($path)   X-Ref
Set import paths

param: string|array $path

setNumberPrecision($numberPrecision)   X-Ref
Set number precision

param: integer $numberPrecision

setFormatter($formatterName)   X-Ref
Set formatter

param: string $formatterName

setLineNumberStyle($lineNumberStyle)   X-Ref
Set line number style

param: string $lineNumberStyle

setSourceMap($sourceMap)   X-Ref
Enable/disable source maps

param: integer $sourceMap

setSourceMapOptions($sourceMapOptions)   X-Ref
Set source map options

param: array $sourceMapOptions

registerFunction($name, $func, $prototype = null)   X-Ref
Register function

param: string   $name
param: callable $func
param: array    $prototype

unregisterFunction($name)   X-Ref
Unregister function

param: string $name

addFeature($name)   X-Ref
Add feature

param: string $name

importFile($path, OutputBlock $out)   X-Ref
Import file

param: string                                 $path
param: \ScssPhp\ScssPhp\Formatter\OutputBlock $out

findImport($url)   X-Ref
Return the file path for an import url if it exists

param: string $url
return: string|null

setEncoding($encoding)   X-Ref
Set encoding

param: string $encoding

setIgnoreErrors($ignoreErrors)   X-Ref
Ignore errors?

param: boolean $ignoreErrors
return: \ScssPhp\ScssPhp\Compiler

throwError($msg)   X-Ref
Throw error (exception)

param: string $msg Message with optional sprintf()-style vararg parameters

callStackMessage($all = false, $limit = null)   X-Ref
Beautify call stack for output

param: boolean $all
param: null    $limit
return: string

handleImportLoop($name)   X-Ref
Handle import loop

param: string $name

callScssFunction($name, $argValues, &$returnValue)   X-Ref
Call SCSS @function

param: string $name
param: array  $argValues
param: array  $returnValue
return: boolean Returns true if returnValue is set; otherwise, false

callNativeFunction($name, $args, &$returnValue)   X-Ref
Call built-in and registered (PHP) functions

param: string $name
param: array  $args
param: array  $returnValue
return: boolean Returns true if returnValue is set; otherwise, false

getBuiltinFunction($name)   X-Ref
Get built-in function

param: string $name Normalized name
return: array

sortNativeFunctionArgs($functionName, $prototypes, $args)   X-Ref
No description

applyArguments($argDef, $argValues, $storeInEnv = true, $reduce = true)   X-Ref
Apply argument values per definition

param: array   $argDef
param: array   $argValues
param: boolean $storeInEnv
param: boolean $reduce
return: array

coerceValue($value)   X-Ref
Coerce a php value into a scss one

param: mixed $value
return: array|\ScssPhp\ScssPhp\Node\Number

coerceMap($item)   X-Ref
Coerce something to map

param: array $item
return: array

coerceList($item, $delim = ',')   X-Ref
Coerce something to list

param: array  $item
param: string $delim
return: array

coerceForExpression($value)   X-Ref
Coerce color for expression

param: array $value
return: array|null

coerceColor($value, $inRGBFunction = false)   X-Ref
Coerce value to color

param: array $value
return: array|null

compileRGBAValue($value, $isAlpha = false)   X-Ref

param: integer|\ScssPhp\ScssPhp\Node\Number $value
param: boolean                              $isAlpha
return: integer|mixed

compileColorPartValue($value, $min, $max, $isInt = true, $clamp = true, $modulo = false)   X-Ref

param: mixed         $value
param: integer|float $min
param: integer|float $max
param: boolean       $isInt
param: boolean       $clamp
param: boolean       $modulo
return: integer|mixed

coerceString($value)   X-Ref
Coerce value to string

param: array $value
return: array|null

coercePercent($value)   X-Ref
Coerce value to a percentage

param: array $value
return: integer|float

assertMap($value)   X-Ref
Assert value is a map

param: array $value
return: array

assertList($value)   X-Ref
Assert value is a list

param: array $value
return: array

assertColor($value)   X-Ref
Assert value is a color

param: array $value
return: array

assertNumber($value)   X-Ref
Assert value is a number

param: array $value
return: integer|float

fixColor($c)   X-Ref
Make sure a color's components don't go out of bounds

param: array $c
return: array

toHSL($red, $green, $blue)   X-Ref
Convert RGB to HSL

param: integer $red
param: integer $green
param: integer $blue
return: array

hueToRGB($m1, $m2, $h)   X-Ref
Hue to RGB helper

param: float $m1
param: float $m2
param: float $h
return: float

toRGB($hue, $saturation, $lightness)   X-Ref
Convert HSL to RGB

param: integer $hue        H from 0 to 360
param: integer $saturation S from 0 to 100
param: integer $lightness  L from 0 to 100
return: array

libCall($args, $kwargs)   X-Ref
No description

libIf($args)   X-Ref
No description

libIndex($args)   X-Ref
No description

libRgb($args, $kwargs, $funcName = 'rgb')   X-Ref
No description

libRgba($args, $kwargs)   X-Ref
No description

alterColor($args, $fn)   X-Ref
No description

libAdjustColor($args)   X-Ref
No description

libChangeColor($args)   X-Ref
No description

libScaleColor($args)   X-Ref
No description

libIeHexStr($args)   X-Ref
No description

libRed($args)   X-Ref
No description

libGreen($args)   X-Ref
No description

libBlue($args)   X-Ref
No description

libAlpha($args)   X-Ref
No description

libOpacity($args)   X-Ref
No description

libMix($args)   X-Ref
No description

libHsl($args, $kwargs, $funcName = 'hsl')   X-Ref
No description

libHsla($args, $kwargs)   X-Ref
No description

libHue($args)   X-Ref
No description

libSaturation($args)   X-Ref
No description

libLightness($args)   X-Ref
No description

adjustHsl($color, $idx, $amount)   X-Ref
No description

libAdjustHue($args)   X-Ref
No description

libLighten($args)   X-Ref
No description

libDarken($args)   X-Ref
No description

libSaturate($args)   X-Ref
No description

libDesaturate($args)   X-Ref
No description

libGrayscale($args)   X-Ref
No description

libComplement($args)   X-Ref
No description

libInvert($args)   X-Ref
No description

libOpacify($args)   X-Ref
No description

libFadeIn($args)   X-Ref
No description

libTransparentize($args)   X-Ref
No description

libFadeOut($args)   X-Ref
No description

libUnquote($args)   X-Ref
No description

libQuote($args)   X-Ref
No description

libPercentage($args)   X-Ref
No description

libRound($args)   X-Ref
No description

libFloor($args)   X-Ref
No description

libCeil($args)   X-Ref
No description

libAbs($args)   X-Ref
No description

libMin($args)   X-Ref
No description

libMax($args)   X-Ref
No description

getNormalizedNumbers($args)   X-Ref
Helper to normalize args containing numbers

param: array $args
return: array

libLength($args)   X-Ref
No description

libListSeparator($args)   X-Ref
No description

libNth($args)   X-Ref
No description

libSetNth($args)   X-Ref
No description

libMapGet($args)   X-Ref
No description

libMapKeys($args)   X-Ref
No description

libMapValues($args)   X-Ref
No description

libMapRemove($args)   X-Ref
No description

libMapHasKey($args)   X-Ref
No description

libMapMerge($args)   X-Ref
No description

libKeywords($args)   X-Ref
No description

libIsBracketed($args)   X-Ref
No description

listSeparatorForJoin($list1, $sep)   X-Ref
No description

libJoin($args)   X-Ref
No description

libAppend($args)   X-Ref
No description

libZip($args)   X-Ref
No description

libTypeOf($args)   X-Ref
No description

libUnit($args)   X-Ref
No description

libUnitless($args)   X-Ref
No description

libComparable($args)   X-Ref
No description

libStrIndex($args)   X-Ref
No description

libStrInsert($args)   X-Ref
No description

libStrLength($args)   X-Ref
No description

libStrSlice($args)   X-Ref
No description

libToLowerCase($args)   X-Ref
No description

libToUpperCase($args)   X-Ref
No description

libFeatureExists($args)   X-Ref
No description

libFunctionExists($args)   X-Ref
No description

libGlobalVariableExists($args)   X-Ref
No description

libMixinExists($args)   X-Ref
No description

libVariableExists($args)   X-Ref
No description

libCounter($args)   X-Ref
Workaround IE7's content counter bug.

param: array $args
return: array

libRandom($args)   X-Ref
No description

libUniqueId()   X-Ref
No description

inspectFormatValue($value, $force_enclosing_display = false)   X-Ref
No description

libInspect($args)   X-Ref
No description

getSelectorArg($arg)   X-Ref
Preprocess selector args

param: array $arg
return: array|boolean

formatOutputSelector($selectors)   X-Ref
Postprocess selector to output in right format

param: array $selectors
return: string

libIsSuperselector($args)   X-Ref
No description

isSuperSelector($super, $sub)   X-Ref
Test a $super selector again $sub

param: array $super
param: array $sub
return: boolean

isSuperPart($superParts, $subParts)   X-Ref
No description

libSelectorAppend($args)   X-Ref
No description

selectorAppend($selectors)   X-Ref
Append parts of the last selector in the list to the previous, recursively

param: array $selectors
return: array

libSelectorExtend($args)   X-Ref
No description

libSelectorReplace($args)   X-Ref
No description

extendOrReplaceSelectors($selectors, $extendee, $extender, $replace = false)   X-Ref
Extend/replace in selectors
used by selector-extend and selector-replace that use the same logic

param: array   $selectors
param: array   $extendee
param: array   $extender
param: boolean $replace
return: array

libSelectorNest($args)   X-Ref
No description

libSelectorParse($args)   X-Ref
No description

libSelectorUnify($args)   X-Ref
No description

unifyCompoundSelectors($compound1, $compound2)   X-Ref
The selector-unify magic as its best
(at least works as expected on test cases)

param: array $compound1
param: array $compound2
return: array|mixed

prependSelectors($selectors, $parts)   X-Ref
Prepend each selector from $selectors with $parts

param: array $selectors
param: array $parts
return: array

matchPartInCompound($part, $compound)   X-Ref
Try to find a matching part in a compound:
- with same html tag name
- with some class or id or something in common

param: array $part
param: array $compound
return: array|boolean

mergeParts($parts1, $parts2)   X-Ref
Merge two part list taking care that
- the html tag is coming first - if any
- the :something are coming last

param: array $parts1
param: array $parts2
return: array

checkCompatibleTags($tag1, $tag2)   X-Ref
Check the compatibility between two tag names:
if both are defined they should be identical or one has to be '*'

param: string $tag1
param: string $tag2
return: array|boolean

findTagName($parts)   X-Ref
Find the html tag name in a selector parts list

param: array $parts
return: mixed|string

libSimpleSelectors($args)   X-Ref
No description