CWIS Developer Documentation

- Home
- Main Page
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
scssc Class Reference

SCSS compiler written in PHP. More...

## Public Member Functions
| compile ($code, $name=null)
| Compile scss. More...
| normalizeValue ($value)
| toBool ($thing)
| get ($name, $defaultValue=null, $env=null)
| setVariables (array $variables)
| Set variables. More...
| unsetVariable ($name)
| Unset variable. More...
| getParsedFiles ()
| addImportPath ($path)
| setImportPaths ($path)
| setNumberPrecision ($numberPrecision)
| setFormatter ($formatterName)
| registerFunction ($name, $func)
| unregisterFunction ($name)
| findImport ($url)
| assertList ($value)
| assertColor ($value)
| assertNumber ($value)
| toHSL ($red, $green, $blue)
| hueToRGB ($m1, $m2, $h)
| toRGB ($hue, $saturation, $lightness)
| throwError ($msg=null)

## Static Public Attributes
static | $VERSION = 'v0.0.12'
static | $true = array("keyword", "true")
static | $false = array("keyword", "false")
static | $null = array("null")
static | $defaultValue = array("keyword", "")
static | $selfSelector = array("self")

## Protected Member Functions
| isSelfExtend ($target, $origin)
| pushExtends ($target, $origin)
| makeOutputBlock ($type, $selectors=null)
| matchExtendsSingle ($single, &$outOrigin)
| combineSelectorSingle ($base, $other)
| matchExtends ($selector, &$out, $from=0, $initial=true)
| flattenSelectors ($block, $parentKey=null)
| compileRoot ($rootBlock)
| compileMedia ($media)
| mediaParent ($scope)
| compileNestedBlock ($block, $selectors)
| compileBlock ($block)
| Recursively compiles a block. More...
| flattenSelectorSingle ($single)
| evalSelector ($selector)
| evalSelectorPart ($piece)
| compileSelector ($selector)
| compileSelectorPart ($piece)
| hasSelectorPlaceholder ($selector)
| compileChildren ($stms, $out)
| compileMediaQuery ($queryList)
| mergeMediaTypes ($type1, $type2)
| compileImport ($rawPath, $out)
| compileChild ($child, $out)
| expToString ($exp)
| isTruthy ($value)
| shouldEval ($value)
| reduce ($value, $inExp=false)
| normalizeNumber ($number)
| coerceUnit ($number, $unit)
| op_add_number_number ($left, $right)
| op_mul_number_number ($left, $right)
| op_sub_number_number ($left, $right)
| op_div_number_number ($left, $right)
| op_mod_number_number ($left, $right)
| op_add ($left, $right)
| op_and ($left, $right, $shouldEval)
| op_or ($left, $right, $shouldEval)
| op_color_color ($op, $left, $right)
| op_color_number ($op, $left, $right)
| op_number_color ($op, $left, $right)
| op_eq ($left, $right)
| op_neq ($left, $right)
| op_gte_number_number ($left, $right)
| op_gt_number_number ($left, $right)
| op_lte_number_number ($left, $right)
| op_lt_number_number ($left, $right)
| compileValue ($value)
| Compiles a primitive value into a CSS property value. More...
| compileStringContent ($string)
| extractInterpolation ($list)
| multiplySelectors ($env)
| joinSelectors ($parent, $child)
| multiplyMedia ($env, $childQueries=null)
| coerceList ($item, $delim=",")
| applyArguments ($argDef, $argValues)
| pushEnv ($block=null)
| normalizeName ($name)
| getStoreEnv ()
| set ($name, $value, $shadow=false)
| setExisting ($name, $value, $env=null)
| setRaw ($name, $value)
| injectVariables (array $args)
| popEnv ()
| importFile ($path, $out)
| fileExists ($name)
| callBuiltin ($name, $args, &$returnValue)
| sortArgs ($prototype, $args)
| coerceForExpression ($value)
| coerceColor ($value)
| coerceString ($value)
| coercePercent ($value)
| fixColor ($c)
| lib_if ($args)
| lib_index ($args)
| lib_rgb ($args)
| lib_rgba ($args)
| alter_color ($args, $fn)
| adjust_color_helper ($base, $alter, $i)
| lib_adjust_color ($args)
| change_color_helper ($base, $alter, $i)
| lib_change_color ($args)
| scale_color_helper ($base, $scale, $i)
| lib_scale_color ($args)
| lib_ie_hex_str ($args)
| lib_red ($args)
| lib_green ($args)
| lib_blue ($args)
| lib_alpha ($args)
| lib_opacity ($args)
| lib_mix ($args)
| lib_hsl ($args)
| lib_hsla ($args)
| lib_hue ($args)
| lib_saturation ($args)
| lib_lightness ($args)
| adjustHsl ($color, $idx, $amount)
| lib_adjust_hue ($args)
| lib_lighten ($args)
| lib_darken ($args)
| lib_saturate ($args)
| lib_desaturate ($args)
| lib_grayscale ($args)
| lib_complement ($args)
| lib_invert ($args)
| lib_opacify ($args)
| lib_fade_in ($args)
| lib_transparentize ($args)
| lib_fade_out ($args)
| lib_unquote ($args)
| lib_quote ($args)
| lib_percentage ($args)
| lib_round ($args)
| lib_floor ($args)
| lib_ceil ($args)
| lib_abs ($args)
| lib_min ($args)
| lib_max ($args)
| getNormalizedNumbers ($args)
| lib_length ($args)
| lib_nth ($args)
| listSeparatorForJoin ($list1, $sep)
| lib_join ($args)
| lib_append ($args)
| lib_zip ($args)
| lib_type_of ($args)
| lib_unit ($args)
| lib_unitless ($args)
| lib_comparable ($args)
| lib_counter ($args)
| Workaround IE7's content counter bug. More...

## Protected Attributes
| $importPaths = array("")
| $importCache = array()
| $userFunctions = array()
| $registeredVars = array()
| $numberPrecision = 5
| $formatter = "scss_formatter_nested"

## Static Protected Attributes
static | $operatorNames
static | $namespaces
static | $unitTable
static | $lib_if = array("condition", "if-true", "if-false")
static | $lib_index = array("list", "value")
static | $lib_rgb = array("red", "green", "blue")
static | $lib_rgba
static | $lib_adjust_color
static | $lib_change_color
static | $lib_scale_color
static | $lib_ie_hex_str = array("color")
static | $lib_red = array("color")
static | $lib_green = array("color")
static | $lib_blue = array("color")
static | $lib_alpha = array("color")
static | $lib_opacity = array("color")
static | $lib_mix = array("color-1", "color-2", "weight")
static | $lib_hsl = array("hue", "saturation", "lightness")
static | $lib_hsla
static | $lib_hue = array("color")
static | $lib_saturation = array("color")
static | $lib_lightness = array("color")
static | $lib_adjust_hue = array("color", "degrees")
static | $lib_lighten = array("color", "amount")
static | $lib_darken = array("color", "amount")
static | $lib_saturate = array("color", "amount")
static | $lib_desaturate = array("color", "amount")
static | $lib_grayscale = array("color")
static | $lib_complement = array("color")
static | $lib_invert = array("color")
static | $lib_opacify = array("color", "amount")
static | $lib_fade_in = array("color", "amount")
static | $lib_transparentize = array("color", "amount")
static | $lib_fade_out = array("color", "amount")
static | $lib_unquote = array("string")
static | $lib_quote = array("string")
static | $lib_percentage = array("value")
static | $lib_round = array("value")
static | $lib_floor = array("value")
static | $lib_ceil = array("value")
static | $lib_abs = array("value")
static | $lib_length = array("list")
static | $lib_nth = array("list", "n")
static | $lib_join = array("list1", "list2", "separator")
static | $lib_append = array("list", "val", "separator")
static | $lib_type_of = array("value")
static | $lib_unit = array("number")
static | $lib_unitless = array("number")
static | $lib_comparable = array("number-1", "number-2")
static | $cssColors
| CSS Colors. More...

## Detailed Description

SCSS compiler written in PHP.

Copyright
  2012-2013 Leaf Corcoran

http://opensource.org/licenses/gpl-license GPL-3.0 http://opensource.org/licenses/MIT MIT

The scss compiler and parser. Converting SCSS to CSS is a three stage process. The incoming file is parsed by `scss_parser` into a syntax tree, then it is compiled into another tree representing the CSS structure by `scssc`. The CSS tree is fed into a formatter, like `scss_formatter` which then outputs CSS as a string. During the first compile, all values are reduced, which means that their types are brought to the lowest form before being dump as strings. This handles math equations, variable dereferences, and the like. The `parse` function of `scssc` is the entry point. In summary: The `scssc` class creates an instance of the parser, feeds it SCSS code, then transforms the resulting tree to a CSS tree. This class also holds the evaluation context, such as all available mixins and variables at any given time. The `scss_parser` class is only concerned with parsing its input. The `scss_formatter` takes a CSS tree, and dumps it to a formatted string, handling things like indentation. SCSS compiler Leaf Corcoran leafo.nosp@m.t@gm.nosp@m.ail.c.nosp@m.om

Definition at line 45 of file scssc.php.

## Member Function Documentation

scssc::addImportPath | ( |  | $path | ) |

Definition at line 1622 of file scssc.php.

scssc::adjust_color_helper | ( |  | $base,
|  |  | $alter,
|  |  | $i
| ) |  |
| protected

Definition at line 2003 of file scssc.php.

scssc::adjustHsl | ( |  | $color,
|  |  | $idx,
|  |  | $amount
| ) |  |
| protected

Definition at line 2167 of file scssc.php.

References toHSL(), and toRGB().

Referenced by lib_adjust_hue(), lib_complement(), lib_darken(), lib_desaturate(), lib_grayscale(), lib_lighten(), and lib_saturate().

Here is the caller graph for this function:

scssc::alter_color | ( |  | $args,
|  |  | $fn
| ) |  |
| protected

Definition at line 1970 of file scssc.php.

References assertColor(), assertNumber(), toHSL(), and toRGB().

Referenced by lib_adjust_color(), lib_change_color(), and lib_scale_color().

Here is the caller graph for this function:

scssc::applyArguments | ( |  | $argDef,
|  |  | $argValues
| ) |  |
| protected

Definition at line 1435 of file scssc.php.

References reduce(), set(), and throwError().

Referenced by compileChild(), and reduce().

Here is the caller graph for this function:

scssc::assertColor | ( |  | $value | ) |

Definition at line 1828 of file scssc.php.

References coerceColor(), and throwError().

Referenced by alter_color(), lib_adjust_hue(), lib_complement(), lib_darken(), lib_desaturate(), lib_grayscale(), lib_hue(), lib_invert(), lib_lighten(), lib_lightness(), lib_mix(), lib_opacify(), lib_saturate(), lib_saturation(), and lib_transparentize().

Here is the caller graph for this function:

scssc::assertList | ( |  | $value | ) |

Definition at line 1822 of file scssc.php.

References throwError().

Referenced by lib_index(), and lib_zip().

Here is the caller graph for this function:

scssc::assertNumber | ( |  | $value | ) |

Definition at line 1833 of file scssc.php.

References throwError().

Referenced by alter_color(), lib_adjust_hue(), lib_nth(), and lib_rgba().

Here is the caller graph for this function:

scssc::callBuiltin | ( |  | $name,
|  |  | $args,
|  | & | $returnValue
| ) |  |
| protected

Definition at line 1706 of file scssc.php.

References normalizeName(), reduce(), and sortArgs().

Referenced by reduce().

Here is the caller graph for this function:

scssc::change_color_helper | ( |  | $base,
|  |  | $alter,
|  |  | $i
| ) |  |
| protected

Definition at line 2014 of file scssc.php.

scssc::coerceColor | ( |  | $value | ) |
| protected

Definition at line 1795 of file scssc.php.

Referenced by assertColor(), coerceForExpression(), lib_alpha(), lib_blue(), lib_green(), lib_ie_hex_str(), lib_red(), lib_rgba(), and lib_type_of().

Here is the caller graph for this function:

scssc::coerceForExpression | ( |  | $value | ) |
| protected

Definition at line 1787 of file scssc.php.

References coerceColor().

Referenced by normalizeValue(), and reduce().

Here is the caller graph for this function:

scssc::coerceList | ( |  | $item,
|  |  | $delim = `","`
| ) |  |
| protected

Definition at line 1427 of file scssc.php.

Referenced by compileChild(), lib_append(), lib_join(), lib_length(), and lib_nth().

Here is the caller graph for this function:

scssc::coercePercent | ( |  | $value | ) |
| protected

Definition at line 1839 of file scssc.php.

Referenced by lib_darken(), lib_desaturate(), lib_lighten(), lib_mix(), lib_opacify(), lib_percentage(), lib_saturate(), and lib_transparentize().

Here is the caller graph for this function:

scssc::coerceString | ( |  | $value | ) |
| protected

Definition at line 1812 of file scssc.php.

Referenced by op_add(), and op_eq().

Here is the caller graph for this function:

scssc::coerceUnit | ( |  | $number,
|  |  | $unit
| ) |  |
| protected

Definition at line 1074 of file scssc.php.

Referenced by reduce().

Here is the caller graph for this function:

scssc::combineSelectorSingle | ( |  | $base,
|  |  | $other
| ) |  |
| protected

Definition at line 222 of file scssc.php.

Referenced by matchExtendsSingle().

Here is the caller graph for this function:

scssc::compile | ( |  | $code,
|  |  | $name = `null`
| ) |  |

Compile scss.

Parameters

  string | $code |
  string | $name |

Returns
  string

Definition at line 106 of file scssc.php.

References compileRoot(), injectVariables(), popEnv(), and pushEnv().

scssc::compileBlock | ( |  | $block | ) |
| protected

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.

See also
  scss::compileChild()

Parameters

  \StdClass | $block |

Definition at line 411 of file scssc.php.

References compileChildren(), makeOutputBlock(), multiplySelectors(), popEnv(), and pushEnv().

Referenced by compileChild().

Here is the caller graph for this function:

scssc::compileChild | ( |  | $child,
|  |  | $out
| ) |  |
| protected

Definition at line 631 of file scssc.php.

References applyArguments(), coerceList(), compileBlock(), compileChildren(), compileImport(), compileMedia(), compileNestedBlock(), compileValue(), evalSelector(), isTruthy(), popEnv(), pushEnv(), pushExtends(), reduce(), set(), setRaw(), and throwError().

Referenced by compileChildren().

Here is the caller graph for this function:

scssc::compileChildren | ( |  | $stms,
|  |  | $out
| ) |  |
| protected

Definition at line 509 of file scssc.php.

References compileChild().

Referenced by compileBlock(), compileChild(), compileMedia(), compileNestedBlock(), compileRoot(), importFile(), and reduce().

Here is the caller graph for this function:

scssc::compileImport | ( |  | $rawPath,
|  |  | $out
| ) |  |
| protected

Definition at line 604 of file scssc.php.

References compileStringContent(), findImport(), and importFile().

Referenced by compileChild().

Here is the caller graph for this function:

scssc::compileMedia | ( |  | $media | ) |
| protected

Definition at line 331 of file scssc.php.

References compileChildren(), compileMediaQuery(), makeOutputBlock(), mediaParent(), multiplyMedia(), popEnv(), and pushEnv().

Referenced by compileChild().

Here is the caller graph for this function:

scssc::compileMediaQuery | ( |  | $queryList | ) |
| protected

Definition at line 516 of file scssc.php.

References compileValue(), and mergeMediaTypes().

Referenced by compileMedia().

Here is the caller graph for this function:

scssc::compileNestedBlock | ( |  | $block,
|  |  | $selectors
| ) |  |
| protected

Definition at line 382 of file scssc.php.

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

Referenced by compileChild().

Here is the caller graph for this function:

scssc::compileRoot | ( |  | $rootBlock | ) |
| protected

Definition at line 323 of file scssc.php.

References compileChildren(), flattenSelectors(), and makeOutputBlock().

Referenced by compile().

Here is the caller graph for this function:

scssc::compileSelector | ( |  | $selector | ) |
| protected

Definition at line 470 of file scssc.php.

Referenced by flattenSelectors().

Here is the caller graph for this function:

scssc::compileSelectorPart | ( |  | $piece | ) |
| protected

Definition at line 477 of file scssc.php.

References compileValue().

scssc::compileStringContent | ( |  | $string | ) |
| protected

Definition at line 1316 of file scssc.php.

References compileValue().

Referenced by compileImport(), and compileValue().

Here is the caller graph for this function:

scssc::compileValue | ( |  | $value | ) |
| protected

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.

Parameters

  array | $value |

Definition at line 1232 of file scssc.php.

References compileStringContent(), extractInterpolation(), reduce(), and throwError().

Referenced by compileChild(), compileMediaQuery(), compileSelectorPart(), compileStringContent(), evalSelectorPart(), listSeparatorForJoin(), normalizeValue(), and op_eq().

Here is the caller graph for this function:

scssc::evalSelector | ( |  | $selector | ) |
| protected

Definition at line 447 of file scssc.php.

Referenced by compileChild().

Here is the caller graph for this function:

scssc::evalSelectorPart | ( |  | $piece | ) |
| protected

Definition at line 451 of file scssc.php.

References compileValue(), and flattenSelectorSingle().

scssc::expToString | ( |  | $exp | ) |
| protected

Definition at line 837 of file scssc.php.

References reduce().

Referenced by reduce().

Here is the caller graph for this function:

scssc::extractInterpolation | ( |  | $list | ) |
| protected

Definition at line 1330 of file scssc.php.

Referenced by compileValue(), and normalizeValue().

Here is the caller graph for this function:

scssc::fileExists | ( |  | $name | ) |
| protected

Definition at line 1702 of file scssc.php.

Referenced by findImport().

Here is the caller graph for this function:

scssc::findImport | ( |  | $url | ) |

Definition at line 1667 of file scssc.php.

References fileExists().

Referenced by compileImport().

Here is the caller graph for this function:

scssc::fixColor | ( |  | $c | ) |
| protected

Definition at line 1850 of file scssc.php.

Referenced by lib_mix(), and op_color_color().

Here is the caller graph for this function:

scssc::flattenSelectors | ( |  | $block,
|  |  | $parentKey = `null`
| ) |  |
| protected

Definition at line 290 of file scssc.php.

References compileSelector(), hasSelectorPlaceholder(), and matchExtends().

Referenced by compileRoot().

Here is the caller graph for this function:

scssc::flattenSelectorSingle | ( |  | $single | ) |
| protected

Definition at line 425 of file scssc.php.

Referenced by evalSelectorPart().

Here is the caller graph for this function:

scssc::get | ( |  | $name,
|  |  | $defaultValue = `null`,
|  |  | $env = `null`
| ) |  |

Definition at line 1549 of file scssc.php.

References $defaultValue, getStoreEnv(), and normalizeName().

scssc::getNormalizedNumbers | ( |  | $args | ) |
| protected

Definition at line 2341 of file scssc.php.

References normalizeNumber(), and throwError().

Referenced by lib_max(), and lib_min().

Here is the caller graph for this function:

scssc::getParsedFiles | ( |  | ) |

Definition at line 1618 of file scssc.php.

scssc::getStoreEnv | ( |  | ) |
| protected

Definition at line 1520 of file scssc.php.

Referenced by get(), setExisting(), and setRaw().

Here is the caller graph for this function:

scssc::hasSelectorPlaceholder | ( |  | $selector | ) |
| protected

Definition at line 494 of file scssc.php.

Referenced by flattenSelectors().

Here is the caller graph for this function:

scssc::hueToRGB | ( |  | $m1,
|  |  | $m2,
|  |  | $h
| ) |  |

Definition at line 1886 of file scssc.php.

Referenced by toRGB().

Here is the caller graph for this function:

scssc::importFile | ( |  | $path,
|  |  | $out
| ) |  |
| protected

Definition at line 1646 of file scssc.php.

References compileChildren().

Referenced by compileImport().

Here is the caller graph for this function:

scssc::injectVariables | ( | array | $args | ) |
| protected

Definition at line 1564 of file scssc.php.

References set().

Referenced by compile().

Here is the caller graph for this function:

scssc::isSelfExtend | ( |  | $target,
|  |  | $origin
| ) |  |
| protected

Definition at line 137 of file scssc.php.

Referenced by pushExtends().

Here is the caller graph for this function:

scssc::isTruthy | ( |  | $value | ) |
| protected

Definition at line 847 of file scssc.php.

Referenced by compileChild(), and lib_if().

Here is the caller graph for this function:

scssc::joinSelectors | ( |  | $parent,
|  |  | $child
| ) |  |
| protected

Definition at line 1368 of file scssc.php.

Referenced by multiplySelectors().

Here is the caller graph for this function:

scssc::lib_abs | ( |  | $args | ) |
| protected

Definition at line 2311 of file scssc.php.

scssc::lib_adjust_color | ( |  | $args | ) |
| protected

Definition at line 2006 of file scssc.php.

References alter_color().

scssc::lib_adjust_hue | ( |  | $args | ) |
| protected

Definition at line 2176 of file scssc.php.

References adjustHsl(), assertColor(), and assertNumber().

scssc::lib_alpha | ( |  | $args | ) |
| protected

Definition at line 2080 of file scssc.php.

References coerceColor().

Referenced by lib_opacity().

Here is the caller graph for this function:

scssc::lib_append | ( |  | $args | ) |
| protected

Definition at line 2399 of file scssc.php.

References coerceList(), and listSeparatorForJoin().

scssc::lib_blue | ( |  | $args | ) |
| protected

Definition at line 2074 of file scssc.php.

References coerceColor().

scssc::lib_ceil | ( |  | $args | ) |
| protected

Definition at line 2304 of file scssc.php.

scssc::lib_change_color | ( |  | $args | ) |
| protected

Definition at line 2017 of file scssc.php.

References alter_color().

scssc::lib_comparable | ( |  | $args | ) |
| protected

Definition at line 2463 of file scssc.php.

References normalizeNumber(), and throwError().

scssc::lib_complement | ( |  | $args | ) |
| protected

Definition at line 2220 of file scssc.php.

References adjustHsl(), and assertColor().

scssc::lib_counter | ( |  | $args | ) |
| protected

Workaround IE7's content counter bug.

Parameters

  array | $args |

Definition at line 2480 of file scssc.php.

scssc::lib_darken | ( |  | $args | ) |
| protected

Definition at line 2190 of file scssc.php.

References adjustHsl(), assertColor(), and coercePercent().

scssc::lib_desaturate | ( |  | $args | ) |
| protected

Definition at line 2206 of file scssc.php.

References adjustHsl(), assertColor(), and coercePercent().

scssc::lib_fade_in | ( |  | $args | ) |
| protected

Definition at line 2247 of file scssc.php.

References lib_opacify().

scssc::lib_fade_out | ( |  | $args | ) |
| protected

Definition at line 2263 of file scssc.php.

References lib_transparentize().

scssc::lib_floor | ( |  | $args | ) |
| protected

Definition at line 2297 of file scssc.php.

scssc::lib_grayscale | ( |  | $args | ) |
| protected

Definition at line 2213 of file scssc.php.

References adjustHsl(), and assertColor().

scssc::lib_green | ( |  | $args | ) |
| protected

Definition at line 2068 of file scssc.php.

References coerceColor().

scssc::lib_hsl | ( |  | $args | ) |
| protected

Definition at line 2132 of file scssc.php.

References toRGB().

scssc::lib_hsla | ( |  | $args | ) |
| protected

Definition at line 2139 of file scssc.php.

References toRGB().

scssc::lib_hue | ( |  | $args | ) |
| protected

Definition at line 2147 of file scssc.php.

References assertColor(), and toHSL().

scssc::lib_ie_hex_str | ( |  | $args | ) |
| protected

Definition at line 2054 of file scssc.php.

References coerceColor().

scssc::lib_if | ( |  | $args | ) |
| protected

Definition at line 1928 of file scssc.php.

References isTruthy().

scssc::lib_index | ( |  | $args | ) |
| protected

Definition at line 1935 of file scssc.php.

References assertList(), and normalizeValue().

scssc::lib_invert | ( |  | $args | ) |
| protected

Definition at line 2225 of file scssc.php.

References assertColor().

scssc::lib_join | ( |  | $args | ) |
| protected

Definition at line 2390 of file scssc.php.

References coerceList(), and listSeparatorForJoin().

scssc::lib_length | ( |  | $args | ) |
| protected

Definition at line 2365 of file scssc.php.

References coerceList().

scssc::lib_lighten | ( |  | $args | ) |
| protected

Definition at line 2183 of file scssc.php.

References adjustHsl(), assertColor(), and coercePercent().

scssc::lib_lightness | ( |  | $args | ) |
| protected

Definition at line 2161 of file scssc.php.

References assertColor(), and toHSL().

scssc::lib_max | ( |  | $args | ) |
| protected

Definition at line 2329 of file scssc.php.

References getNormalizedNumbers().

scssc::lib_min | ( |  | $args | ) |
| protected

Definition at line 2317 of file scssc.php.

References getNormalizedNumbers().

scssc::lib_mix | ( |  | $args | ) |
| protected

Definition at line 2098 of file scssc.php.

References assertColor(), coercePercent(), and fixColor().

scssc::lib_nth | ( |  | $args | ) |
| protected

Definition at line 2371 of file scssc.php.

References assertNumber(), and coerceList().

scssc::lib_opacify | ( |  | $args | ) |
| protected

Definition at line 2237 of file scssc.php.

References assertColor(), and coercePercent().

Referenced by lib_fade_in().

Here is the caller graph for this function:

scssc::lib_opacity | ( |  | $args | ) |
| protected

Definition at line 2090 of file scssc.php.

References lib_alpha().

scssc::lib_percentage | ( |  | $args | ) |
| protected

Definition at line 2283 of file scssc.php.

References coercePercent().

scssc::lib_quote | ( |  | $args | ) |
| protected

Definition at line 2275 of file scssc.php.

scssc::lib_red | ( |  | $args | ) |
| protected

Definition at line 2062 of file scssc.php.

References coerceColor().

scssc::lib_rgb | ( |  | $args | ) |
| protected

Definition at line 1949 of file scssc.php.

scssc::lib_rgba | ( |  | $args | ) |
| protected

Definition at line 1957 of file scssc.php.

References assertNumber(), and coerceColor().

scssc::lib_round | ( |  | $args | ) |
| protected

Definition at line 2290 of file scssc.php.

scssc::lib_saturate | ( |  | $args | ) |
| protected

Definition at line 2197 of file scssc.php.

References adjustHsl(), assertColor(), and coercePercent().

scssc::lib_saturation | ( |  | $args | ) |
| protected

Definition at line 2154 of file scssc.php.

References assertColor(), and toHSL().

scssc::lib_scale_color | ( |  | $args | ) |
| protected

Definition at line 2049 of file scssc.php.

References alter_color().

scssc::lib_transparentize | ( |  | $args | ) |
| protected

Definition at line 2253 of file scssc.php.

References assertColor(), and coercePercent().

Referenced by lib_fade_out().

Here is the caller graph for this function:

scssc::lib_type_of | ( |  | $args | ) |
| protected

Definition at line 2429 of file scssc.php.

References coerceColor().

scssc::lib_unit | ( |  | $args | ) |
| protected

Definition at line 2448 of file scssc.php.

scssc::lib_unitless | ( |  | $args | ) |
| protected

Definition at line 2457 of file scssc.php.

scssc::lib_unquote | ( |  | $args | ) |
| protected

Definition at line 2268 of file scssc.php.

scssc::lib_zip | ( |  | $args | ) |
| protected

Definition at line 2406 of file scssc.php.

References assertList().

scssc::listSeparatorForJoin | ( |  | $list1,
|  |  | $sep
| ) |  |
| protected

Definition at line 2377 of file scssc.php.

References compileValue().

Referenced by lib_append(), and lib_join().

Here is the caller graph for this function:

scssc::makeOutputBlock | ( |  | $type,
|  |  | $selectors = `null`
| ) |  |
| protected

Definition at line 164 of file scssc.php.

Referenced by compileBlock(), compileMedia(), compileNestedBlock(), and compileRoot().

Here is the caller graph for this function:

scssc::matchExtends | ( |  | $selector,
|  | & | $out,
|  |  | $from = `0`,
|  |  | $initial = `true`
| ) |  |
| protected

Definition at line 243 of file scssc.php.

References matchExtendsSingle().

Referenced by flattenSelectors().

Here is the caller graph for this function:

scssc::matchExtendsSingle | ( |  | $single,
|  | & | $outOrigin
| ) |  |
| protected

Definition at line 176 of file scssc.php.

References combineSelectorSingle().

Referenced by matchExtends().

Here is the caller graph for this function:

scssc::mediaParent | ( |  | $scope | ) |
| protected

Definition at line 370 of file scssc.php.

Referenced by compileMedia().

Here is the caller graph for this function:

scssc::mergeMediaTypes | ( |  | $type1,
|  |  | $type2
| ) |  |
| protected

Definition at line 559 of file scssc.php.

Referenced by compileMediaQuery().

Here is the caller graph for this function:

scssc::multiplyMedia | ( |  | $env,
|  |  | $childQueries = `null`
| ) |  |
| protected

Definition at line 1397 of file scssc.php.

Referenced by compileMedia().

Here is the caller graph for this function:

scssc::multiplySelectors | ( |  | $env | ) |
| protected

Definition at line 1343 of file scssc.php.

References joinSelectors().

Referenced by compileBlock().

Here is the caller graph for this function:

scssc::normalizeName | ( |  | $name | ) |
| protected

Definition at line 1516 of file scssc.php.

Referenced by callBuiltin(), get(), registerFunction(), set(), and unregisterFunction().

Here is the caller graph for this function:

scssc::normalizeNumber | ( |  | $number | ) |
| protected

Definition at line 1064 of file scssc.php.

Referenced by getNormalizedNumbers(), lib_comparable(), normalizeValue(), and reduce().

Here is the caller graph for this function:

scssc::normalizeValue | ( |  | $value | ) |

Definition at line 1042 of file scssc.php.

References coerceForExpression(), compileValue(), extractInterpolation(), normalizeNumber(), and reduce().

Referenced by lib_index().

Here is the caller graph for this function:

scssc::op_add | ( |  | $left,
|  |  | $right
| ) |  |
| protected

Definition at line 1104 of file scssc.php.

References coerceString().

scssc::op_add_number_number | ( |  | $left,
|  |  | $right
| ) |  |
| protected

Definition at line 1083 of file scssc.php.

scssc::op_and | ( |  | $left,
|  |  | $right,
|  |  | $shouldEval
| ) |  |
| protected

Definition at line 1122 of file scssc.php.

scssc::op_color_color | ( |  | $op,
|  |  | $left,
|  |  | $right
| ) |  |
| protected

Definition at line 1134 of file scssc.php.

References fixColor(), op_eq(), op_neq(), and throwError().

Referenced by op_color_number(), and op_number_color().

Here is the caller graph for this function:

scssc::op_color_number | ( |  | $op,
|  |  | $left,
|  |  | $right
| ) |  |
| protected

Definition at line 1173 of file scssc.php.

References op_color_color().

scssc::op_div_number_number | ( |  | $left,
|  |  | $right
| ) |  |
| protected

Definition at line 1095 of file scssc.php.

scssc::op_eq | ( |  | $left,
|  |  | $right
| ) |  |
| protected

Definition at line 1185 of file scssc.php.

References coerceString(), compileValue(), and toBool().

Referenced by op_color_color().

Here is the caller graph for this function:

scssc::op_gt_number_number | ( |  | $left,
|  |  | $right
| ) |  |
| protected

Definition at line 1203 of file scssc.php.

References toBool().

scssc::op_gte_number_number | ( |  | $left,
|  |  | $right
| ) |  |
| protected

Definition at line 1199 of file scssc.php.

References toBool().

scssc::op_lt_number_number | ( |  | $left,
|  |  | $right
| ) |  |
| protected

Definition at line 1211 of file scssc.php.

References toBool().

scssc::op_lte_number_number | ( |  | $left,
|  |  | $right
| ) |  |
| protected

Definition at line 1207 of file scssc.php.

References toBool().

scssc::op_mod_number_number | ( |  | $left,
|  |  | $right
| ) |  |
| protected

Definition at line 1099 of file scssc.php.

scssc::op_mul_number_number | ( |  | $left,
|  |  | $right
| ) |  |
| protected

Definition at line 1087 of file scssc.php.

scssc::op_neq | ( |  | $left,
|  |  | $right
| ) |  |
| protected

Definition at line 1195 of file scssc.php.

References toBool().

Referenced by op_color_color().

Here is the caller graph for this function:

scssc::op_number_color | ( |  | $op,
|  |  | $left,
|  |  | $right
| ) |  |
| protected

Definition at line 1179 of file scssc.php.

References op_color_color().

scssc::op_or | ( |  | $left,
|  |  | $right,
|  |  | $shouldEval
| ) |  |
| protected

Definition at line 1128 of file scssc.php.

scssc::op_sub_number_number | ( |  | $left,
|  |  | $right
| ) |  |
| protected

Definition at line 1091 of file scssc.php.

scssc::popEnv | ( |  | ) |
| protected

Definition at line 1612 of file scssc.php.

Referenced by compile(), compileBlock(), compileChild(), compileMedia(), compileNestedBlock(), and reduce().

Here is the caller graph for this function:

scssc::pushEnv | ( |  | $block = `null` | ) |
| protected

Definition at line 1505 of file scssc.php.

Referenced by compile(), compileBlock(), compileChild(), compileMedia(), compileNestedBlock(), and reduce().

Here is the caller graph for this function:

scssc::pushExtends | ( |  | $target,
|  |  | $origin
| ) |  |
| protected

Definition at line 147 of file scssc.php.

References isSelfExtend().

Referenced by compileChild().

Here is the caller graph for this function:

scssc::reduce | ( |  | $value,
|  |  | $inExp = `false`
| ) |  |
| protected

Definition at line 865 of file scssc.php.

References applyArguments(), callBuiltin(), coerceForExpression(), coerceUnit(), compileChildren(), expToString(), normalizeNumber(), popEnv(), pushEnv(), shouldEval(), and throwError().

Referenced by applyArguments(), callBuiltin(), compileChild(), compileValue(), expToString(), and normalizeValue().

Here is the caller graph for this function:

scssc::registerFunction | ( |  | $name,
|  |  | $func
| ) |  |

Definition at line 1638 of file scssc.php.

References normalizeName().

scssc::scale_color_helper | ( |  | $base,
|  |  | $scale,
|  |  | $i
| ) |  |
| protected

Definition at line 2025 of file scssc.php.

scssc::set | ( |  | $name,
|  |  | $value,
|  |  | $shadow = `false`
| ) |  |
| protected

Definition at line 1524 of file scssc.php.

References normalizeName(), setExisting(), and setRaw().

Referenced by applyArguments(), compileChild(), and injectVariables().

Here is the caller graph for this function:

scssc::setExisting | ( |  | $name,
|  |  | $value,
|  |  | $env = `null`
| ) |  |
| protected

Definition at line 1534 of file scssc.php.

References getStoreEnv().

Referenced by set().

Here is the caller graph for this function:

scssc::setFormatter | ( |  | $formatterName | ) |

Definition at line 1634 of file scssc.php.

scssc::setImportPaths | ( |  | $path | ) |

Definition at line 1626 of file scssc.php.

scssc::setNumberPrecision | ( |  | $numberPrecision | ) |

Definition at line 1630 of file scssc.php.

References $numberPrecision.

scssc::setRaw | ( |  | $name,
|  |  | $value
| ) |  |
| protected

Definition at line 1544 of file scssc.php.

References getStoreEnv().

Referenced by compileChild(), and set().

Here is the caller graph for this function:

scssc::setVariables | ( | array | $variables | ) |

Set variables.

Parameters

  array | $variables |

Definition at line 1597 of file scssc.php.

scssc::shouldEval | ( |  | $value | ) |
| protected

Definition at line 852 of file scssc.php.

Referenced by reduce().

Here is the caller graph for this function:

scssc::sortArgs | ( |  | $prototype,
|  |  | $args
| ) |  |
| protected

Definition at line 1747 of file scssc.php.

Referenced by callBuiltin().

Here is the caller graph for this function:

scssc::throwError | ( |  | $msg = `null` | ) |

Definition at line 2485 of file scssc.php.

Referenced by applyArguments(), assertColor(), assertList(), assertNumber(), compileChild(), compileValue(), getNormalizedNumbers(), lib_comparable(), op_color_color(), and reduce().

Here is the caller graph for this function:

scssc::toBool | ( |  | $thing | ) |

Definition at line 1215 of file scssc.php.

Referenced by op_eq(), op_gt_number_number(), op_gte_number_number(), op_lt_number_number(), op_lte_number_number(), and op_neq().

Here is the caller graph for this function:

scssc::toHSL | ( |  | $red,
|  |  | $green,
|  |  | $blue
| ) |  |

Definition at line 1859 of file scssc.php.

Referenced by adjustHsl(), alter_color(), lib_hue(), lib_lightness(), and lib_saturation().

Here is the caller graph for this function:

scssc::toRGB | ( |  | $hue,
|  |  | $saturation,
|  |  | $lightness
| ) |  |

Definition at line 1905 of file scssc.php.

References hueToRGB().

Referenced by adjustHsl(), alter_color(), lib_hsl(), and lib_hsla().

Here is the caller graph for this function:

scssc::unregisterFunction | ( |  | $name | ) |

Definition at line 1642 of file scssc.php.

References normalizeName().

scssc::unsetVariable | ( |  | $name | ) |

Unset variable.

Parameters

  string | $name |

Definition at line 1607 of file scssc.php.

## Member Data Documentation

scssc::$cssColors
| static protected

CSS Colors.

See also
  http://www.w3.org/TR/css3-color

Definition at line 2502 of file scssc.php.

scssc::$defaultValue = array("keyword", "")
| static

Definition at line 85 of file scssc.php.

Referenced by get().

scssc::$false = array("keyword", "false")
| static

Definition at line 82 of file scssc.php.

scssc::$formatter = "scss_formatter_nested"
| protected

Definition at line 96 of file scssc.php.

scssc::$importCache = array()
| protected

Definition at line 89 of file scssc.php.

scssc::$importPaths = array("")
| protected

Definition at line 88 of file scssc.php.

scssc::$lib_abs = array("value")
| static protected

Definition at line 2310 of file scssc.php.

scssc::$lib_adjust_color
| static protected

Initial value:
= array(
"color", "red", "green", "blue",
"hue", "saturation", "lightness", "alpha"
)

Definition at line 1999 of file scssc.php.

scssc::$lib_adjust_hue = array("color", "degrees")
| static protected

Definition at line 2175 of file scssc.php.

scssc::$lib_alpha = array("color")
| static protected

Definition at line 2079 of file scssc.php.

scssc::$lib_append = array("list", "val", "separator")
| static protected

Definition at line 2398 of file scssc.php.

scssc::$lib_blue = array("color")
| static protected

Definition at line 2073 of file scssc.php.

scssc::$lib_ceil = array("value")
| static protected

Definition at line 2303 of file scssc.php.

scssc::$lib_change_color
| static protected

Initial value:
= array(
"color", "red", "green", "blue",
"hue", "saturation", "lightness", "alpha"
)

Definition at line 2010 of file scssc.php.

scssc::$lib_comparable = array("number-1", "number-2")
| static protected

Definition at line 2462 of file scssc.php.

scssc::$lib_complement = array("color")
| static protected

Definition at line 2219 of file scssc.php.

scssc::$lib_darken = array("color", "amount")
| static protected

Definition at line 2189 of file scssc.php.

scssc::$lib_desaturate = array("color", "amount")
| static protected

Definition at line 2205 of file scssc.php.

scssc::$lib_fade_in = array("color", "amount")
| static protected

Definition at line 2246 of file scssc.php.

scssc::$lib_fade_out = array("color", "amount")
| static protected

Definition at line 2262 of file scssc.php.

scssc::$lib_floor = array("value")
| static protected

Definition at line 2296 of file scssc.php.

scssc::$lib_grayscale = array("color")
| static protected

Definition at line 2212 of file scssc.php.

scssc::$lib_green = array("color")
| static protected

Definition at line 2067 of file scssc.php.

scssc::$lib_hsl = array("hue", "saturation", "lightness")
| static protected

Definition at line 2131 of file scssc.php.

scssc::$lib_hsla
| static protected

Initial value:
= array("hue", "saturation",
"lightness", "alpha")

Definition at line 2137 of file scssc.php.

scssc::$lib_hue = array("color")
| static protected

Definition at line 2146 of file scssc.php.

scssc::$lib_ie_hex_str = array("color")
| static protected

Definition at line 2053 of file scssc.php.

scssc::$lib_if = array("condition", "if-true", "if-false")
| static protected

Definition at line 1927 of file scssc.php.

scssc::$lib_index = array("list", "value")
| static protected

Definition at line 1934 of file scssc.php.

scssc::$lib_invert = array("color")
| static protected

Definition at line 2224 of file scssc.php.

scssc::$lib_join = array("list1", "list2", "separator")
| static protected

Definition at line 2389 of file scssc.php.

scssc::$lib_length = array("list")
| static protected

Definition at line 2364 of file scssc.php.

scssc::$lib_lighten = array("color", "amount")
| static protected

Definition at line 2182 of file scssc.php.

scssc::$lib_lightness = array("color")
| static protected

Definition at line 2160 of file scssc.php.

scssc::$lib_mix = array("color-1", "color-2", "weight")
| static protected

Definition at line 2097 of file scssc.php.

scssc::$lib_nth = array("list", "n")
| static protected

Definition at line 2370 of file scssc.php.

scssc::$lib_opacify = array("color", "amount")
| static protected

Definition at line 2236 of file scssc.php.

scssc::$lib_opacity = array("color")
| static protected

Definition at line 2089 of file scssc.php.

scssc::$lib_percentage = array("value")
| static protected

Definition at line 2282 of file scssc.php.

scssc::$lib_quote = array("string")
| static protected

Definition at line 2274 of file scssc.php.

scssc::$lib_red = array("color")
| static protected

Definition at line 2061 of file scssc.php.

scssc::$lib_rgb = array("red", "green", "blue")
| static protected

Definition at line 1948 of file scssc.php.

scssc::$lib_rgba
| static protected

Initial value:
= array(
array("red", "color"),
"green", "blue", "alpha")

Definition at line 1954 of file scssc.php.

scssc::$lib_round = array("value")
| static protected

Definition at line 2289 of file scssc.php.

scssc::$lib_saturate = array("color", "amount")
| static protected

Definition at line 2196 of file scssc.php.

scssc::$lib_saturation = array("color")
| static protected

Definition at line 2153 of file scssc.php.

scssc::$lib_scale_color
| static protected

Initial value:
= array(
"color", "red", "green", "blue",
"hue", "saturation", "lightness", "alpha"
)

Definition at line 2021 of file scssc.php.

scssc::$lib_transparentize = array("color", "amount")
| static protected

Definition at line 2252 of file scssc.php.

scssc::$lib_type_of = array("value")
| static protected

Definition at line 2428 of file scssc.php.

scssc::$lib_unit = array("number")
| static protected

Definition at line 2447 of file scssc.php.

scssc::$lib_unitless = array("number")
| static protected

Definition at line 2456 of file scssc.php.

scssc::$lib_unquote = array("string")
| static protected

Definition at line 2267 of file scssc.php.

scssc::$namespaces
| static protected

Initial value:
= array(
"special" => "%",
"mixin" => "@",
"function" => "^",
)

Definition at line 64 of file scssc.php.

scssc::$null = array("null")
| static

Definition at line 83 of file scssc.php.

scssc::$numberPrecision = 5
| protected

Definition at line 94 of file scssc.php.

Referenced by setNumberPrecision().

scssc::$operatorNames
| static protected

Initial value:
= array(
'+' => "add",
'-' => "sub",
'*' => "mul",
'/' => "div",
'%' => "mod",
'==' => "eq",
'!=' => "neq",
'<' => "lt",
'>' => "gt",
'<=' => "lte",
'>=' => "gte",
)

Definition at line 48 of file scssc.php.

scssc::$registeredVars = array()
| protected

Definition at line 92 of file scssc.php.

scssc::$selfSelector = array("self")
| static

Definition at line 86 of file scssc.php.

Referenced by scss_parser\selectorSingle().

scssc::$true = array("keyword", "true")
| static

Definition at line 81 of file scssc.php.

scssc::$unitTable
| static protected

Initial value:
= array(
"in" => array(
"in" => 1,
"pt" => 72,
"pc" => 6,
"cm" => 2.54,
"mm" => 25.4,
"px" => 96,
)
)

Definition at line 70 of file scssc.php.

scssc::$userFunctions = array()
| protected

Definition at line 91 of file scssc.php.

scssc::$VERSION = 'v0.0.12'
| static

Definition at line 46 of file scssc.php.

Referenced by scss_server\compile(), and scss_server\serve().

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

- lib/ScoutLib/scssc.php