Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

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

SCSSPHP

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

Defines 1 class

Compiler:: (272 methods):
  __construct()
  getCompileOptions()
  setErrorOuput()
  compile()
  parserFactory()
  isSelfExtend()
  pushExtends()
  makeOutputBlock()
  compileRoot()
  missingSelectors()
  flattenSelectors()
  glueFunctionSelectors()
  matchExtends()
  isPseudoSelector()
  pushOrMergeExtentedSelector()
  matchExtendsSingle()
  extractRelationshipFromFragment()
  combineSelectorSingle()
  compileMedia()
  mediaParent()
  compileDirective()
  compileDirectiveName()
  compileAtRoot()
  filterScopeWithWithout()
  completeScope()
  findScopeSelectors()
  compileWith()
  filterWithWithout()
  isWith()
  testWithWithout()
  compileKeyframeBlock()
  compileNestedPropertiesBlock()
  compileNestedBlock()
  compileBlock()
  compileCommentValue()
  compileComment()
  evalSelectors()
  evalSelector()
  evalSelectorPart()
  collapseSelectors()
  replaceSelfSelector()
  flattenSelectorSingle()
  compileSelector()
  compileSelectorPart()
  hasSelectorPlaceholder()
  pushCallStack()
  popCallStack()
  compileChildren()
  compileChildrenNoReturn()
  evaluateMediaQuery()
  compileMediaQuery()
  mergeDirectRelationships()
  mergeMediaTypes()
  compileImport()
  compileImportPath()
  escapeImportPathString()
  appendRootDirective()
  appendOutputLine()
  compileChild()
  expToString()
  isTruthy()
  isImmediateRelationshipCombinator()
  shouldEval()
  reduce()
  fncall()
  cssValidArg()
  stringifyFncallArgs()
  getFunctionReference()
  normalizeName()
  normalizeValue()
  opAddNumberNumber()
  opMulNumberNumber()
  opSubNumberNumber()
  opDivNumberNumber()
  opModNumberNumber()
  opAdd()
  opAnd()
  opOr()
  opColorColor()
  opColorNumber()
  opNumberColor()
  opEq()
  opNeq()
  opEqNumberNumber()
  opNeqNumberNumber()
  opGteNumberNumber()
  opGtNumberNumber()
  opLteNumberNumber()
  opLtNumberNumber()
  toBool()
  escapeNonPrintableChars()
  compileValue()
  compileDebugValue()
  flattenList()
  compileStringContent()
  extractInterpolation()
  multiplySelectors()
  joinSelectors()
  multiplyMedia()
  compactEnv()
  extractEnv()
  pushEnv()
  popEnv()
  backPropagateEnv()
  getStoreEnv()
  set()
  setExisting()
  setRaw()
  get()
  has()
  injectVariables()
  setVariables()
  unsetVariable()
  getVariables()
  addParsedFile()
  getParsedFiles()
  addImportPath()
  setImportPaths()
  setNumberPrecision()
  setOutputStyle()
  setFormatter()
  setLineNumberStyle()
  setSourceMap()
  setSourceMapOptions()
  registerFunction()
  unregisterFunction()
  addFeature()
  importFile()
  findImport()
  resolveImportPath()
  checkImportPathConflicts()
  tryImportPathWithExtensions()
  tryImportPath()
  tryImportPathAsDirectory()
  getPrettyPath()
  setEncoding()
  setIgnoreErrors()
  getSourcePosition()
  throwError()
  error()
  errorArgsNumber()
  callStackMessage()
  handleImportLoop()
  callScssFunction()
  callNativeFunction()
  getBuiltinFunction()
  normalizeNativeFunctionName()
  isNativeFunction()
  sortNativeFunctionArgs()
  applyArguments()
  coerceValue()
  coerceMap()
  coerceList()
  coerceForExpression()
  coerceColor()
  compileRGBAValue()
  compileColorPartValue()
  coerceString()
  assertString()
  coercePercent()
  assertMap()
  assertList()
  assertColor()
  assertNumber()
  assertInteger()
  fixColor()
  toHSL()
  hueToRGB()
  toRGB()
  libCall()
  libGetFunction()
  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()
  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()
  stringTransformAsciiOnly()
  libFeatureExists()
  libFunctionExists()
  libGlobalVariableExists()
  libMixinExists()
  libVariableExists()
  libCounter()
  libRandom()
  libUniqueId()
  inspectFormatValue()
  libInspect()
  getSelectorArg()
  checkSelectorArgType()
  formatOutputSelector()
  libIsSuperselector()
  isSuperSelector()
  isSuperPart()
  libSelectorAppend()
  selectorAppend()
  libSelectorExtend()
  libSelectorReplace()
  extendOrReplaceSelectors()
  libSelectorNest()
  libSelectorParse()
  libSelectorUnify()
  unifyCompoundSelectors()
  prependSelectors()
  matchPartInCompound()
  mergeParts()
  checkCompatibleTags()
  findTagName()
  libSimpleSelectors()
  libScssphpGlob()


Class: Compiler  - X-Ref

SCSS compiler

__construct($cacheOptions = null)   X-Ref
Constructor

param: array|null $cacheOptions

getCompileOptions()   X-Ref
Get compiler options

return: array<string, mixed>

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

param: resource $handle
return: void

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
return: void

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
return: void

missingSelectors()   X-Ref
Report missing selectors

return: void

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

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

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
return: void

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

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

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
return: void

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

param: array   $rawSingle
param: array   $outOrigin
param: boolean $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
return: void

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
return: void

compileDirectiveName($directiveName)   X-Ref
directive names can include some interpolation

param: string|array $directiveName
return: array|string

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

param: \ScssPhp\ScssPhp\Block $block
return: void

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: OutputBlock

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: OutputBlock

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: Environment[] $envs
param: array $with
param: array $without
return: 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
return: void

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

param: \ScssPhp\ScssPhp\Block                 $block
param: \ScssPhp\ScssPhp\Formatter\OutputBlock $out
return: void

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

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

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
return: void

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

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

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

param: array $block
return: void

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

replaceSelfSelector($selectors, $replace = null)   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

param: string $name
return: void

popCallStack()   X-Ref

return: void

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
return: void

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

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

compileImportPath($rawPath)   X-Ref

param: array $rawPath
return: string

escapeImportPathString($path)   X-Ref

param: array $path
return: array

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: \ScssPhp\ScssPhp\Formatter\OutputBlock $out
param: array                                  $allowed
return: void

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
return: void

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|Number|null

expToString($exp, $keepParens = false)   X-Ref
Reduce expression to string

param: array $exp
param: bool $keepParens
return: array

isTruthy($value)   X-Ref
Is truthy?

param: array|Number $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|Number $value
param: boolean $inExp
return: null|string|array|Number

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

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

cssValidArg($arg, $allowed_function = [], $inFunction = false)   X-Ref
No description

stringifyFncallArgs($arg)   X-Ref
Reformat fncall arguments to proper css function output

param: $arg
return: array|\ArrayAccess|Number|string|null

getFunctionReference($name, $safeCopy = false)   X-Ref
Find a function reference

param: string $name
param: bool $safeCopy
return: array

normalizeName($name)   X-Ref
Normalize name

param: string $name
return: string

normalizeValue($value)   X-Ref
Normalize value

param: array|Number $value
return: array|Number

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

param: Number $left
param: Number $right
return: Number

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

param: Number $left
param: Number $right
return: Number

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

param: Number $left
param: Number $right
return: Number

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

param: Number $left
param: Number $right
return: Number

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

param: Number $left
param: Number $right
return: 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|Number $left
param: array|Number  $right
param: boolean $shouldEval
return: array|Number|null

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

toBool($thing)   X-Ref
Cast to boolean

param: mixed $thing
return: array

escapeNonPrintableChars($string, $inKeyword = false)   X-Ref
Escape non printable chars in strings output as in dart-sass

param: string $string
return: string

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|Number|string $value
return: string

compileDebugValue($value)   X-Ref

param: array $value
return: array|string

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: Environment $env
return: Environment[]

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

param: Environment[] $envs
return: Environment

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

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

popEnv()   X-Ref
Pop environment

return: void

backPropagateEnv($store, $excludedVars = null)   X-Ref
Propagate vars from a just poped Env (used in @each and @for)

param: array         $store
param: null|string[] $excludedVars
return: void

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
return: void

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
return: void

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
return: void

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
return: void

setVariables(array $variables)   X-Ref
Set variables

param: array $variables
return: void

unsetVariable($name)   X-Ref
Unset variable

param: string $name
return: void

getVariables()   X-Ref
Returns list of variables

return: array

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

param: string $path
return: void

getParsedFiles()   X-Ref
Returns list of parsed files

return: array

addImportPath($path)   X-Ref
Add import path

param: string|callable $path
return: void

setImportPaths($path)   X-Ref
Set import paths

param: string|array<string|callable> $path
return: void

setNumberPrecision($numberPrecision)   X-Ref
Set number precision

param: integer $numberPrecision
return: void

setOutputStyle($style)   X-Ref
Sets the output style.

param: string $style One of the OutputStyle constants
return: void

setFormatter($formatterName)   X-Ref
Set formatter

param: string $formatterName
return: void

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

param: string $lineNumberStyle
return: void

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

param: integer $sourceMap
return: void

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

param: array $sourceMapOptions
return: void

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

param: string   $name
param: callable $func
param: array|null $prototype
return: void

unregisterFunction($name)   X-Ref
Unregister function

param: string $name
return: void

addFeature($name)   X-Ref
Add feature

param: string $name
return: void

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

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

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

param: string $url
return: string|null

resolveImportPath($url, $baseDir)   X-Ref

param: string $url
param: string $baseDir
return: string|null

checkImportPathConflicts(array $paths)   X-Ref

param: string[] $paths
return: string|null

tryImportPathWithExtensions($path)   X-Ref

param: string $path
return: string[]

tryImportPath($path)   X-Ref

param: string $path
return: string[]

tryImportPathAsDirectory($path)   X-Ref

param: string $path
return: string|null

getPrettyPath($path)   X-Ref

param: string $path
return: string

setEncoding($encoding)   X-Ref
Set encoding

param: string $encoding
return: void

setIgnoreErrors($ignoreErrors)   X-Ref
Ignore errors?

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

getSourcePosition()   X-Ref
Get source position

return: array

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

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

error($msg, ...$args)   X-Ref
Build an error (exception)

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

errorArgsNumber($functionName, $ExpectedArgs, $nbActual)   X-Ref

param: string $functionName
param: array $ExpectedArgs
param: int $nbActual
return: CompilerException

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($func, $argValues)   X-Ref
Call SCSS @function

param: Object $func
param: array  $argValues
return: array

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

param: string $name
param: string|array $function
param: array  $prototype
param: array  $args
return: array|Number|null

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

param: string $name Normalized name
return: array

normalizeNativeFunctionName($name)   X-Ref
Normalize native function name

param: string $name
return: string

isNativeFunction($name)   X-Ref
No description

sortNativeFunctionArgs($functionName, $prototypes, $args)   X-Ref
Sorts keyword arguments

param: string $functionName
param: array  $prototypes
param: array  $args
return: array|null

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|Number

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

param: array|Number $item
return: array|Number

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

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

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

param: array|Number $value
return: array|Number

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

param: array|Number $value
param: bool         $inRGBFunction
return: array|null

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

param: integer|Number $value
param: boolean        $isAlpha
return: integer|mixed

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

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

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

param: array|Number $value
return: array

assertString($value, $varName = null)   X-Ref
Assert value is a string (or keyword)

param: array|Number $value
param: string $varName
return: array

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

param: array|Number $value
return: integer|float

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

param: array|Number $value
return: array

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

param: array|Number $value
return: array

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

param: array|Number $value
return: array

assertNumber($value, $varName = null)   X-Ref
Assert value is a number

param: array|Number $value
param: string $varName
return: Number

assertInteger($value, $varName = null)   X-Ref
Assert value is a integer

param: array|Number $value
param: string $varName
return: integer

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

libGetFunction($args)   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
Helper function for adjust_color, change_color, and scale_color

param: array<array|Number> $args
param: callable $fn
return: array

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


libLength($args)   X-Ref


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

param: array $list1
param: array|Number|null $sep
return: string

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

stringTransformAsciiOnly($stringContent, $filter)   X-Ref
Apply a filter on a string content, only on ascii chars
let extended chars untouched

param: string $stringContent
param: callable $filter
return: string

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, $varname = null, $allowParent = false)   X-Ref
Preprocess selector args

param: array $arg
return: array|boolean

checkSelectorArgType($arg, $maxDepth = 2)   X-Ref
Check variable type for getSelectorArg() function

param: array $arg
param: int $maxDepth
return: bool

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|false

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|false

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

libScssphpGlob($args)   X-Ref
No description